Type classes are for reusability
(good and bad examples of type class use)
Latest revision as of 15:59, 20 January 2009
I see a certain overuse of typeclasses in Haskell libraries.Type classes are not intended for massive re-use of some short identifier like
Thus, think twice:Do you really need a
and indeed Numeric Prelude chooses a different set of operations. But it is generally accepted that number literals are reserved for objects that allow some sort of arithmetics.)Isn't
What distinguishes the second member from the first member? Is the generic pair type the right choice, or should it better be a custom type?Do you really need a
Or did you define the instance only for the do notation? Please, give the monoid a try!