|
|
|
|
|
| Description |
| This module exposes internal structures and utility functions
used in the CLI refinement shell. It has to be imported only
if you want to write your own CLI plugins (command handlers, condition solvers, etc.)
|
|
| Synopsis |
|
|
|
| Documentation |
|
| module Core.DerivationTree |
|
| The global state
|
|
| type Action prog a = StateT (World prog) IO a |
|
| data World prog |
| Constructors | | World | | | derivation :: (Maybe (DTree prog)) | | | rules :: [Rule prog] | | | cmdHandlers :: [CmdHandler prog] | List of command handlers.
|
|
|
|
|
| data CmdHandler prog |
| Constructors | | CmdHandler | | | cmd :: String | The user command that the handler reacts to.
This must match the first token of the user input.
The command should not contain problematic characters.
Otherwise readline completion may have problems.
| | cmdDesc :: Doc | Description of what the command does.
| | handleCmd :: (String -> Action prog ()) | The handler function
|
|
|
|
|
| mkWorld :: [Rule prog] -> [CmdHandler prog] -> World prog |
|
| Exceptions
|
|
| data ReadlineException |
| Constructors | | Instances | |
|
|
| data QuitException |
| Constructors | | Instances | |
|
|
| data HandlerException |
| Constructors | | Instances | |
|
|
| Running rules with user input
|
|
| getArgument' :: forall a . (Boxable a, Parse a) => Doc -> IO a |
|
| readInput :: Parse a => String -> IO a |
|
| getInput :: String -> IO String |
|
| Running rules with predefined args
|
|
| readNextArg :: Typeable b => a -> StateT [RuleArg] IO b |
|
| Utils
|
|
| formatDesc |
| :: String | synopsis
| | -> String | description
| | -> Doc | | | Standard command description layout.
|
|
|
| handleCommand |
| :: String | User input
| | -> Action prog Bool | Return False if command given and not found.
|
|
|
| getDerivation :: Action prog (DTree prog) |
|
| replaceHandler :: CmdHandler prog -> Action prog () |
|
| Setters and getters
|
|
| updateDerivation :: (DTree prog -> DTree prog) -> World prog -> World prog |
|
| setSelection :: Region -> World prog -> World prog |
|
| setDerivation :: DTree prog -> World prog -> World prog |
|
| getActiveCode :: Prog syn prog => Action prog (Code syn) |
|
| Produced by Haddock version 0.8 |