[Haskell-cafe] MonadLib usage

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Sun Jul 18 09:27:27 EDT 2010

Emil Melnikov <emilmeln at gmail.com> writes:

> Recently I discovered for myself "monadLib" as an alternative for
> mtl-like packages. It seems that "monadLib" has better interface,
> but I'm quite confused with it's type classes: they have the
> monad type variable before the effect type variable (e.g.
> "ReaderM m i" instead of "ReaderM i m").  AFAIU, this ordering
> makes impossible to use these type classes in conjunction with
> GHC's cunning newtype deriving extension.  Of course one can
> easily derive all instances using functionality provided by
> "MonadLib.Derive" module, but this is a boilerplate.  Is there
> any way to avoid this boilerplate?

When discussing a similar issue with Manuel Chakravarty, he convinced me
that cunning newtype deriving is actually rather bad in practice and
shouldn't be used as there's a lack of proofs or some such (I can't
remember the arguments, but I remember being convinced by them :p).

Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com

More information about the Haskell-Cafe mailing list