Peter Padawitz wrote:
Yes, the recursive calls of compCommand are supposed to be calls of
compBlock.
The intention of the program is a generic evaluator comp... of
Sigma-terms in arbitrary Sigma-algebras. The signature Sigma is given by
the first 4 types (and the corresponding functions in the class
declaration), the terms are the objects of the types, and the algebras
are the class instances.
The problem with my implementation in terms of multiple-parameter
classes seems to be - I conclude this from Ryan's comment - that the
intended dependency among the parameters is not reflected here. But what
are the alternatives? Roughly said, I need a construct that allows me
gather several type variables such that an instance is always an
instance of all of them.
well, given
class Java a b c d where ....
if it is true that everything is determined by choice of any one of
them, you could write
class Java a b c d | a -> b, b -> c, c -> d, d -> a where...
otherwise, well you can express whatever dependency network you want...
Jules
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe