krisajenkins/knapsack-haskell — pull request #2 by purcell (2014-08-09 12:24:31+00:00)
Title: Eliminate Costed typeclass

Imagine that songs have both prices and durations, so you might want to
knapsack them by duration into a time limit, or instead pack them by
price into a total budget.

Using a Costed typeclass for this, you're limited to a single instance
of Costed per module, which is a code smell. The solution is to simply
parameterise knapsack on the costing function, so that the Costed
typeclass becomes a regular type.