You're supposed to use mtl
to make that work. mtl
and transformers
aren't really competitors -- mtl
depends on transformers! It exists to to add classes like MonadState
that use functional dependencies so they don't have to be part of the core (Haskell-98) type definitions. There's also a package (monads-tf
) that uses type families instead, which is also compatible with transformers
(but, really, you shouldn't use it).
Maybe I should be asking: Why are you "switching from mtl to transformers"?