[Haskell-cafe] How do you rewrite your code?

Daniel Fischer daniel.is.fischer at web.de
Tue Mar 2 15:16:46 EST 2010

Am Dienstag 02 März 2010 21:00:56 schrieb Felipe Lessa:
> > I think the right-hand side (RHS) is more concise and simpler. The
> > types here do change: the type constructor has a Monad constraint in
> > the left-hand side and a Functor constraint in the RHS. Types that are
> > Monad instances are generally also Functor instances, so this is often
> > possible. I'm convinced the semantics are preserved, though I haven't
> > proven it.
> Yes, they are the same, always.

Provided the instances obey the monad/functor laws.

> --
> Felipe.

More information about the Haskell-Cafe mailing list