[Haskell-cafe] Is there an escape from MonadState+MonadIO+MonadError monad stack?

Kim-Ee Yeoh ky3 at atamo.com
Sat Apr 6 23:40:46 CEST 2013


On Sun, Apr 7, 2013 at 4:22 AM, Ömer Sinan Ağacan <omeragacan at gmail.com> wrote:
> I'm a hobbyist Haskell programmer and my use of Haskell is mostly
> consists of writing interpreters, simple virtual machines, and type
> checkers.
>
> One thing I'm not happy about my Haskell programs is, almost all of my
> programs have a monad transformer stack consisting MonadError, MonadIO
> and MonadState.

Welcome! Hobbyist Haskellers writing VMs and type checkers are a
critical part of the community and what sets us apart.

Not as well-known as it should be is the fact that GHC doesn't make
much use of monad transformers. Have you taken a look at the sources?
That might provide ideas on future ways of structuring your
experiments.

Also, what precisely are the infelicities with monad transformers in
your code? Depth of stack? Forced type annotation? Syntax inflation
due to extra lift* functions?

Monad transformers provide an abstraction which may not be necessary
for some apps. But it's easy to write something and then suddenly, the
need for generalization kicks in.

-- Kim-Ee



More information about the Haskell-Cafe mailing list