Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Rhine m cl a b = Rhine {}
- flow :: (Monad m, Clock m cl, TimeDomainOf cl ~ TimeDomainOf (Leftmost cl), TimeDomainOf cl ~ TimeDomainOf (Rightmost cl)) => Rhine m cl () () -> m ()
Documentation
Running a Rhine
flow :: (Monad m, Clock m cl, TimeDomainOf cl ~ TimeDomainOf (Leftmost cl), TimeDomainOf cl ~ TimeDomainOf (Rightmost cl)) => Rhine m cl () () -> m () Source #
Takes a closed Rhine
(with trivial input and output),
and runs it indefinitely.
All input is created, and all output is consumed by means of side effects
in a monad m
.
Basic usage (synchronous case):
sensor :: SyncSF MyMonad MyClock () a sensor = arrMSync_ produceData processing :: SyncSF MyMonad MyClock a b processing = ... actuator :: SyncSF MyMonad MyClock b () actuator = arrMSync consumeData mainSF :: SyncSF MyMonad MyClock () () mainSF = sensor >-> processing >-> actuator main :: MyMonad () main = flow $ mainSF @@ clock