Type classes are for reusability
I see a certain overuse of typeclasses in Haskell libraries. Type classes are not intended for massive re-use of some short identifier or in order to access some syntactic sugar (e.g. do notation or number literals. Instead type classes exist for writing reusable code.Functions written using the
Thus, think twice:Do you really need a
and indeed NumericPrelude 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 be better a custom type?Do you really need a
Or did you define the instance only for the do notation? Ever considered a monoid instead?