AW: Newbie qustion about monads
Juanma Barranquero
jmbarranquero at laley.wke.es
Thu Oct 2 15:25:41 EDT 2003
On Thu, 2 Oct 2003 13:16:13 +0200
Markus.Schnell at infineon.com wrote:
> The Monad class is just called Monad because it is intended
> to cover a monad. But it doesn't ensure the laws. That is your
> sole responsibility.
Yeah, I know. But it's difficult to ensure I'm satisfying the laws when
I'm not entirely sure what do they ask from me...
> You can define it to your liking as long as it is commutative.
Ah, that's what I was expecting. So, in both my examples, defining:
instance Eq MyMonad where
MM _ x == MM _ y = x == y
would suffice and the first law would be satisfied.
Thanks,
Juanma
More information about the Haskell-Cafe
mailing list