XGitUrl: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=monad_transformers.mdwn;h=53a1689908c07b4aed6c4407e75c0042c5455971;hp=d6a22982875f291a10da57399971c2f5514d805f;hb=369a3c9c051123eb7ff351eef8dab42480bc43f4;hpb=97c21e1281097b84fa3a1855573135ca56ba2fb3
diff git a/monad_transformers.mdwn b/monad_transformers.mdwn
index d6a22982..53a16899 100644
 a/monad_transformers.mdwn
+++ b/monad_transformers.mdwn
@@ 1,6 +1,7 @@
[[!toc]]
##Multilayered monadic boxes##
+Multilayered monadic boxes
+===========================
So far, we've defined monads as singlelayered boxes. Though in the Groenendijk, Stokhof, and Veltman homework, we had to figure out how to combine Reader, State, and Set monads in an adhoc way. In practice, one often wants to combine the abilities of several monads. Corresponding to each monad like Reader, there's a corresponding ReaderT **monad transformer**. That takes an existing monad M and wraps Readerish monad packaging around it. The way these are defined parallels the way the singlelayer versions are defined. For example, here's the Reader monad:
@@ 116,6 +117,15 @@ As best we know, figuring out how a monad transformer should be defined is still
Apart from whose interface is outermost, the behavior of a StateT(Maybe) and a MaybeT(State) will partly coincide. But in certain crucial respects they will diverge, and you need to think carefully about which behavior you want and what the appropriate layering is for your needs. (MORE...)
+
+Further Reading
+
+
+* This is excellent, everyone should read: [Monad Transformers Step by Step](http://www.grabmueller.de/martin/www/pub/Transformers.pdf)
+
+* Read Part III of [All About Monads](http://web.archive.org/web/20071106232016/haskell.org/all_about_monads/html/introIII.html). This link is to an archived version, the main link to haskell.org seems to be broken. Some but not all of this site has been [absorbed into the Haskell wikibook](http://en.wikibooks.org/wiki/Haskell/Monad_transformers).
+
+
Tree Monads
===========
@@ 195,18 +205,10 @@ You have to instead say something like this:
 : ('_a, int) Tree_monad.m =
Further Reading


* This is excellent, everyone should read: [Monad Transformers Step by Step](http://www.grabmueller.de/martin/www/pub/Transformers.pdf)

* Read Part III of [All About Monads](http://web.archive.org/web/20071106232016/haskell.org/all_about_monads/html/introIII.html). This link is to an archived version, the main link to haskell.org seems to be broken. Some but not all of this site has been [absorbed into the Haskell wikibook](http://en.wikibooks.org/wiki/Haskell/Monad_transformers).

How is all this related to our tree\_monadize function?


Recall our earlier definition of `tree_monadize`, specialized for the Reader monad:
let rec tree_monadize (f : 'a > 'b reader) (t : 'a tree) : 'b tree reader =