[Haskell-beginners] Monad transformers

Brandon Allbery allbery.b at gmail.com
Sat Sep 19 01:30:38 UTC 2015


On Fri, Sep 18, 2015 at 9:00 PM, Andrew Bernard <andrew.bernard at gmail.com>
wrote:

> Is this how normal Haskell is developed and written in practice? I find
> the type and the function impenetrably dense and difficult to understand.
> Should I be aspiring to have my functions look and work like this? Of
> course it depends on what you want to do, but the essence of the question
> is, does Haskell ultimately end up looking like this for any real
> programming, beyond textbook list manipulation functions?


If you need that, then yes. If not, then no.

Usually that kind of thing is packaged up in higher level libraries; the
type Eval6 would be exposed, the underlying stuff is used internally and
you would not normally need to know or care about it unless you were
specifically working on the internals of that library. Most applications
you would write, you only care about Eval6 and any functions exported along
with it.

That said, I think in most cases you would use a newtype and derive through
MonadReader, MonadError, MonadState, and MonadIO so you can ignore
precisely how the type was built and just use it.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150918/a0116403/attachment.html>


More information about the Beginners mailing list