Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions theories/Data/Monads/EitherMonad.v
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ Section except.
| (inl l, _) => ret (inl l)
| (inr a, t) => ret (inr (a, t))
end)
; pass := fun _ c => mkEitherT (
; pass := fun _ c => mkEitherT (pass (
x <- unEitherT c ;;
match x with
| inl s => ret (inl s)
| inr (a,f) => pass (ret (inr a, f))
end)
| inl s => ret (inl s, fun x => x)
| inr (a, f) => ret (inr a, f)
end))
}.

Global Instance MonadFix_eitherT (MF : MonadFix m) : MonadFix eitherT :=
Expand Down
4 changes: 2 additions & 2 deletions theories/Data/Monads/StateMonad.v
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ Section StateType.
; listen := fun _ c => mkStateT (fun s => bind (listen (runStateT c s))
(fun x => let '(a,s,t) := x in
ret (a,t,s)))
; pass := fun _ c => mkStateT (fun s => bind (runStateT c s) (fun x =>
let '(a,t,s) := x in pass (ret ((a,s),t))))
; pass := fun _ c => mkStateT (fun s => pass (bind (runStateT c s) (fun x =>
let '(a,t,s) := x in ret ((a,s),t))))
}.

Global Instance Exc_stateT T (MR : MonadExc T m) : MonadExc T stateT :=
Expand Down
Loading