view src/delta_instance_monad.hs @ 42:4cc65012412f

Add proofs of functor-laws on delta
author Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
date Fri, 13 Feb 2015 17:13:23 +0900
parents c4da3e667aad
children ba7f0b5454ab
line wrap: on
line source

instance Monad Delta where
  return x = Mono x
  (Mono x) >>= f     = f x
  (Delta x d) >>= f  = Delta (headDelta (f x))
                             (d >>= (tailDelta . f))