rhine-terminal-0.9: Terminal backend for Rhine
Safe HaskellSafe-Inferred
LanguageHaskell2010

FRP.Rhine.Terminal

Description

Wrapper to write terminal applications in Rhine, using concurrency.

Synopsis

Documentation

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

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 Source #

A schedule in the 'TerminalT LocalTerminal' transformer, supplying the same backend connection to its scheduled clocks.