[Haskell-cafe] Adding Ord constraint to instance Monad Set?
wolfgang at jeltsch.net
Wed Mar 31 08:44:54 EST 2004
Am Mittwoch, 31. März 2004 00:11 schrieb S. Alexander Jacobson:
> Could not deduce (Ord b) from the context (Monad Set)
> arising from use of `concatSets' at dbMeta3.hs:242
> Probable fix:
> Add (Ord b) to the class or instance method `>>='
> In the definition of `>>=': >>= m k = concatSets (mapSet k m)
> In the definition for method `>>='
> In the instance declaration for `Monad Set'
> (Aside: it be really nice if the error messages
> suggested textual changes or at least provide
> sample syntax in addition to the conceptual
Hey, what do you want from a compiler? That it writes you your code? ;-)
IMO, error messages like the one above are *very* useful; they give you hints
about what you can do. If you don't know what the hints mean, you have to
have a look at the Report or whatever. (Well, in this special case, I have
to admit that I also don't know what is meant with "adding a constraint to a
class or instance method". I'd say: "adding a constraint to a class, a
method (declared with the class) or an instance".)
More information about the Haskell-Cafe