Commit 4787aea3 by Pierre-Évariste Dagand

### Misc fixes to Lecture 1

parent bf185fcc
 ... ... @@ -284,7 +284,7 @@ stateful program to a pure value amounts to performing a standard function application or, put otherwise, ``return`` is a left unit for ``_>>=_``:: bind-left-unit : ∀ {X Y} → (x : X)(k : X -> StateF Y) → bind-left-unit : ∀ {X Y} → (x : X)(k : X → StateF Y) → (return x >>= k) ≡ k x bind-left-unit x k = {!!} ... ... @@ -319,7 +319,7 @@ can always parenthesize ``_>>=_`` from left to right or, put otherwise, ``_>>=`` is associative:: {-# TERMINATING #-} bind-compose : ∀ {X Y Z} → (mx : StateF X)(f : X -> StateF Y)(g : Y -> StateF Z) → bind-compose : ∀ {X Y Z} → (mx : StateF X)(f : X → StateF Y)(g : Y → StateF Z) → ((mx >>= f) >>= g) ≡ (mx >>= λ x → (f x >>= g)) bind-compose = {!!} where postulate ext : Extensionality Level.zero Level.zero ... ... @@ -580,12 +580,12 @@ specifications:: **Exercise (difficulty: 2)** similarly, there is a ``_>>=_`` over semantical states:: _sem->>=_ : ∀ {X Y} → (mx : STATE X)(k : X -> STATE Y) → STATE Y _sem->>=_ : ∀ {X Y} → (mx : STATE X)(k : X → STATE Y) → STATE Y _sem->>=_ mx k = {!!} whose unit-proof is:: test-eval-compose : ∀ {X Y} (mx : StateF X)(k : X -> StateF Y) (s : S) → test-eval-compose : ∀ {X Y} (mx : StateF X)(k : X → StateF Y) (s : S) → eval (mx >>= k) s ≡ (eval mx sem->>= λ x → eval (k x)) s test-eval-compose = {!!} ... ...
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment