diff options
Diffstat (limited to 'stdlib/source/lux/codata/state.lux')
-rw-r--r-- | stdlib/source/lux/codata/state.lux | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/stdlib/source/lux/codata/state.lux b/stdlib/source/lux/codata/state.lux index 82e9b40fd..2ff0ea3a8 100644 --- a/stdlib/source/lux/codata/state.lux +++ b/stdlib/source/lux/codata/state.lux @@ -97,8 +97,15 @@ [state a] (sFa state)] (wrap [state (f a)]))))) +(type: #export (State' M s a) + (-> s (M [s a]))) + +(def: #export (run' state action) + (All [M s a] (-> s (State' M s a) (M [s a]))) + (action state)) + (struct: #export (StateT Monad<M>) - (All [M s] (-> (Monad M) (Monad (All [a] (-> s (M [s a])))))) + (All [M s] (-> (Monad M) (Monad (State' M s)))) (def: applicative (Applicative<StateT> Monad<M>)) (def: (join sMsMa) (lambda [state] |