summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4d5d874)
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
The other operation for the State monad will be to update the existing store to a new one. This operation looks like this:
The other operation for the State monad will be to update the existing store to a new one. This operation looks like this:
- let set_state (value : int) : dummy state =
- fun s -> (dummy, value);;
+ let set_state (new_store : int) : dummy state =
+ fun s -> (dummy, new_store);;
If we want to stick this in a `... >>= ...` chain, we'll need to prefix it with `fun _ ->` too, like this:
If we want to stick this in a `... >>= ...` chain, we'll need to prefix it with `fun _ ->` too, like this: