
Jules Bean wrote:
Incidentally, I question why the "compFoo" are methods. Why not just make them polymorphic functions? They don't look like you expect instances to change them. The code continues to compile if I make them functions and amend their signatures as required.
I put compFoo into the class for the same reason why /= is part of
Try again without missing out the list... Peter Padawitz wrote: the class Eq: both functions are unique as soon as the others have been instantiated. I believe you misunderstand the reason. /= is part of Eq in case a particular instance has a particularly efficient way to implement /=, rather than using not and (==). "Being unique as soon as the others are implemented" is not a reason not to make it a method. compBlock :: (Java block command intE boolE) => Block -> block compBlock = block_ . map compCommand still retains that property. Jules