Hacker News new | ask | show | jobs
by jmaker 1221 days ago
Wel IO is State, cf. https://hackage.haskell.org/package/transformers-0.6.1.0/doc...

You set up your pipeline in terms of monads and then when you want to execute it you run it in IO. You can generalize IO to MonadIO or define an alias to some transformer pinned at IO. It adds a Computational overhead. Transformers are a solution to monad composition which isn’t naturally possible.

1 comments

Yes and they are essential to working in serious, modern Haskell. You could never be an intermediate without know how to use them.
Would it be possible to give an example of monad composition that shows both state and Io on one computation unit?