<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-11295132.post4013221249502217550..comments</id><updated>2009-12-03T17:54:57.769-08:00</updated><title type='text'>Comments on A Neighborhood of Infinity: The Mother of all Monads</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.sigfpe.com/feeds/4013221249502217550/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html'/><author><name>sigfpe</name><uri>http://www.blogger.com/profile/08096190433222340957</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-11295132.post-8587073394736390818</id><published>2009-12-03T17:54:57.769-08:00</published><updated>2009-12-03T17:54:57.769-08:00</updated><title type='text'>Secret Agent for the Dumb,

&gt;&gt;= basically applies ...</title><content type='html'>Secret Agent for the Dumb,&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;gt;= basically applies a function to each element of a list, and then flattens the entire result. But I think you got that already.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/8587073394736390818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/8587073394736390818'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1259891697769#c8587073394736390818' title=''/><author><name>sigfpe</name><uri>http://www.blogger.com/profile/08096190433222340957</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09401818062305273147'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-2287449962701886099</id><published>2009-04-19T18:15:00.000-07:00</published><updated>2009-04-19T18:15:00.000-07:00</updated><title type='text'>you lost me a bit at "ex8". I think what I see is ...</title><content type='html'>you lost me a bit at &amp;quot;ex8&amp;quot;. I think what I see is that [10,20] &amp;gt;&amp;gt;= fred is a bind in the LIST monad, and not in the continuation monad, as is the final &amp;quot;return&amp;quot; in &amp;quot;runCont ex8 return.&amp;quot; I think &amp;quot;fred&amp;quot; has type &amp;quot;x-&amp;gt;[x]&amp;quot; so [10,20]&amp;gt;&amp;gt;=fred means &amp;#39;bind [10,20] to x, build [[10,20]] and flatten one level, producing [10,20]&amp;quot;, which, if memory serves, is what the &amp;gt;&amp;gt;= of the list monad does. Have I got it?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/2287449962701886099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/2287449962701886099'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1240190100000#c2287449962701886099' title=''/><author><name>Secret Agent for the Dumb</name><uri>http://www.blogger.com/profile/00115031720080635093</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-3499466246212259692</id><published>2009-01-05T10:08:00.000-08:00</published><updated>2009-01-05T10:08:00.000-08:00</updated><title type='text'>sigfpe/rory:As a sketch for how 'ContT is terminal...</title><content type='html'>sigfpe/rory:&lt;BR/&gt;&lt;BR/&gt;As a sketch for how 'ContT is terminal':&lt;BR/&gt;&lt;BR/&gt;If you discard the information about the return value's type through quantification (using a forall, or less safely just using the current continuation in a 'very limited' manner) then you can view ContT as a right Kan extension of a functor F along itself. That can be viewed as a limit taken pointwise over a comma category - just invert the colimit example in the wikipedia article on Kan extensions to take a limit of Ran instead a colimit of Lan. That limit is a terminal object in a category of cones. &lt;BR/&gt;&lt;BR/&gt;ContT is slightly larger than this, in that you CAN abuse the current continuation. That said, to define a codensity monad and lift/lower monadic actions into it as you have done, you do not use that extra functionality.&lt;BR/&gt;&lt;BR/&gt;The fact that you can lift any monad into it (by CPS transformation) is just a consequence of the existence of the codensity monad, ContT is actually a bit bigger than it needs to be.&lt;BR/&gt;&lt;BR/&gt;This is all just another way to say that a CPS transformation can always be applied. &lt;BR/&gt;&lt;BR/&gt;And you can take away from this, somewhat tongue in cheek, that continuations are slightly more complicated than they need to be to do the job. ;)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/3499466246212259692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/3499466246212259692'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1231178880000#c3499466246212259692' title=''/><author><name>Edward Kmett</name><uri>http://www.blogger.com/profile/16144424873202502715</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-5413340271465736656</id><published>2009-01-02T18:02:01.502-08:00</published><updated>2009-01-02T18:02:01.502-08:00</updated><title type='text'>Roly,&gt; What does all this mean categorically?I had...</title><content type='html'>Roly,&lt;BR/&gt;&lt;BR/&gt;&amp;gt; What does all this mean categorically?&lt;BR/&gt;&lt;BR/&gt;I had the same thought as you - Cont must be terminal or final in some category. But I haven&amp;#39;t figured out what category that is.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/5413340271465736656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/5413340271465736656'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1230948121502#c5413340271465736656' title=''/><author><name>sigfpe</name><uri>http://www.blogger.com/profile/08096190433222340957</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09401818062305273147'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-182842493457579729</id><published>2008-12-30T05:17:00.000-08:00</published><updated>2008-12-30T05:17:00.000-08:00</updated><title type='text'>Great post!&gt;Many languages with support for contin...</title><content type='html'>Great post!&lt;BR/&gt;&lt;BR/&gt;&amp;gt;Many languages with support for continuations should be extensible to support monads&lt;BR/&gt;I&amp;#39;d phrase it a little differently: language with support of continuations automatically supports monads with natural syntax.&lt;BR/&gt;Perhaps it is worth to mention that one needs delimited control operators to simulate monadic do-notation (in case of Control.Monad.Cont the &amp;#39;runCont&amp;#39; function is a control delimiter).</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/182842493457579729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/182842493457579729'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1230643020000#c182842493457579729' title=''/><author><name>Gleb</name><uri>http://www.blogger.com/profile/12646910389871722935</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-3279179532869319461</id><published>2008-12-28T11:45:00.000-08:00</published><updated>2008-12-28T11:45:00.000-08:00</updated><title type='text'>If you look in category-extras there is actually a...</title><content type='html'>If you look in category-extras there is actually a monad that boxes up this functionality and reflects this idea; the &amp;quot;codensity monad,&amp;quot; aka the monad generated by a functor basically represents a CPS transform.&lt;BR/&gt;&lt;BR/&gt;http://hackage.haskell.org/packages/archive/category-extras/0.53.5/doc/html/src/Control-Monad-Codensity.html&lt;BR/&gt;&lt;BR/&gt;Your run corresponds to my lowerCodensity and i corresponds to  liftCodensity.&lt;BR/&gt;&lt;BR/&gt;The rest just relies on the fact that:&lt;BR/&gt;&lt;BR/&gt;newtype Codensity m a = Codensity { runCodensity :: forall b. (a -&amp;gt; m b) -&amp;gt; m b }&lt;BR/&gt;&lt;BR/&gt;which can also be read as forall r. ContT (m r) a is a monad regardless of m, (it doesn&amp;#39;t even have to be a functor!)&lt;BR/&gt;&lt;BR/&gt;This monad has nice performance characteristics, because it just reflects a CPS transform of the code.&lt;BR/&gt;&lt;BR/&gt;A variation on the presentation is available here:&lt;BR/&gt;&lt;BR/&gt;http://www.haskell.org/haskellwiki/Performance/Monads&lt;BR/&gt;&lt;BR/&gt;Since this represents a CPS transform of the code and is a monad in its own right if the bind operation of the monad is expensive, as in say most free monads, you can change the asymptotic behavior of code that is running in the monad.&lt;BR/&gt;&lt;BR/&gt;Janis Voigtlaender has a paper on the topic, in which you&amp;#39;ll recognize the type &amp;#39;C&amp;#39; that he uses as the Codensity monad above.&lt;BR/&gt;&lt;BR/&gt;http://wwwtcs.inf.tu-dresden.de/~voigt/mpc08.pdf&lt;BR/&gt;&lt;BR/&gt;Moreover, if you are looking for a window to understanding Kan extensions, you can view the codensity monad as the right Kan extension of a functor along itself.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/3279179532869319461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/3279179532869319461'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1230493500000#c3279179532869319461' title=''/><author><name>Edward Kmett</name><uri>http://www.blogger.com/profile/16144424873202502715</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-6821782331619991066</id><published>2008-12-25T02:11:00.000-08:00</published><updated>2008-12-25T02:11:00.000-08:00</updated><title type='text'>What does all this mean categorically?  I haven't ...</title><content type='html'>What does all this mean categorically?  I haven't yet tried to understand what monad morphisms are (other than that they must be natural transformations that preserve the extra structure of a monad), but does the continuation monad turn out to be initial or terminal in a suitable category?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/6821782331619991066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/6821782331619991066'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1230199860000#c6821782331619991066' title=''/><author><name>Roly Perera</name><uri>http://www.blogger.com/profile/10168144731270158487</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-6884748521935561127</id><published>2008-12-25T01:22:00.000-08:00</published><updated>2008-12-25T01:22:00.000-08:00</updated><title type='text'>I wrote a monads module in scheme few years ago.  ...</title><content type='html'>I wrote a monads module in scheme few years ago.  I wanted to use it for all monads, but Scheme had no namespace or type class.  Therefore, the only way is extract the core part of monads (the mother of all monads).  This is the major code:&lt;BR/&gt;&lt;BR/&gt;(define bind&lt;BR/&gt;  (lambda (a b)&lt;BR/&gt;    (lambda (k)&lt;BR/&gt;      (a (lambda v ((apply b v) k))))))&lt;BR/&gt;&lt;BR/&gt;(define return&lt;BR/&gt;  (lambda v&lt;BR/&gt;    (lambda (k)&lt;BR/&gt;      (apply k v))))&lt;BR/&gt;&lt;BR/&gt;(define run-IO&lt;BR/&gt;  (lambda (m)&lt;BR/&gt;    (m values)))&lt;BR/&gt;&lt;BR/&gt;(define run-State&lt;BR/&gt;  (lambda (m . s)&lt;BR/&gt;    (apply (m (lambda r (lambda _ (apply values r)))) s)))&lt;BR/&gt;&lt;BR/&gt;(define State-set&lt;BR/&gt;  (lambda v&lt;BR/&gt;    (lambda (k)&lt;BR/&gt;      (lambda s&lt;BR/&gt;        (apply (apply k s) v)))))&lt;BR/&gt;&lt;BR/&gt;(define return-List&lt;BR/&gt;  (lambda l&lt;BR/&gt;    (lambda (k)&lt;BR/&gt;      (apply append (map k l)))))&lt;BR/&gt;&lt;BR/&gt;(define run-List&lt;BR/&gt;  (lambda (m)&lt;BR/&gt;    (m list)))&lt;BR/&gt;&lt;BR/&gt;I didn't know it is correct or not.  After I read you post, I understand I've acturally written a Cont monad and work out other monads with it, same as what you did.  You solved my long time question!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/6884748521935561127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/6884748521935561127'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1230196920000#c6884748521935561127' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-7789857971099294355</id><published>2008-12-24T19:17:00.000-08:00</published><updated>2008-12-24T19:17:00.000-08:00</updated><title type='text'>AliPang: If you're on Gentoo (or perhaps some othe...</title><content type='html'>AliPang: If you're on Gentoo (or perhaps some other *nix with a conservative package manager), you may have to install dev-haskell/mtl (or your *nix's equivalent package name), since GHC does not pull it in as a dependency.  Be forewarned, if you are indeed using Gentoo, it may take awhile to compile.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/7789857971099294355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/7789857971099294355'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1230175020000#c7789857971099294355' title=''/><author><name>Cthulhon</name><uri>http://www.blogger.com/profile/12656647628788096090</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-2673686883928571529</id><published>2008-12-24T17:50:00.073-08:00</published><updated>2008-12-24T17:50:00.073-08:00</updated><title type='text'>AliPang,Try copying this entire post into a file c...</title><content type='html'>AliPang,&lt;BR/&gt;&lt;BR/&gt;Try copying this entire post into a file called test.lhs and running that in ghci. If that doesn't work, I wonder if you're missing some libraries. (I only know about ghc.)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/2673686883928571529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/2673686883928571529'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1230169800073#c2673686883928571529' title=''/><author><name>sigfpe</name><uri>http://www.blogger.com/profile/08096190433222340957</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09401818062305273147'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-642366170742077765</id><published>2008-12-24T17:36:00.000-08:00</published><updated>2008-12-24T17:36:00.000-08:00</updated><title type='text'>I wanted to learn more about continuations for a w...</title><content type='html'>I wanted to learn more about continuations for a while. But how do you get Haskell to recognize Control.Monad.Cont? I get a "Could not find module" error when I try to use it. &lt;BR/&gt;&lt;BR/&gt;(And, no, I couldn't find anything useful through Google, though I will happily accept a "Let me google that for you" link :P)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/642366170742077765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/642366170742077765'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1230168960000#c642366170742077765' title=''/><author><name>AliPang</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-8119437949864640471</id><published>2008-12-24T17:18:00.000-08:00</published><updated>2008-12-24T17:18:00.000-08:00</updated><title type='text'>Ah, I missed the total cleverness of i.  Thanks!</title><content type='html'>Ah, I missed the total cleverness of i.  Thanks!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/8119437949864640471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/8119437949864640471'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1230167880000#c8119437949864640471' title=''/><author><name>augustss</name><uri>http://www.blogger.com/profile/07327620522294658036</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-4810868020661626121</id><published>2008-12-24T17:08:52.945-08:00</published><updated>2008-12-24T17:08:52.945-08:00</updated><title type='text'>Anonymous,fred is the same in ex2 and ex3. In both...</title><content type='html'>Anonymous,&lt;BR/&gt;&lt;BR/&gt;fred is the same in ex2 and ex3. In both cases it&amp;#39;s equal to &amp;quot;show . (+1)&amp;quot;.&lt;BR/&gt;&lt;BR/&gt;Inside &amp;quot;&amp;lt;- Cont (\fred -&amp;gt; ...)&amp;quot; fred is the function that does everything up to and including the last argument to the surrounding runCont, which in this case is &amp;quot;show&amp;quot;. The stuff in the do-block just adds 1.&lt;BR/&gt;&lt;BR/&gt;Of course in ex3 fred isn&amp;#39;t actually used.&lt;BR/&gt;&lt;BR/&gt;You can use the identity id instead of show if you don&amp;#39;t want to do anything in particular to the result.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/4810868020661626121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/4810868020661626121'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1230167332945#c4810868020661626121' title=''/><author><name>sigfpe</name><uri>http://www.blogger.com/profile/08096190433222340957</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09401818062305273147'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-6051235021775321350</id><published>2008-12-24T17:00:15.455-08:00</published><updated>2008-12-24T17:00:15.455-08:00</updated><title type='text'>augustss,You expecting some kind of failure for st...</title><content type='html'>augustss,&lt;BR/&gt;&lt;BR/&gt;You expecting some kind of failure for state? The code is agnostic about the choice of monad so it&amp;#39;ll work for any monad, right?&lt;BR/&gt;&lt;BR/&gt;(runState $ run $ do { a &amp;lt;- i $ get ; i $ modify (+1) ; i $ return a }) 10</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/6051235021775321350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/6051235021775321350'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1230166815455#c6051235021775321350' title=''/><author><name>sigfpe</name><uri>http://www.blogger.com/profile/08096190433222340957</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09401818062305273147'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-3468318697569858321</id><published>2008-12-24T14:27:00.000-08:00</published><updated>2008-12-24T14:27:00.000-08:00</updated><title type='text'>I noticed that you don't simulate the state monad....</title><content type='html'>I noticed that you don't simulate the state monad. :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/3468318697569858321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/3468318697569858321'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1230157620000#c3468318697569858321' title=''/><author><name>augustss</name><uri>http://www.blogger.com/profile/07327620522294658036</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-2852248053859101042</id><published>2008-12-24T14:13:00.000-08:00</published><updated>2008-12-24T14:13:00.000-08:00</updated><title type='text'>I'm a little confused by ex3.  What exactly is fre...</title><content type='html'>I'm a little confused by ex3.  What exactly is fred in this example?  The partially applied function '(+) a' i.e. '(+) 1'?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/2852248053859101042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/4013221249502217550/comments/default/2852248053859101042'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html?showComment=1230156780000#c2852248053859101042' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2008/12/mother-of-all-monads.html' ref='tag:blogger.com,1999:blog-11295132.post-4013221249502217550' source='http://www.blogger.com/feeds/11295132/posts/default/4013221249502217550' type='text/html'/></entry></feed>