stateMonadSP :: a -> SPms b c a d -> (d -> SP b c) -> SP b c type SPms a b c d = Ms (SP a b) c d putSPms :: a -> SPms b a c () putsSPms :: [a] -> SPms b a c () getSPms :: SPms a b c a nullSPms :: SPms a b c () unitSPms :: a -> SPms b c d a bindSPms :: SPms a b c d -> (d -> SPms a b c e) -> SPms a b c e thenSPms :: SPms a b c () -> SPms a b c d -> SPms a b c d loadSPms :: SPms a b c c storeSPms :: a -> SPms b c a ()
A monadic stream processor of type
SPms inp outp state ans is a
stream processor that inputs messages of type
output messages of type
(like a stream processor of type
SP inp outp),
has an internal state of type
and produces a final result of type
bindSPms are the unit and bind operations of the
unitSPms x is a stream processor that immediately returns
x, without performing any I/O operations.
to the ordinary stream processor operations
storeSPms allows you to access
and change the internal state.
stateMonadSP allows a monadic stream processor with state to be
used in any context where an ordinary stream procesor is required.
stateMonadPS state0 spms sp first runs
as the initial state and then continues as
sp. The final state
and result from
spms is thrown away.
Monadic stream processors without state: SPm.
Monadic fudget kernels: Ks, putKs, getKs, ...