Safe Haskell | None |
---|---|
Language | Haskell2010 |
Re-exports of all public entities.
Synopsis
- data InputResult a
- = InterruptResult
- | EofResult
- | LineResult !a
- data ReplDirective
- newtype ReplT r s m a = ReplT {}
- addHistory :: MonadIO m => Text -> m ()
- byWord :: Monad m => (Text -> m [Text]) -> Text -> m [Text]
- clearScreen :: MonadIO m => m ()
- getInputLine :: MonadIO m => Text -> m (InputResult Text)
- historyLoad :: MonadIO m => FilePath -> m ()
- historySave :: MonadIO m => FilePath -> m ()
- printKeycodes :: MonadIO m => m ()
- replM :: MonadUnliftIO m => ReplDirective -> Text -> (Text -> m ReplDirective) -> (Text -> m [Text]) -> m ()
- runReplT :: MonadIO m => ReplT r s m a -> r -> s -> m (a, s)
- setCompletion :: MonadUnliftIO m => (Text -> m [Text]) -> m ()
- setMultiline :: MonadIO m => Bool -> m ()
- stifleHistory :: MonadIO m => Int -> m ()
Documentation
data InputResult a Source #
Result of getInputLine.
InterruptResult | ctrl+c |
EofResult | ctrl+d |
LineResult !a |
Instances
data ReplDirective Source #
Directive to control voluntary REPL termination.
Instances
Eq ReplDirective Source # | |
Defined in Linenoise.Repl (==) :: ReplDirective -> ReplDirective -> Bool # (/=) :: ReplDirective -> ReplDirective -> Bool # | |
Show ReplDirective Source # | |
Defined in Linenoise.Repl showsPrec :: Int -> ReplDirective -> ShowS # show :: ReplDirective -> String # showList :: [ReplDirective] -> ShowS # |
newtype ReplT r s m a Source #
Basic monad transformer with mutable state that can be used with all Linenoise.Unlift functions. You do not have to use this, but it's here to cover most of what you would need without having to roll your own newtype.
Instances
MonadIO m => MonadState s (ReplT r s m) Source # | |
Monad m => MonadReader r (ReplT r s m) Source # | |
MonadTrans (ReplT r s) Source # | |
Defined in Linenoise.Repl | |
Monad m => Monad (ReplT r s m) Source # | |
Functor m => Functor (ReplT r s m) Source # | |
MonadFix m => MonadFix (ReplT r s m) Source # | |
Defined in Linenoise.Repl | |
MonadFail m => MonadFail (ReplT r s m) Source # | |
Defined in Linenoise.Repl | |
Applicative m => Applicative (ReplT r s m) Source # | |
Defined in Linenoise.Repl | |
MonadZip m => MonadZip (ReplT r s m) Source # | |
MonadIO m => MonadIO (ReplT r s m) Source # | |
Defined in Linenoise.Repl | |
Alternative m => Alternative (ReplT r s m) Source # | |
MonadPlus m => MonadPlus (ReplT r s m) Source # | |
MonadThrow m => MonadThrow (ReplT r s m) Source # | |
Defined in Linenoise.Repl | |
MonadCatch m => MonadCatch (ReplT r s m) Source # | |
MonadUnliftIO m => MonadUnliftIO (ReplT r s m) Source # | |
Defined in Linenoise.Repl |
addHistory :: MonadIO m => Text -> m () Source #
Add to current history.
clearScreen :: MonadIO m => m () Source #
Clear the screen.
getInputLine :: MonadIO m => Text -> m (InputResult Text) Source #
Run the prompt, yielding a string.
historyLoad :: MonadIO m => FilePath -> m () Source #
Load history from a file.
historySave :: MonadIO m => FilePath -> m () Source #
Save history to a file.
printKeycodes :: MonadIO m => m () Source #
Print keycodes.
:: MonadUnliftIO m | |
=> ReplDirective | Directive on interrupt |
-> Text | Prompt |
-> (Text -> m ReplDirective) | Action |
-> (Text -> m [Text]) | Completion |
-> m () |
Run a simple REPL.
setCompletion :: MonadUnliftIO m => (Text -> m [Text]) -> m () Source #
Set the current completion function.
setMultiline :: MonadIO m => Bool -> m () Source #
Enable/Disable multiline input.
stifleHistory :: MonadIO m => Int -> m () Source #
Limit the maximum history length.