[Haskell-cafe] Data declaration vs type classes
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.
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