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 ()
- type RunTerminalClock m t cl = HoistClock (TerminalT t m) m cl
- runTerminalClock :: Terminal t => t -> cl -> RunTerminalClock IO t cl
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
type RunTerminalClock m t cl = HoistClock (TerminalT t m) m cl Source #
runTerminalClock :: Terminal t => t -> cl -> RunTerminalClock IO t cl Source #
See RunTerminalClock
. Apply this to your clock value to remove a TerminalT
layer.