Skip to content

Commit e108e63

Browse files
Add bindDispatch lemma for convenience
1 parent 7afdcaf commit e108e63

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

theories/Imperative.v

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ Fixpoint bind {effectType effectResponse A B} (a : Action effectType effectRespo
2323

2424
Notation "x >>= f" := (bind x f) (at level 50, left associativity).
2525

26+
Lemma bindDispatch {effectType effectResponse A B} effect (continuation : effectResponse effect -> Action effectType effectResponse A) (f : A -> Action effectType effectResponse B) : Dispatch _ _ _ effect continuation >>= f = Dispatch _ _ _ effect (fun response => continuation response >>= f).
27+
Proof. easy. Qed.
28+
2629
Lemma leftIdentity {effectType effectResponse A B} (x : A) (f : A -> Action effectType effectResponse B) : bind (Done _ _ _ x) f = f x.
2730
Proof. easy. Qed.
2831

0 commit comments

Comments
 (0)