add toc
[lambda.git] / topics / week8_monads_and_modules.mdwn
index 9c01fbb..fa232f3 100644 (file)
@@ -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: