X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=topics%2Fweek8_monads_and_modules.mdwn;h=fa232f3703e39c22fc80d5149b5f264c614a4b59;hb=7c1c7e75ed107412eef8802071f15f7b9f1b042b;hp=9c01fbb5041d2e212d1cf32844646c366eeb4e46;hpb=ddcd9ea96ab50bfc639aaea1025acce80a44c884;p=lambda.git 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: