X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=topics%2Fweek8_monads_and_modules.mdwn;h=fa232f3703e39c22fc80d5149b5f264c614a4b59;hp=9c01fbb5041d2e212d1cf32844646c366eeb4e46;hb=ff2bda4199473fb8cf195500e3212e3293919f09;hpb=cb344881d831fcbb278429e791a4746217346c30 diff --git a/topics/week8_monads_and_modules.mdwn b/topics/week8_monads_and_modules.mdwn index 9c01fbb5..fa232f37 100644 --- a/topics/week8_monads_and_modules.mdwn +++ b/topics/week8_monads_and_modules.mdwn @@ -1,5 +1,7 @@ *First posted Thursday 2 April; updated Sunday 5 April.* +[[!toc]] + ## Some major monads; comparing Reader to State ## In the homework session on Wed Apr 1, we began by discussing the fact that different monads (so far we've considered the super-simple Identity Monad, as well as the Option/Maybe, List, and Reader monads; other commonly-referenced monads include leaf-labeled Trees, State which we discussed in the seminar on Thursday, as well as Writer (State is a kind of unified melding of Reader + Writer), and Error, which is like Option/Maybe except that what corresponds to the None/Nothing variant now has a parameter, so you can attach error messages or the like. A sample type declaration of this sort would be: