anchor.diff:    open Monoid
       
     type Writer<'w, 'a> = unit -> 'a * 'w
  +
  +  let bind k writer =
  +      fun () ->
  +        let (a, w) = writer()
  +        let (a', w') = (k a)()
  +        (a', mappend w w')
     
     /// The writer monad.
     /// This monad comes from Matthew Podwysocki's http://codebetter.com/blogs/matthew.podwysocki/archive/2010/02/01/a-kick-in-the-monads-writer-edition.aspx.
  
positive.code: module Reader =
  
    type Reader<'r,'a> = 'r -> 'a
    
    /// The reader monad.
    /// This monad comes from Matthew Podwysocki's http://codebetter.com/blogs/matthew.podwysocki/archive/2010/01/07/much-ado-about-monads-reader-edition.aspx.
  
negative.code:     member this.Return(a) : State<'a,'s> = fun s -> (a,s)
      member this.ReturnFrom(m:State<'a,'s>) = m
      member this.Bind(m:State<'a,'s>, k:'a -> State<'b,'s>) : State<'b,'s> =
        bind k m
      member this.Zero() = this.Return ()
      member this.Combine(r1, r2) = this.Bind(r1, fun () -> r2)
      member this.TryWith(m:State<'a,'s>, h:exn -> State<'a,'s>) : State<'a,'s> =
  