[Starting to write about typeclasses John Goerzen **20070603204434] { hunk ./en/ch05-typeclasses.xml 6 + + Typeclasses are one of the most powerful features in Haskell. They + are also at the heart of some basic language features such as equality + testing and numeric operators. Before we talk about what exactly + typeclasses are, though, we'd like to first explain the need for them. + + + + The need for typeclasses + + Let's imaging that for some unfathomable reason, the designers of the + Haskell language neglected to implement the equality test + ==. Once you got over your shock at hearing this, + you resolved to implement your own equality tests. Your program + consisted of a simple Color type, and so your first + equality test is for this type. Your first attempt might look like + this: + + + + hunk ./en/ch05-typeclasses.xml 69 + + + Overlapping Instances + + FIXME + + + + + Undecidable Instances + + FIXME + + + }