[Haskell-cafe] Why do I have to specify (Monad m) here again?

David Tolpin david.tolpin at gmail.com
Sun Feb 18 15:18:05 EST 2007

> That's completely different. The class in that case guarantees that
> the type has an "Eq" class, so it's okay to use the functions in the
> "Eq" class. You're using the guarantees supplied by the class. When
> you write instances, it's the other way around, the class has
> *requirements* that you must fulfill -- and there are multiple ways of
> doing it (Haskell won't guess, it will obey what you tell it -- if you
> don't give any class constraints it won't assume that they are there).

Hi Sebastian,

could you please point me to a reference (paper/note/something else) that explains that class constraint
in a class definition is a guarantee with regard to a type declaration but a requirement with regard to an instance

David Tolpin

More information about the Haskell-Cafe mailing list