-
Notifications
You must be signed in to change notification settings - Fork 0
lux.codata.state
StephenBDT edited this page Aug 12, 2017
·
1 revision
Stateful computations.
(type: (State s a)
(-> s [s a]))
Stateful computations decorated by a monad.
(type: (State' M s a)
(-> s (M [s a])))
(All [a] (lux/control/applicative;Applicative (State a)))
(All [a] (lux/control/functor;Functor (State a)))
(All [a] (lux/control/monad;Monad (State a)))
A monad transformer to create composite stateful computations.
(All [a b] (-> (lux/control/monad;Monad a) (lux/control/monad;Monad (State' a b))))
Read the current state.
(All [a] (State a a))
Lift monadic values to the State' wrapper.
(All [a b c] (-> (lux/control/monad;Monad a) (a c) (State' a b c)))
Run computation with a locally-modified state.
(All [a b] (-> (-> a a) (State a b) (State a b)))
Set the new state.
(All [a] (-> a (State a lux;Unit)))
Run a stateful computation.
(All [a b] (-> a (State a b) [a b]))
Run a stateful computation decorated by a monad.
(All [a b c] (-> b (State' a b c) (a [b c])))
Compute the new state.
(All [a] (-> (-> a a) (State a lux;Unit)))
Run function on current state.
(All [a b] (-> (-> a b) (State a b)))