polysemy-readline-0.1.0.0: Readline effect for polysemy.
Safe HaskellNone
LanguageHaskell2010

Polysemy.Readline

Description

This libraries provides a polysemy effect that provides interactive command line usage.

Synopsis

Effect and Actions

data Readline (m :: * -> *) a where Source #

For documentation on actions see haskeline's functions with the same name and similar type signatures.

outputStr :: forall r. MemberWithError Readline r => String -> Sem r () Source #

Interpreters

runReadline :: forall m r a. (MonadIO m, MonadMask m, Member (Embed m) r) => Settings m -> Sem (Readline ': r) a -> Sem r a Source #

The standard way to run a Readline effect. Should be sufficient for most use cases. If you want to modify the Behavior or Prefs of InputT use interpretReadlineAsInputT instead.

interpretReadlineAsInputT :: forall m r a. (MonadIO m, MonadMask m, Member (Embed (InputT m)) r) => Sem (Readline ': r) a -> Sem r a Source #

Interpret in terms of an embedded InputT stack.

Re-exports from haskeline

data Settings (m :: Type -> Type) #

Application-specific customizations to the user interface.

Instances

Instances details
(MonadIO m, MonadMask m) => CommandMonad (InputCmdT m) 
Instance details

Defined in System.Console.Haskeline.InputT

Methods

runCompletion :: (String, String) -> InputCmdT m (String, [Completion])

defaultSettings :: forall (m :: Type -> Type). MonadIO m => Settings m #

A useful default. In particular:

defaultSettings = Settings {
          complete = completeFilename,
          historyFile = Nothing,
          autoAddHistory = True
          }