Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Wrapper to write terminal
applications in Rhine, using concurrency.
Synopsis
- data TerminalEventClock = TerminalEventClock
- flowTerminal :: (MonadIO m, MonadMask m, Terminal t, Clock (TerminalT t m) cl, GetClockProxy cl, Time cl ~ Time (In cl), Time cl ~ Time (Out cl)) => t -> Rhine (TerminalT t m) cl () () -> m ()
- terminalConcurrently :: forall t cl1 cl2. (Terminal t, Clock (TerminalT t IO) cl1, Clock (TerminalT t IO) cl2, Time cl1 ~ Time cl2) => Schedule (TerminalT t IO) cl1 cl2
Documentation
data TerminalEventClock Source #
A clock that ticks whenever events or interrupts on the terminal arrive.
Instances
Semigroup TerminalEventClock Source # | |
Defined in FRP.Rhine.Terminal (<>) :: TerminalEventClock -> TerminalEventClock -> TerminalEventClock # sconcat :: NonEmpty TerminalEventClock -> TerminalEventClock # stimes :: Integral b => b -> TerminalEventClock -> TerminalEventClock # | |
GetClockProxy TerminalEventClock Source # | |
Defined in FRP.Rhine.Terminal | |
(MonadInput m, MonadIO m) => Clock m TerminalEventClock Source # | |
Defined in FRP.Rhine.Terminal type Time TerminalEventClock # type Tag TerminalEventClock # | |
type Tag TerminalEventClock Source # | |
Defined in FRP.Rhine.Terminal | |
type Time TerminalEventClock Source # | |
Defined in FRP.Rhine.Terminal |
flowTerminal :: (MonadIO m, MonadMask m, Terminal t, Clock (TerminalT t m) cl, GetClockProxy cl, Time cl ~ Time (In cl), Time cl ~ Time (Out cl)) => t -> Rhine (TerminalT t m) cl () () -> m () Source #
A function wrapping flow
to use at the top level
in order to run a `Rhine (TerminalT t m) cl ()`
Example:
mainRhine :: MonadIO m => Rhine (TerminalT LocalTerminal m) TerminalEventClock () ()
mainRhine = tagS >-> arrMCl (liftIO . print) @@ TerminalEventClock
main :: IO ()
main = withTerminal $ term -> flowTerminal
term mainRhine