monadSP :: SPm i o () -> SP i o type SPm i o ans = Mk (SP i o) ans putSPm :: o -> SPm i o () putsSPm :: [o] -> SPm i o () getSPm :: SPm i o i nullSPm :: SPm i o () unitSPm :: ?? bindSPm :: ?? thenSPm :: ?? toSPm :: SP i o -> SPm i o ()
A monadic stream processor of type SPm inp outp ans
is a stream processor
that inputs messages of type inp
, output messages of type outp
(like a stream processor of type SP inp outp
) and produces a final
result of type ans
.
unitSPm
and bindSPm
are the unit and bind operations of the
monad. unitSPm x
is a stream processor that immediately returns
the result x
, without performing any I/O operations.
The operations putSPm
, getSPm
and nullSPm
correspond
to the ordinary stream processor operations putSP
, getSP
and nullSP
respectively.
monadSP
allows a monadic stream processor to be used in any context
where an ordinary stream procesor is required.
Monadic stream processors with state: SPms.