Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Many clocks tick at nondeterministic times
(such as event sources),
and it is thus impossible to schedule them deterministically
with most other clocks.
Using concurrency, they can still be scheduled with all clocks in IO
,
by running the clocks in separate threads.
Synopsis
- concurrently :: (Clock IO cl1, Clock IO cl2, Time cl1 ~ Time cl2) => Schedule IO cl1 cl2
- concurrentlyWriter :: (Monoid w, Clock (WriterT w IO) cl1, Clock (WriterT w IO) cl2, Time cl1 ~ Time cl2) => Schedule (WriterT w IO) cl1 cl2
- concurrentlyExcept :: (Clock (ExceptT e IO) cl1, Clock (ExceptT e IO) cl2, Time cl1 ~ Time cl2) => Schedule (ExceptT e IO) cl1 cl2
- concurrentlyMaybe :: (Clock (MaybeT IO) cl1, Clock (MaybeT IO) cl2, Time cl1 ~ Time cl2) => Schedule (MaybeT IO) cl1 cl2
Documentation
concurrently :: (Clock IO cl1, Clock IO cl2, Time cl1 ~ Time cl2) => Schedule IO cl1 cl2 Source #
Runs two clocks in separate GHC threads and collects the results in the foreground thread. Caution: The data processing will still happen in the same thread (since data processing and scheduling are separated concerns).
concurrentlyWriter :: (Monoid w, Clock (WriterT w IO) cl1, Clock (WriterT w IO) cl2, Time cl1 ~ Time cl2) => Schedule (WriterT w IO) cl1 cl2 Source #
As concurrently
, but in the WriterT w IO
monad.
Both background threads share a joint variable with the foreground
to which the writer effect writes.