Safe Haskell | None |
---|---|
Language | Haskell2010 |
Control.Effect.Readline
Contents
Synopsis
- data Readline (m :: Type -> Type) k where
- GetInputLine :: forall (m :: Type -> Type). String -> Readline m (Maybe String)
- GetInputLineWithInitial :: forall (m :: Type -> Type). String -> (String, String) -> Readline m (Maybe String)
- GetInputChar :: forall (m :: Type -> Type). String -> Readline m (Maybe Char)
- GetPassword :: forall (m :: Type -> Type). Maybe Char -> String -> Readline m (Maybe String)
- WaitForAnyKey :: forall (m :: Type -> Type). String -> Readline m Bool
- OutputStr :: forall (m :: Type -> Type). String -> Readline m ()
- WithInterrupt :: forall (m :: Type -> Type) k. m k -> Readline m k
- HandleInterrupt :: forall (m :: Type -> Type) k. m k -> m k -> Readline m k
- getInputLine :: forall (sig :: (Type -> Type) -> Type -> Type) m. Has Readline sig m => String -> m (Maybe String)
- getInputLineWithInitial :: forall (sig :: (Type -> Type) -> Type -> Type) m. Has Readline sig m => String -> (String, String) -> m (Maybe String)
- getInputChar :: forall (sig :: (Type -> Type) -> Type -> Type) m. Has Readline sig m => String -> m (Maybe Char)
- getPassword :: forall (sig :: (Type -> Type) -> Type -> Type) m. Has Readline sig m => Maybe Char -> String -> m (Maybe String)
- waitForAnyKey :: forall (sig :: (Type -> Type) -> Type -> Type) m. Has Readline sig m => String -> m Bool
- outputStr :: forall (sig :: (Type -> Type) -> Type -> Type) m. Has Readline sig m => String -> m ()
- outputStrLn :: forall (sig :: (Type -> Type) -> Type -> Type) m. Has Readline sig m => String -> m ()
- withInterrupt :: forall (sig :: (Type -> Type) -> Type -> Type) m a. Has Readline sig m => m a -> m a
- handleInterrupt :: forall (sig :: (Type -> Type) -> Type -> Type) m a. Has Readline sig m => m a -> m a -> m a
- class Monad m => Algebra (sig :: (Type -> Type) -> Type -> Type) (m :: Type -> Type) | m -> sig
- type Has (eff :: (Type -> Type) -> Type -> Type) (sig :: (Type -> Type) -> Type -> Type) (m :: Type -> Type) = (Members eff sig, Algebra sig m)
- run :: Identity a -> a
Readline effect
data Readline (m :: Type -> Type) k where Source #
Constructors
GetInputLine :: forall (m :: Type -> Type). String -> Readline m (Maybe String) | |
GetInputLineWithInitial :: forall (m :: Type -> Type). String -> (String, String) -> Readline m (Maybe String) | |
GetInputChar :: forall (m :: Type -> Type). String -> Readline m (Maybe Char) | |
GetPassword :: forall (m :: Type -> Type). Maybe Char -> String -> Readline m (Maybe String) | |
WaitForAnyKey :: forall (m :: Type -> Type). String -> Readline m Bool | |
OutputStr :: forall (m :: Type -> Type). String -> Readline m () | |
WithInterrupt :: forall (m :: Type -> Type) k. m k -> Readline m k | |
HandleInterrupt :: forall (m :: Type -> Type) k. m k -> m k -> Readline m k |
Instances
getInputLine :: forall (sig :: (Type -> Type) -> Type -> Type) m. Has Readline sig m => String -> m (Maybe String) Source #
getInputLineWithInitial :: forall (sig :: (Type -> Type) -> Type -> Type) m. Has Readline sig m => String -> (String, String) -> m (Maybe String) Source #
getInputChar :: forall (sig :: (Type -> Type) -> Type -> Type) m. Has Readline sig m => String -> m (Maybe Char) Source #
getPassword :: forall (sig :: (Type -> Type) -> Type -> Type) m. Has Readline sig m => Maybe Char -> String -> m (Maybe String) Source #
waitForAnyKey :: forall (sig :: (Type -> Type) -> Type -> Type) m. Has Readline sig m => String -> m Bool Source #
outputStr :: forall (sig :: (Type -> Type) -> Type -> Type) m. Has Readline sig m => String -> m () Source #
outputStrLn :: forall (sig :: (Type -> Type) -> Type -> Type) m. Has Readline sig m => String -> m () Source #
withInterrupt :: forall (sig :: (Type -> Type) -> Type -> Type) m a. Has Readline sig m => m a -> m a Source #
handleInterrupt :: forall (sig :: (Type -> Type) -> Type -> Type) m a. Has Readline sig m => m a -> m a -> m a Source #
Re-exports
class Monad m => Algebra (sig :: (Type -> Type) -> Type -> Type) (m :: Type -> Type) | m -> sig #
The class of carriers (results) for algebras (effect handlers) over signatures (effects), whose actions are given by the alg
method.
Since: fused-effects-1.0.0.0
Minimal complete definition
Instances
Algebra Choose NonEmpty # | |
Algebra Empty Maybe # | |
Algebra NonDet [] # | |
Algebra sig m => Algebra sig (Choosing m) # | |
Algebra sig m => Algebra sig (Ap m) # | This instance permits effectful actions to be lifted into the mappend <$> act1 <*> (mappend <$> act2 <*> act3) is equivalent to getAp (act1 <> act2 <> act3) Since: fused-effects-1.0.1.0 |
Algebra sig m => Algebra sig (Alt m) # | This instance permits effectful actions to be lifted into the a <|> b <|> c <|> d is equivalent to getAlt (mconcat [a, b, c, d]) Since: fused-effects-1.0.1.0 |
Algebra sig m => Algebra sig (IdentityT m) # | |
Algebra (Lift Identity) Identity # | |
Algebra (Lift IO) IO # | |
Algebra (Error e) (Either e) # | |
Monad m => Algebra (Lift m) (LiftC m) # | |
Monoid w => Algebra (Writer w) ((,) w) # | |
Algebra (Reader r) ((->) r) # | |
Algebra sig m => Algebra (Choose :+: sig) (ChooseC m) # | |
Algebra sig m => Algebra (Cull :+: (NonDet :+: sig)) (CullC m) # | |
Algebra sig m => Algebra (Cut :+: (NonDet :+: sig)) (CutC m) # | |
Algebra sig m => Algebra (Empty :+: sig) (EmptyC m) # | |
Algebra sig m => Algebra (Empty :+: sig) (EmptyC m) # | |
Algebra sig m => Algebra (Empty :+: sig) (MaybeT m) # | |
Algebra sig m => Algebra (Fail :+: sig) (FailC m) # | |
Algebra sig m => Algebra (Fresh :+: sig) (FreshC m) # | |
Algebra sig m => Algebra (Fresh :+: sig) (FreshC m) # | |
Algebra sig m => Algebra (NonDet :+: sig) (NonDetC m) # | |
Algebra sig m => Algebra (Trace :+: sig) (TraceC m) # | |
(MonadIO m, Algebra sig m) => Algebra (Trace :+: sig) (TraceC m) # | |
Algebra sig m => Algebra (Trace :+: sig) (TraceC m) # | |
(Algebra sig m, MonadIO m, MonadMask m) => Algebra (Readline :+: sig) (ReadlineC m) Source # | |
(Algebra sig m, Monoid w) => Algebra (Accum w :+: sig) (AccumC w m) # | |
(Algebra sig m, Semigroup w, MonadIO m) => Algebra (Accum w :+: sig) (AccumC w m) # | |
(Algebra sig m, Monoid w) => Algebra (Accum w :+: sig) (AccumC w m) # | |
(Algebra sig m, Monoid w) => Algebra (Accum w :+: sig) (AccumT w m) # | |
Algebra sig m => Algebra (Error e :+: sig) (ErrorC e m) # | |
Algebra sig m => Algebra (Error e :+: sig) (ErrorC e m) # | |
Algebra sig m => Algebra (Error e :+: sig) (ExceptT e m) # | |
Algebra sig m => Algebra (Reader r :+: sig) (ReaderC r m) # | |
Algebra sig m => Algebra (Reader r :+: sig) (ReaderT r m) # | |
Algebra sig m => Algebra (State s :+: sig) (StateC s m) # | |
(MonadIO m, Algebra sig m) => Algebra (State s :+: sig) (StateC s m) # | |
Algebra sig m => Algebra (State s :+: sig) (StateC s m) # | |
Algebra sig m => Algebra (State s :+: sig) (StateC s m) # | |
Algebra sig m => Algebra (State s :+: sig) (StateT s m) # | |
Algebra sig m => Algebra (State s :+: sig) (StateT s m) # | |
Algebra sig m => Algebra (Throw e :+: sig) (ThrowC e m) # | |
(Algebra sig m, Monoid w) => Algebra (Writer w :+: sig) (WriterC w m) # | |
(Monoid w, Algebra sig m) => Algebra (Writer w :+: sig) (WriterC w m) # | |
(Algebra sig m, Monoid w) => Algebra (Writer w :+: sig) (WriterT w m) # | |
(Algebra sig m, Monoid w) => Algebra (Writer w :+: sig) (WriterT w m) # | |
(Algebra sig m, Monoid w) => Algebra (Writer w :+: sig) (WriterT w m) # | |
(Reifies s (Interpreter eff m), Algebra sig m) => Algebra (eff :+: sig) (InterpretC s eff m) # | |
Defined in Control.Carrier.Interpret Methods alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (InterpretC s eff m) -> (eff :+: sig) n a -> ctx () -> InterpretC s eff m (ctx a) # | |
Algebra (eff :+: sig) (sub m) => Algebra (Labelled label eff :+: sig) (Labelled label sub m) # | |
(Algebra sig m, Monoid w) => Algebra (Reader r :+: (Writer w :+: (State s :+: sig))) (RWST r w s m) # | |
(Algebra sig m, Monoid w) => Algebra (Reader r :+: (Writer w :+: (State s :+: sig))) (RWST r w s m) # | |
(Algebra sig m, Monoid w) => Algebra (Reader r :+: (Writer w :+: (State s :+: sig))) (RWST r w s m) # | |
(LabelledMember label sub sig, Algebra sig m) => Algebra (sub :+: sig) (UnderLabel label sub m) # | |
Defined in Control.Effect.Labelled Methods alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (UnderLabel label sub m) -> (sub :+: sig) n a -> ctx () -> UnderLabel label sub m (ctx a) # |
type Has (eff :: (Type -> Type) -> Type -> Type) (sig :: (Type -> Type) -> Type -> Type) (m :: Type -> Type) = (Members eff sig, Algebra sig m) #
m
is a carrier for sig
containing eff
.
Note that if eff
is a sum, it will be decomposed into multiple Member
constraints. While this technically allows one to combine multiple unrelated effects into a single Has
constraint, doing so has two significant drawbacks:
- Due to a problem with recursive type families, this can lead to significantly slower compiles.
- It defeats
ghc
’s warnings for redundant constraints, and thus can lead to a proliferation of redundant constraints as code is changed.
Since: fused-effects-1.0.0.0