[Haskell-cafe] Data declaration vs type classes

Imants Cekusins imantc at gmail.com
Fri Jan 8 11:06:14 UTC 2016


> Well, there is -fwarn-incomplete-patterns, which should be included in
-Wall, which does exactly this.

cheers Jonas. will try this.


another thing:

class lets reuse the same method name for several types.

with pattern matching, different types require different function
names. it is possible to place methods in different modules and call
them qualified, but class solution seems cleaner.

basically, classes are very convenient for standardization and
extending code. a bit like Java interfaces :-P


More information about the Haskell-Cafe mailing list