Safe Haskell | None |
---|---|
Language | Haskell2010 |
An example of a Box for the command line.
Synopsis
- data ControlRequest
- data ControlResponse
- type ControlBox m = MonadConc m => Cont m (Box (STM m) ControlResponse ControlRequest)
- data ControlConfig
- defaultControlConfig :: ControlConfig
- consoleControlBox :: ControlBox IO
- parseControlRequest :: Parser ControlRequest
- controlBox :: IO a -> Box (STM IO) ControlResponse ControlRequest -> IO ()
- testBox :: IO ()
- timeOut :: Double -> ControlBox m
Documentation
data ControlRequest Source #
request ADT
Instances
data ControlResponse Source #
response ADT
Instances
type ControlBox m = MonadConc m => Cont m (Box (STM m) ControlResponse ControlRequest) Source #
A Box
that communicates via ControlRequest
and ControlResponse
data ControlConfig Source #
Should the box be kept alive?
Instances
Eq ControlConfig Source # | |
Defined in Box.Control (==) :: ControlConfig -> ControlConfig -> Bool # (/=) :: ControlConfig -> ControlConfig -> Bool # | |
Show ControlConfig Source # | |
Defined in Box.Control showsPrec :: Int -> ControlConfig -> ShowS # show :: ControlConfig -> String # showList :: [ControlConfig] -> ShowS # |
defaultControlConfig :: ControlConfig Source #
Defauilt is to let the box die.
consoleControlBox :: ControlBox IO Source #
a command-line control box.
parseControlRequest :: Parser ControlRequest Source #
Parse command line requests
controlBox :: IO a -> Box (STM IO) ControlResponse ControlRequest -> IO () Source #
an effect that can be started and stopped
send Start, wait for a Ready signal, run action, wait x secs, then send Quit
timeOut :: Double -> ControlBox m Source #
A box with a self-destruct timer.