 | Shellac-0.9: A framework for creating shell envinronments | Contents | Index |
|
| System.Console.Shell.ShellMonad |
|
|
|
|
| Description |
| This module implements a monad for use in shell commands and in
evaluation functions. It is a state moand layered over IO.
liftIO may be used to execute arbitrary I/O actions. However,
the shellPut* commands are the preferred way to output text.
|
|
| Synopsis |
|
|
|
|
| The Shell monad
|
|
| data Sh st a |
| The type of shell commands. This monad is a stae monad layerd over IO. It is
also a member of MonadException which allows safe exception handling.
| Instances | |
|
|
| runSh :: st -> OutputCommand -> Sh st () -> IO (CommandResult st) |
| Execute a shell action
|
|
| Output functions
|
|
| shellPut :: BackendOutput -> Sh st () |
| Output a tagged string to the console
|
|
| shellPutStr :: String -> Sh st () |
| Prints a regular output string with a line terminator
|
|
| shellPutStrLn :: String -> Sh st () |
| Prints regular output with a line terminator
|
|
| shellPutInfo :: String -> Sh st () |
| Prints an informational output string
|
|
| shellPutInfoLn :: String -> Sh st () |
| Prints an informational output string with a line terminator
|
|
| shellPutErr :: String -> Sh st () |
| Prints an error output string
|
|
| shellPutErrLn :: String -> Sh st () |
| Prints and error output string with a line terminator
|
|
| Shell state accessors
|
|
| getShellSt :: Sh st st |
| Get the current shell state
|
|
| putShellSt :: st -> Sh st () |
| Set the shell state
|
|
| modifyShellSt :: (st -> st) -> Sh st () |
| Apply the given funtion to the shell state
|
|
| Special actions
|
|
| shellSpecial :: ShellSpecial st -> Sh st () |
| Schedule a shell "special" action. Only the last call to
this function will affect the shell's behavior! It modifies
a bit of state that is overwritten on each call.
|
|
| Produced by Haddock version 0.8 |