| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
TinyApp.Interactive
Description
Build interactice apps that reacts to each keystroke and renders text Requires `ghc-options: -threaded`
Synopsis
- data Event = Key Key [Modifier]
- data Key
- data Modifier
- data Sandbox state = Sandbox {
- initialize :: state
- render :: state -> String
- update :: Event -> state -> (state, ContinueExit)
- data ContinueExit
- runInteractive :: Sandbox s -> IO ()
- runInteractive' :: forall s. Sandbox s -> IO s
Documentation
Representes keys that can be pressed
Constructors
| KEsc | |
| KChar Char | |
| KBS | |
| KEnter | |
| KLeft | |
| KRight | |
| KUp | |
| KDown | |
| KUpLeft | |
| KUpRight | |
| KDownLeft | |
| KDownRight | |
| KCenter | |
| KFun Int | |
| KBackTab | |
| KPrtScr | |
| KPause | |
| KIns | |
| KHome | |
| KPageUp | |
| KDel | |
| KEnd | |
| KPageDown | |
| KBegin | |
| KMenu |
Modifiers keys
Defines an interactive application that is not allowed to perform arbitrary IO while executing.
Constructors
| Sandbox | |
Fields
| |
data ContinueExit Source #
Signals whether the application should continue waiting input from the user or exit.
Instances
| Show ContinueExit Source # | |
Defined in TinyApp.Interactive Methods showsPrec :: Int -> ContinueExit -> ShowS # show :: ContinueExit -> String # showList :: [ContinueExit] -> ShowS # | |
| Eq ContinueExit Source # | |
Defined in TinyApp.Interactive | |
runInteractive :: Sandbox s -> IO () Source #
Executes the application.
runInteractive' :: forall s. Sandbox s -> IO s Source #
Executes the application returning its final state.