readline-in-other-words-0.1.0.2: Readline effect for in-other-words.
Safe HaskellNone
LanguageHaskell2010

Control.Effect.Readline.Internal

Description

__WARNING: the API of this module is not included in the PvP versioning of this package.__

This module mostly exists to break a cyclic dependency between the Carrier instance and ReadlineHistory which isn't exported from Control.Effect.Readline.

Synopsis

Documentation

getInputLine :: Eff Readline m => String -> m (Maybe String) Source #

Reads one line of input. The final newline (if any) is removed. When using terminal-style interaction, this function provides a rich line-editing user interface.

If autoAddHistory == True and the line input is nonblank (i.e., is not all spaces), it will be automatically added to the history.

getInputLineWithInitial :: Eff Readline m => String -> (String, String) -> m (Maybe String) Source #

Reads one line of input and fills the insertion space with initial text. When using terminal-style interaction, this function provides a rich line-editing user interface with the added ability to give the user default values.

This function behaves in the exact same manner as getInputLine, except that it pre-populates the input area. The text that resides in the input area is given as a 2-tuple with two Strings. The string on the left of the tuple (obtained by calling fst) is what will appear to the left of the cursor and the string on the right (obtained by calling snd) is what will appear to the right of the cursor.

Some examples of calling of this function are:

getInputLineWithInitial "prompt> " ("left", "") -- The cursor starts at the end of the line.
getInputLineWithInitial "prompt> " ("left ", "right") -- The cursor starts before the second word.

getInputChar :: Eff Readline m => String -> m (Maybe Char) Source #

Reads one character of input. Ignores non-printable characters.

When using terminal-style interaction, the character will be read without waiting for a newline.

When using file-style interaction, a newline will be read if it is immediately available after the input character.

getPassword :: Eff Readline m => Maybe Char -> String -> m (Maybe String) Source #

Reads one line of input, without displaying the input while it is being typed. When using terminal-style interaction, the masking character (if given) will replace each typed character.

When using file-style interaction, this function turns off echoing while reading the line of input.

Note that if Haskeline is built against a version of the Win32 library earlier than 2.5, getPassword will incorrectly echo back input on MinTTY consoles (such as Cygwin or MSYS).

waitForAnyKey :: Eff Readline m => String -> m Bool Source #

Waits for one key to be pressed, then returns. Ignores the value of the specific key.

Returns True if it successfully accepted one key. Returns False if it encountered the end of input; i.e., an EOF in file-style interaction, or a Ctrl-D in terminal-style interaction.

When using file-style interaction, consumes a single character from the input which may be non-printable.

outputStr :: Eff Readline m => String -> m () Source #

Write a Unicode string to the user's standard output.

outputStrLn :: Eff Readline m => String -> m () Source #

Write a Unicode string to the user's standard output, followed by a newline.

data HandleInterrupt :: Effect where Source #

Constructors

WithInterrupt :: m a -> HandleInterrupt m a 
HandleInterrupt :: m a -> m a -> HandleInterrupt m a 

withInterrupt :: Eff HandleInterrupt m => m a -> m a Source #

If Ctrl-C is pressed during the given action, enables interrupt handling within the nested scope. For example:

tryAction :: Eff '[Readline, HandleInterrupt] m => m ()
tryAction = handleInterrupt (outputStrLn "Cancelled.")
               $ withInterrupt $ someLongAction

The action can handle the interrupt itself every time Ctrl-C is pressed.

{-# LANGUAGE -XBlockArguments #-}
tryAction :: Eff '[Readline, HandleInterrupt] m => m ()
tryAction = withInterrupt loop where
  loop = someLongAction `catchInterrupt` do
    outputStrLn "Cancelled; trying again."
    loop

This behavior differs from GHC's built-in Ctrl-C handling, which may immediately terminate the program after the second time that the user presses Ctrl-C.

handleInterrupt :: Eff HandleInterrupt m => m a -> m a -> m a Source #

Handle an Interrupt. When an interrupt occurs in the second argument, the first argument will be called.

catchInterrupt :: Eff HandleInterrupt m => m a -> m a -> m a Source #

Specify a continuation that should be called when an Interrupt occurs.

catchInterrupt = flip handleInterrupt

modifyHistory :: Eff ReadlineHistory m => (History -> History) -> m () Source #

Modify the History. The modification is not atomic.

newtype EfflyIO m a Source #

newtype that provides MonadIO when Eff (Embed IO) m and otherwise just passes through instances to the base monad

Constructors

EfflyIO 

Fields

Instances

Instances details
MonadTrans EfflyIO Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

lift :: Monad m => m a -> EfflyIO m a #

MonadTransControl EfflyIO Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Associated Types

type StT EfflyIO a #

Methods

liftWith :: Monad m => (Run EfflyIO -> m a) -> EfflyIO m a #

restoreT :: Monad m => m (StT EfflyIO a) -> EfflyIO m a #

MonadBaseControl b m => MonadBaseControl b (EfflyIO m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Associated Types

type StM (EfflyIO m) a #

Methods

liftBaseWith :: (RunInBase (EfflyIO m) b -> b a) -> EfflyIO m a #

restoreM :: StM (EfflyIO m) a -> EfflyIO m a #

MonadBase b m => MonadBase b (EfflyIO m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

liftBase :: b α -> EfflyIO m α #

Monad m => Monad (EfflyIO m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

(>>=) :: EfflyIO m a -> (a -> EfflyIO m b) -> EfflyIO m b #

(>>) :: EfflyIO m a -> EfflyIO m b -> EfflyIO m b #

return :: a -> EfflyIO m a #

Functor m => Functor (EfflyIO m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

fmap :: (a -> b) -> EfflyIO m a -> EfflyIO m b #

(<$) :: a -> EfflyIO m b -> EfflyIO m a #

MonadFix m => MonadFix (EfflyIO m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

mfix :: (a -> EfflyIO m a) -> EfflyIO m a #

MonadFail m => MonadFail (EfflyIO m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

fail :: String -> EfflyIO m a #

Applicative m => Applicative (EfflyIO m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

pure :: a -> EfflyIO m a #

(<*>) :: EfflyIO m (a -> b) -> EfflyIO m a -> EfflyIO m b #

liftA2 :: (a -> b -> c) -> EfflyIO m a -> EfflyIO m b -> EfflyIO m c #

(*>) :: EfflyIO m a -> EfflyIO m b -> EfflyIO m b #

(<*) :: EfflyIO m a -> EfflyIO m b -> EfflyIO m a #

Eff (Embed IO) m => MonadIO (EfflyIO m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

liftIO :: IO a -> EfflyIO m a #

MonadThrow m => MonadThrow (EfflyIO m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

throwM :: Exception e => e -> EfflyIO m a #

MonadCatch m => MonadCatch (EfflyIO m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

catch :: Exception e => EfflyIO m a -> (e -> EfflyIO m a) -> EfflyIO m a #

MonadMask m => MonadMask (EfflyIO m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

mask :: ((forall a. EfflyIO m a -> EfflyIO m a) -> EfflyIO m b) -> EfflyIO m b #

uninterruptibleMask :: ((forall a. EfflyIO m a -> EfflyIO m a) -> EfflyIO m b) -> EfflyIO m b #

generalBracket :: EfflyIO m a -> (a -> ExitCase b -> EfflyIO m c) -> (a -> EfflyIO m b) -> EfflyIO m (b, c) #

type StT EfflyIO a Source # 
Instance details

Defined in Control.Effect.Readline.Internal

type StT EfflyIO a = StT (IdentityT :: (Type -> Type) -> Type -> Type) a
type StM (EfflyIO m) a Source # 
Instance details

Defined in Control.Effect.Readline.Internal

type StM (EfflyIO m) a = StM m a

newtype ReadlineT m a Source #

Version of InputT that we "own" so that we can define new instances on it, in particular threading constraints without creating orphan instances.

Constructors

ReadlineT 

Fields

Instances

Instances details
MonadTrans ReadlineT Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

lift :: Monad m => m a -> ReadlineT m a #

ThreadsEff ReadlineT Split Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

threadEff :: Monad m => (forall x. Split m x -> m x) -> Split (ReadlineT m) a -> ReadlineT m a #

ThreadsEff ReadlineT Mask Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

threadEff :: Monad m => (forall x. Mask m x -> m x) -> Mask (ReadlineT m) a -> ReadlineT m a #

ThreadsEff ReadlineT Fix Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

threadEff :: Monad m => (forall x. Fix m x -> m x) -> Fix (ReadlineT m) a -> ReadlineT m a #

ThreadsEff ReadlineT Bracket Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

threadEff :: Monad m => (forall x. Bracket m x -> m x) -> Bracket (ReadlineT m) a -> ReadlineT m a #

Monoid o => ThreadsEff ReadlineT (WriterPrim o) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

threadEff :: Monad m => (forall x. WriterPrim o m x -> m x) -> WriterPrim o (ReadlineT m) a -> ReadlineT m a #

ThreadsEff ReadlineT (Unravel p) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

threadEff :: Monad m => (forall x. Unravel p m x -> m x) -> Unravel p (ReadlineT m) a -> ReadlineT m a #

ThreadsEff ReadlineT (Unlift b) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

threadEff :: Monad m => (forall x. Unlift b m x -> m x) -> Unlift b (ReadlineT m) a -> ReadlineT m a #

ThreadsEff ReadlineT (BaseControl b) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

threadEff :: Monad m => (forall x. BaseControl b m x -> m x) -> BaseControl b (ReadlineT m) a -> ReadlineT m a #

Functor s => ThreadsEff ReadlineT (Optional s) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

threadEff :: Monad m => (forall x. Optional s m x -> m x) -> Optional s (ReadlineT m) a -> ReadlineT m a #

ThreadsEff ReadlineT (ReaderPrim i) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

threadEff :: Monad m => (forall x. ReaderPrim i m x -> m x) -> ReaderPrim i (ReadlineT m) a -> ReadlineT m a #

ThreadsEff ReadlineT (Regional s) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

threadEff :: Monad m => (forall x. Regional s m x -> m x) -> Regional s (ReadlineT m) a -> ReadlineT m a #

Monoid o => ThreadsEff ReadlineT (ListenPrim o) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

threadEff :: Monad m => (forall x. ListenPrim o m x -> m x) -> ListenPrim o (ReadlineT m) a -> ReadlineT m a #

MonadBaseControl b m => MonadBaseControl b (ReadlineT m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Associated Types

type StM (ReadlineT m) a #

Methods

liftBaseWith :: (RunInBase (ReadlineT m) b -> b a) -> ReadlineT m a #

restoreM :: StM (ReadlineT m) a -> ReadlineT m a #

MonadBase b m => MonadBase b (ReadlineT m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

liftBase :: b α -> ReadlineT m α #

Monad m => Monad (ReadlineT m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

(>>=) :: ReadlineT m a -> (a -> ReadlineT m b) -> ReadlineT m b #

(>>) :: ReadlineT m a -> ReadlineT m b -> ReadlineT m b #

return :: a -> ReadlineT m a #

Functor m => Functor (ReadlineT m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

fmap :: (a -> b) -> ReadlineT m a -> ReadlineT m b #

(<$) :: a -> ReadlineT m b -> ReadlineT m a #

MonadFix m => MonadFix (ReadlineT m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

mfix :: (a -> ReadlineT m a) -> ReadlineT m a #

MonadFail m => MonadFail (ReadlineT m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

fail :: String -> ReadlineT m a #

Applicative m => Applicative (ReadlineT m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

pure :: a -> ReadlineT m a #

(<*>) :: ReadlineT m (a -> b) -> ReadlineT m a -> ReadlineT m b #

liftA2 :: (a -> b -> c) -> ReadlineT m a -> ReadlineT m b -> ReadlineT m c #

(*>) :: ReadlineT m a -> ReadlineT m b -> ReadlineT m b #

(<*) :: ReadlineT m a -> ReadlineT m b -> ReadlineT m a #

MonadIO m => MonadIO (ReadlineT m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

liftIO :: IO a -> ReadlineT m a #

MonadThrow m => MonadThrow (ReadlineT m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

throwM :: Exception e => e -> ReadlineT m a #

MonadCatch m => MonadCatch (ReadlineT m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

catch :: Exception e => ReadlineT m a -> (e -> ReadlineT m a) -> ReadlineT m a #

MonadMask m => MonadMask (ReadlineT m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

mask :: ((forall a. ReadlineT m a -> ReadlineT m a) -> ReadlineT m b) -> ReadlineT m b #

uninterruptibleMask :: ((forall a. ReadlineT m a -> ReadlineT m a) -> ReadlineT m b) -> ReadlineT m b #

generalBracket :: ReadlineT m a -> (a -> ExitCase b -> ReadlineT m c) -> (a -> ReadlineT m b) -> ReadlineT m (b, c) #

type StM (ReadlineT m) a Source # 
Instance details

Defined in Control.Effect.Readline.Internal

type StM (ReadlineT m) a = StM m a

class Threads ReadlineT p => ReadlineThreads p Source #

Threading constraint for handlers using InputT/ReadlineT internally.

ReadlineThreads accepts all the primitive effects (intended to be used as such) offered by in-other-words.

Most notably, ReadlineThreads accepts Unlift b.

Instances

Instances details
Threads ReadlineT p => ReadlineThreads p Source # 
Instance details

Defined in Control.Effect.Readline.Internal

newtype ReadlineC m a Source #

Constructors

ReadlineC 

Fields

Instances

Instances details
MonadTrans ReadlineC Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

lift :: Monad m => m a -> ReadlineC m a #

MonadBaseControl b m => MonadBaseControl b (ReadlineC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Associated Types

type StM (ReadlineC m) a #

Methods

liftBaseWith :: (RunInBase (ReadlineC m) b -> b a) -> ReadlineC m a #

restoreM :: StM (ReadlineC m) a -> ReadlineC m a #

MonadBase b m => MonadBase b (ReadlineC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

liftBase :: b α -> ReadlineC m α #

Monad m => Monad (ReadlineC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

(>>=) :: ReadlineC m a -> (a -> ReadlineC m b) -> ReadlineC m b #

(>>) :: ReadlineC m a -> ReadlineC m b -> ReadlineC m b #

return :: a -> ReadlineC m a #

Functor m => Functor (ReadlineC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

fmap :: (a -> b) -> ReadlineC m a -> ReadlineC m b #

(<$) :: a -> ReadlineC m b -> ReadlineC m a #

MonadFix m => MonadFix (ReadlineC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

mfix :: (a -> ReadlineC m a) -> ReadlineC m a #

MonadFail m => MonadFail (ReadlineC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

fail :: String -> ReadlineC m a #

Applicative m => Applicative (ReadlineC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

pure :: a -> ReadlineC m a #

(<*>) :: ReadlineC m (a -> b) -> ReadlineC m a -> ReadlineC m b #

liftA2 :: (a -> b -> c) -> ReadlineC m a -> ReadlineC m b -> ReadlineC m c #

(*>) :: ReadlineC m a -> ReadlineC m b -> ReadlineC m b #

(<*) :: ReadlineC m a -> ReadlineC m b -> ReadlineC m a #

Eff (Embed IO) m => MonadIO (ReadlineC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

liftIO :: IO a -> ReadlineC m a #

MonadThrow m => MonadThrow (ReadlineC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

throwM :: Exception e => e -> ReadlineC m a #

MonadCatch m => MonadCatch (ReadlineC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

catch :: Exception e => ReadlineC m a -> (e -> ReadlineC m a) -> ReadlineC m a #

MonadMask m => MonadMask (ReadlineC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

mask :: ((forall a. ReadlineC m a -> ReadlineC m a) -> ReadlineC m b) -> ReadlineC m b #

uninterruptibleMask :: ((forall a. ReadlineC m a -> ReadlineC m a) -> ReadlineC m b) -> ReadlineC m b #

generalBracket :: ReadlineC m a -> (a -> ExitCase b -> ReadlineC m c) -> (a -> ReadlineC m b) -> ReadlineC m (b, c) #

(Carrier m, Eff (Embed IO) m, MonadMask m, Threads ReadlineT (Prims m)) => Carrier (ReadlineC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Associated Types

type Derivs (ReadlineC m) :: [Effect] #

type Prims (ReadlineC m) :: [Effect] #

type Prims (ReadlineC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

type Prims (ReadlineC m) = Prims m
type Derivs (ReadlineC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

type StM (ReadlineC m) a Source # 
Instance details

Defined in Control.Effect.Readline.Internal

type StM (ReadlineC m) a = StM (ReadlineT (EfflyIO m)) a

runReadlineC :: (InputT (EfflyIO m) a -> EfflyIO m a) -> ReadlineC m a -> m a Source #

newtype ReadlineInterruptC m a Source #

Instances

Instances details
MonadTrans ReadlineInterruptC Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

lift :: Monad m => m a -> ReadlineInterruptC m a #

MonadBaseControl b m => MonadBaseControl b (ReadlineInterruptC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Associated Types

type StM (ReadlineInterruptC m) a #

MonadBase b m => MonadBase b (ReadlineInterruptC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

liftBase :: b α -> ReadlineInterruptC m α #

Monad m => Monad (ReadlineInterruptC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Functor m => Functor (ReadlineInterruptC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

fmap :: (a -> b) -> ReadlineInterruptC m a -> ReadlineInterruptC m b #

(<$) :: a -> ReadlineInterruptC m b -> ReadlineInterruptC m a #

MonadFix m => MonadFix (ReadlineInterruptC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

mfix :: (a -> ReadlineInterruptC m a) -> ReadlineInterruptC m a #

MonadFail m => MonadFail (ReadlineInterruptC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

fail :: String -> ReadlineInterruptC m a #

Applicative m => Applicative (ReadlineInterruptC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Eff (Embed IO) m => MonadIO (ReadlineInterruptC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

liftIO :: IO a -> ReadlineInterruptC m a #

MonadThrow m => MonadThrow (ReadlineInterruptC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Methods

throwM :: Exception e => e -> ReadlineInterruptC m a #

MonadCatch m => MonadCatch (ReadlineInterruptC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

MonadMask m => MonadMask (ReadlineInterruptC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

(Carrier m, Eff (Embed IO) m, MonadMask m, Threads ReadlineT (Prims m)) => Carrier (ReadlineInterruptC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

Associated Types

type Derivs (ReadlineInterruptC m) :: [Effect] #

type Prims (ReadlineInterruptC m) :: [Effect] #

type Prims (ReadlineInterruptC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

type Derivs (ReadlineInterruptC m) Source # 
Instance details

Defined in Control.Effect.Readline.Internal

type StM (ReadlineInterruptC m) a Source # 
Instance details

Defined in Control.Effect.Readline.Internal

data WithOrHandleInterrupt a Source #

Type for denoting which kind of Optional we are inside of.

Instances

Instances details
Functor WithOrHandleInterrupt Source # 
Instance details

Defined in Control.Effect.Readline.Internal

runReadline :: (Eff (Embed IO) m, MonadMask m, Carrier m, Threaders '[ReadlineThreads] m p) => Settings m -> ReadlineInterruptC m a -> m a Source #

Main interpreter for Readline, ReadlineHistory, and HandleInterrupt effects. defaultSettings exists as a default for settings.

Example usage:

import Control.Effect
import Control.Effect.Readline

repl :: Effs '[Readline, HandleInterrupt] m => m ()
repl = handleInterrupt (outputStrLn "Interrupt!" *> repl) $
  withInterrupt $ do
    mline <- getInputLine "> "
    case mline of
      Nothing -> pure ()
      Just line -> outputStrLn line *> repl

main :: IO ()
main = runM $ runReadline defaultSettings repl

runReadlineBehavior :: (Eff (Embed IO) m, MonadMask m, Carrier m, Threaders '[ReadlineThreads] m p) => Behavior -> Settings m -> ReadlineInterruptC m a -> m a Source #

Like runReadline but additionally allows specifying a Behavior.

runReadlineWithPrefs :: (Eff (Embed IO) m, MonadMask m, Carrier m, Threaders '[ReadlineThreads] m p) => Prefs -> Settings m -> ReadlineInterruptC m a -> m a Source #

Like runReadline but additionally allows specifying a Prefs.

runReadlineBehaviorWithPrefs :: (Eff (Embed IO) m, MonadMask m, Carrier m, Threaders '[ReadlineThreads] m p) => Behavior -> Prefs -> Settings m -> ReadlineInterruptC m a -> m a Source #

Like runReadline but additionally allows specifying a Behavior and a Prefs.

runReadline' :: (Eff (Embed IO) m, MonadMask m, Carrier m, Threaders '[ReadlineThreads] m p) => Settings m -> ReadlineC m a -> m a Source #

Weaker version of runReadline intended for circumstances where the primitive effect Optional can't be threaded. This version is incapable of interpreting HandleInterrupt though.

runReadlineBehavior' :: (Eff (Embed IO) m, MonadMask m, Carrier m, Threaders '[ReadlineThreads] m p) => Behavior -> Settings m -> ReadlineC m a -> m a Source #

Weaker version of runReadlineBehavior intended for circumstances where the primitive effect Optional can't be threaded. This version is incapable of interpreting HandleInterrupt though.

runReadlineWithPrefs' :: (Eff (Embed IO) m, MonadMask m, Carrier m, Threaders '[ReadlineThreads] m p) => Prefs -> Settings m -> ReadlineC m a -> m a Source #

Weaker version of runReadlineWithPrefs intended for circumstances where the primitive effect Optional can't be threaded. This version is incapable of interpreting HandleInterrupt though.

runReadlineBehaviorWithPrefs' :: (Eff (Embed IO) m, MonadMask m, Carrier m, Threaders '[ReadlineThreads] m p) => Behavior -> Prefs -> Settings m -> ReadlineC m a -> m a Source #

Weaker version of runReadlineBehaviorWithPrefs intended for circumstances where the primitive effect Optional can't be threaded. This version is incapable of interpreting HandleInterrupt though.