class (Eq e, GenExpr e, MonadRandom m) => GenProg m e | e -> m where
Excactly, I can’t understand this GenProg m e | e -> m
I guess GenProg is a constructor.
does that means: the one whose pattern matched GenProg m e or e -> m, whose instance can be defined ?
by the way, where can i get all syntax in haskell?
It’s a multiparameter type class with a functional dependency.
GenProgis the name of the class, the two parameters arem(which has to be an instance ofMonadRandom) ande(which has to be an instance ofEqandGenExpr). Then the|separates the instance head from the functional dependencye -> m, which says that the typeein an instance determines the type constructorm, in other words, for any typeethere can be at most onemsuch that anappears in a valid programme. (I.e., if there is more than one such instance declaration with the same
e, there will be a compilation error.)