Martin Grabmüller: Monad Transformers Step by Step, draft paper, October 2006.
12 pages, A4 format, English.
In this tutorial, we describe how to use monad transformers in order to incrementally add functionality to Haskell programs. It is not a paper about implementing transformers, but about using them to write elegant, clean and powerful programs in Haskell. Starting from an evaluation function for simple expressions, we convert it to monadic style and incrementally add error handling, environment passing, state, logging and input/output by composing monad transformers.
This article is available electronically: [ PDF ]
The source code of this article, in the form of a Literate Haskell script, is also available: [ Transformers.lhs ]
@Unpublished{Grabmueller2006MonadTransformers,
author = {Martin Grabm{\"u}ller},
title = {{Monad Transformers Step by Step}},
note = {Draft paper},
month = {October},
year = 2006,
abstract = {In this tutorial, we describe how to use monad
transformers in order to incrementally add
functionality to Haskell programs. It is not a paper
about implementing transformers, but about using
them to write elegant, clean and powerful programs
in Haskell. Starting from an evaluation function for
simple expressions, we convert it to monadic style
and incrementally add error handling, environment
passing, state, logging and input/output by
composing monad transformers.}
}