diff agda/deltaM.agda @ 101:29c54b0197fb

Fix bind definition on DeltaM. use mu.
author Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
date Sun, 25 Jan 2015 12:15:19 +0900
parents d8cd880f1d78
children a271f3ff1922
line wrap: on
line diff
--- a/agda/deltaM.agda	Fri Jan 23 17:44:53 2015 +0900
+++ b/agda/deltaM.agda	Sun Jan 25 12:15:19 2015 +0900
@@ -68,17 +68,17 @@
 
 -- monad definitions
 open Monad
-deltaM-eta : {l : Level} {A B : Set l} {M : {l' : Level} -> Set l' -> Set l'}
+deltaM-eta : {l : Level} {A : Set l} {M : {l' : Level} -> Set l' -> Set l'}
                                         {functorM : {l' : Level} -> Functor {l'} M}
                                         {monadM   : {l' : Level} {A : Set l'} -> Monad {l'} {A} M functorM}
             -> A -> (DeltaM M {functorM} {monadM} A)
-deltaM-eta {_} {A} {_} {_} {_} {monadM} x = deltaM (mono (eta {_} {A} monadM x))
+deltaM-eta {_} {A} {_} {_} {monadM} x = deltaM (mono (eta {_} {A} monadM x))
 
 deltaM-mu : {l : Level} {A : Set l} {M : {l' : Level} -> Set l' -> Set l'}
                                         {functorM : {l' : Level} -> Functor {l'} M}
                                         {monadM   : {l' : Level} {A : Set l'} -> Monad {l'} {A} M functorM}
             -> (DeltaM M {functorM} {monadM} (DeltaM M {functorM} {monadM} A)) -> DeltaM M {functorM} {monadM} A
-deltaM-mu {l} {A} {M} {functorM} {monadM} (deltaM (mono x))               = deltaM (mono (bind {l} {A}  monadM x headDeltaM))
+deltaM-mu {l} {A} {M} {functorM} {monadM} (deltaM (mono x))               = deltaM (mono (mu {l} {A} monadM (fmap functorM  headDeltaM x)))
 deltaM-mu {l} {A} {M} {functorM} {monadM} (deltaM (delta x (mono xx)))    = appendDeltaM (deltaM (mono (bind {l} {A} monadM x headDeltaM)))
                                                                                          (deltaM-mu (deltaM (mono xx)))
 deltaM-mu {l} {A} {M} {functorM} {monadM} (deltaM (delta x (delta xx d))) = appendDeltaM (deltaM (mono (bind {l} {A} monadM x headDeltaM)))