Jules Bean wrote:
Peter Padawitz wrote:
What is so bad about making compFoo part of the class? It reduces the
code (constraints can be avoided) and reflects the close connection
between a signature Sig (implemented by the class) and the
evaluation (compFoo) of Sig-terms in Sig-algebras.
making it part of the class allows instances to override the
implementation.
Which in this case is a strange thing to do.
Sure, but this can only happen because Haskell does not check whether
the instances satisfy the equations in the class. The type class concept
would be "cleaner" if all methods (partially or totally) defined by
equations within the class were not allowed to be instantiated!
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe