From 369a3c9c051123eb7ff351eef8dab42480bc43f4 Mon Sep 17 00:00:00 2001
From: Jim Pryor
Date: Sun, 12 Dec 2010 18:13:10 0500
Subject: [PATCH] tweak transformers
Signedoffby: Jim Pryor

monad_transformers.mdwn  20 +++++++++++
1 file changed, 11 insertions(+), 9 deletions()
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 =

2.11.0