rhine-terminal-1.0: 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

type RunTerminalClock m t cl = HoistClock (TerminalT t m) m cl Source #

To escape the TerminalT transformer, you can apply this operator to your clock type, where cl is a clock in TerminalT. The resulting clock is then in m.

runTerminalClock :: Terminal t => t -> cl -> RunTerminalClock IO t cl Source #

See RunTerminalClock. Apply this to your clock value to remove a TerminalT layer.

Orphan instances

(Monad m, MonadSchedule m) => MonadSchedule (TerminalT t m) Source # 
Instance details

Methods

schedule :: NonEmpty (TerminalT t m a) -> TerminalT t m (NonEmpty a, [TerminalT t m a]) #