[Haskell-cafe] Cons of -XUndecidableInstances

Yitzchak Gale gale at sefer.org
Mon Jun 6 10:04:54 CEST 2011


Gregory Collins wrote:
> Surprisingly enough, mtl uses UndecidableInstances, so almost every
> practical Haskell program uses it in one way or another.

The library uses it, you don't use it directly in your program.

Anyway, transformers does the job when you need to
build on the basic monad transformers. You only need the
UndecidableInstances stuff when you need to write
functions that work for multiple different monad stacks and
you are using type classes to define common interfaces.

I find that to be a messy approach. There's almost always
a better way.

Regards,
Yitz



More information about the Haskell-Cafe mailing list