|
System.Console.Haskeline.Class | Portability | FlexibleInstances, MultiPatamTypeClasses, UndecidableInstances, GeneralizedNewtypeDeriving | Stability | experimental | Maintainer | Antoine Latter <aslatter@gmail.com> |
|
|
|
Description |
Haskeline provides all of its functionality within the scope of a monad transformer.
This module adds two pieces to this:
- - Introduced here is a type-class which defines the operations
supported by the Haskeline monad transformer - MonadHaskeline
- - Also is a newtype wrapper around Haskeline's InputT, called
HaskelineT. Sadly, InputT defines ints own instance of the
mtl MonadState, which is no good for folks wanting to use
InputT in an existing monad transformer stack.
HaskelineT also has an instance of MonadState, but it merely
lifts the functions further in the transformer stack.
Large portions of the Haskeline functionality are re-exported
here for convinience.
|
|
Synopsis |
|
|
|
Documentation |
|
|
Instances | |
|
|
|
|
|
|
|
| Methods | | | Instances | |
|
|
|
Application-specific customizations to the user interface.
| Constructors | Settings | | complete :: CompletionFunc m | Custom tab completion.
| historyFile :: Maybe FilePath | Where to read/write the history at the
start and end of each
line input session.
| autoAddHistory :: Bool | If True, each nonblank line returned by
getInputLine will be automatically added to the history.
|
|
| Instances | |
|
|
|
A useful default. In particular:
defaultSettings = Settings {
complete = completeFilename,
historyFile = Nothing,
autoAddHistory = True
}
|
|
|
Because complete is the only field of Settings depending on m,
the expression defaultSettings {completionFunc = f} leads to a type error
from being too general. This function works around that issue, and may become unnecessary if another field
depending on m is added.
|
|
|
Prefs allow the user to customize the line-editing interface. They are
read by default from ~/.haskeline; to override that behavior, use
readPrefs and runInputTWithPrefs.
Each line of a .haskeline file defines
one field of the Prefs datatype; field names are case-insensitive and
unparseable lines are ignored. For example:
editMode: Vi
completionType: MenuCompletion
maxhistorysize: Just 40
| Instances | |
|
|
|
Read Prefs from a given file. If there is an error reading the file,
the defaultPrefs will be returned.
|
|
|
The default preferences which may be overwritten in the
.haskeline file.
|
|
|
Constructors | | Instances | |
|
|
|
|
|
module System.Console.Haskeline.Completion |
|
module System.Console.Haskeline.MonadException |
|
Produced by Haddock version 2.6.0 |