|
| 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
|
|
|
| The type of shell commands. This monad is a state monad layered over IO.
The type parameter st allows the monad to carry around a package of
user-defined state.
| Instances | |
|
|
|
| Execute a shell action
|
|
| Output functions
|
|
|
| Output a tagged string to the console
|
|
|
| Prints a regular output string
|
|
|
| Prints regular output with a line terminator
|
|
|
| Prints an informational output string
|
|
|
| Prints an informational output string with a line terminator
|
|
|
| Prints an error output string
|
|
|
| Prints and error output string with a line terminator
|
|
| Shell state accessors
|
|
|
| Get the current shell state
|
|
|
| Set the shell state
|
|
|
| Apply the given funtion to the shell state
|
|
| Special actions
|
|
|
| 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.
|
|
| Extracting and using the shell context
|
|
|
| The total context held by the shell, with CommandResult st
being mutable and OutputCommand immutable
|
|
|
| Extract the current shell context for future use, see runWithContext
|
|
|
| Run a shell with the supplied context, useful if you need to
invoke a shell within a new IO context, for example when using
System.Timeout.timeout
|
|
|
| Update the mutable context of this shell
|
|
| Produced by Haddock version 2.6.0 |