X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=topics%2Fweek8_monads_and_modules.mdwn;h=2737ed56eae6d91b4273432a243aca587b2c417b;hp=e7372d3d5deb8326a261d7ec581a2c17f41a56a9;hb=a0eb18e702862266fdc8a7d935d6cc33821fdf4a;hpb=0d3f4838d68aa745360320ddd387237cf71b56f6 diff --git a/topics/week8_monads_and_modules.mdwn b/topics/week8_monads_and_modules.mdwn index e7372d3d..2737ed56 100644 --- a/topics/week8_monads_and_modules.mdwn +++ b/topics/week8_monads_and_modules.mdwn @@ -539,7 +539,7 @@ Here is some code showing how to generate the common monad modules, and also som module S = Monad.State(struct type store = int end) (* or any other implementation of stores *) S.(get,gets,put,modify) (* same additional interface as Haskell has; we'll explain them later *) module Ref = Monad.Ref(struct type value = string end) (* this is essentially a State monad, but with a different interface *) - Ref.(newref,deref,change) + Ref.(newref,getref,putref) module W = Monad.Writer(struct type log = string let empty = "" let append = (^) end) (* or any other implementation of logs *) W.(listen,listens,tell,censor) module E = Monad.Error(struct type err = string exception Exc = Failure end) (* or other specifications of type err and exception Exc of err *)