|
|
|
Description |
Main datas and types for the editor
|
|
Synopsis |
|
|
|
Documentation |
|
|
Stato is parametrized on an Engine instance and hold the engine with the last regex entered , regex G and g are not implemented now
| Constructors | | Instances | |
|
|
|
the core editor runs under the state monad with state (Stato) .
Wrapped around a monad (IO mainly) to permit console input and output of commands with IO
and testing with State
|
|
|
|
|
push a new file (data Engine instance) in the core State, pushing the old state in the undo stack
|
|
|
placeholder for the two constraints
|
|
|
|
the errors (monad failers) which can break the monad flow
| Constructors | StopErr | issued on ctrl-d or q command (q not implemented)
| ParserErr String | command line was not parsed to a CompleteCommand
| RegexUnmatched | the regex doesn't match a line
| EvalErr Err | something bad happened in the evaluation process
| BackendErr | lines were addressed out of file (see Engine)
| Ahi String | uncontrolled errors
| FileReadErr String | io error trying to load a file
| FileNameMissing | filename is not set
| FileWriteErr String | io error trying to write the file
| ExternalCommandErr String | io error executing an external program
| PendingState Command | a sensible data discarding command has been entered
| NoMoreUndo | reached the first state remembered
| NoMoreRedo | reached the last state remembered
| CommandHelpMissing | a help for a missing command was asked
| CommandHelpParseErr String | error parsing the help for commands
|
| Instances | |
|
|
|
a layer for IO simulation, see Main for the real program one and Test for tests
| | Methods | | accepts a prompt and should return Nothing on eof else a line of input
| | | :: String | | -> m () | output a normal string
|
| | | :: String | | -> m () | put a line in the history (which is global)
|
| | | :: String | | -> m () | output an error string
|
| | | | | | :: String | | -> String | | -> ErrorT String m () | write a file
| runs an external command , first arg is the command
the output is returned or an error is signalled in the errort monad
|
| | | | |
| | Instances | |
|
|
|
|
|
commands for the editor
| Constructors | Append | get some text and add it after the addressed line
| Insert | get some text and add it before the addressed line
| Change | get some text and add it in place of some deleted lines
| Delete | delete some lines
| Print | print some lines
| SmallG String | get some commands and execute them on each line matching a regex
| BigG String | interactively execute commands on each line matching a regex
| NoCommand | Change the addressed line
| Edit String | Load a file
| Write | Write the file
| WriteNew String | Write a new file
| SetFilename String | Set filename
| GetFilename | Print filename
| EditExternal String | Load the output of an external command
| UndoChange | Revert the last change if ever
| RedoChange | Restore via the last change
| HelpList | Asking help
| HelpTopic String | Spedific help
|
| Instances | |
|
|
|
represents a line position in the file
| Constructors | LastLine | beyond last line, the append line
| Absolute Int | the nth line
| Current | the line addressed by the engine
| Prev Int | the nth line before the addressed one
| Next Int | the nth line aftor the addressed one
| ReNext String | the next line (wrapping around) matching a regex
| LastReNext | the next line matching the last learned regex
| RePrev String | the previous line (wrapping around) matching a regex
| LastRePrev | the previous matching the last learned regex
| MarkedAs Char | the line marked previously with a char
|
| Instances | |
|
|
|
a couple of Offsets
| Constructors | | Instances | |
|
|
|
wrapper a round the two possible addressing for a command Offset and Range
| Constructors | | Instances | |
|
|
|
a complete command is a Command coupled with a Range or an Offset
| Constructors | | Instances | |
|
|
|
main datatype for the program-- beyond the core state, a simulation layer SIO can be read
and errors Err can be thrown to kill the monad flow
|
|
|
:: Ctx m | | => Maybe a | maybe action
| -> Editor m a | monading
| wrap a maybe action and throw a backend error on a Nothing
|
|
|
|
:: Ctx m | | => Engine -> Maybe a | an action from an engine w to a maybe
| -> Editor m a | the result from Just in the Editor monad
| execute an action on the file
|
|
|
|
the inputSio action lifted to Editor
|
|
|
the inputSio action lifted to Editor with empty prompt
|
|
|
the outputSio action lifted to Editor
|
|
|
the historySIO action lifted to Editor
|
|
|
the errorSIO action lifted to Editor
|
|
|
:: Ctx m | | => Editor m a | the action to run
| -> Stato | the initial state
| -> m Stato | the final state wrapped in the monad choosen for the SIO
| editor runner .
resolve the all monad from a core state to another
|
|
|
Produced by Haddock version 2.3.0 |