fused-effects-readline-0.1.0.0: A readline-like effect and carrier for fused-effects
Safe HaskellNone
LanguageHaskell2010

Control.Effect.Readline

Synopsis

Readline effect

data Readline (m :: Type -> Type) (k :: Type) where Source #

Constructors

Prompt :: String -> Readline m (Int, Maybe String) 
Print :: Doc AnsiStyle -> Readline m () 

Instances

Instances details
(MonadIO m, MonadMask m) => Algebra Readline (ReadlineC m) Source # 
Instance details

Defined in Control.Carrier.Readline.Haskeline

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (ReadlineC m) -> Readline n a -> ctx () -> ReadlineC m (ctx a)

print :: Has Readline sig m => Doc AnsiStyle -> m () Source #

Re-exports

class Monad m => Algebra (sig :: (Type -> Type) -> Type -> Type) (m :: Type -> Type) | m -> sig #

Minimal complete definition

alg

Instances

Instances details
Algebra Empty Maybe 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n Maybe -> Empty n a -> ctx () -> Maybe (ctx a)

Algebra NonDet [] 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n [] -> NonDet n a -> ctx () -> [ctx a]

Algebra Choose NonEmpty 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n NonEmpty -> Choose n a -> ctx () -> NonEmpty (ctx a)

(MonadIO m, MonadMask m) => Algebra Readline (ReadlineC m) Source # 
Instance details

Defined in Control.Carrier.Readline.Haskeline

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (ReadlineC m) -> Readline n a -> ctx () -> ReadlineC m (ctx a)

Algebra sig m => Algebra sig (IdentityT m) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (IdentityT m) -> sig n a -> ctx () -> IdentityT m (ctx a)

Algebra sig m => Algebra sig (Ap m) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (Ap m) -> sig n a -> ctx () -> Ap m (ctx a)

Algebra sig m => Algebra sig (Alt m) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (Alt m) -> sig n a -> ctx () -> Alt m (ctx a)

Algebra (Lift IO) IO 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n IO -> Lift IO n a -> ctx () -> IO (ctx a)

Algebra (Lift Identity) Identity 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n Identity -> Lift Identity n a -> ctx () -> Identity (ctx a)

Algebra (Error e) (Either e) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (Either e) -> Error e n a -> ctx () -> Either e (ctx a)

Monoid w => Algebra (Writer w) ((,) w) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n ((,) w) -> Writer w n a -> ctx () -> (w, ctx a)

Monad m => Algebra (Lift m) (LiftC m) 
Instance details

Defined in Control.Carrier.Lift

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (LiftC m) -> Lift m n a -> ctx () -> LiftC m (ctx a)

Algebra (Reader r) ((->) r :: Type -> Type) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n ((->) r) -> Reader r n a -> ctx () -> r -> ctx a

Algebra sig m => Algebra (Empty :+: sig) (MaybeT m) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (MaybeT m) -> (Empty :+: sig) n a -> ctx () -> MaybeT m (ctx a)

Algebra sig m => Algebra (Error e :+: sig) (ExceptT e m) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (ExceptT e m) -> (Error e :+: sig) n a -> ctx () -> ExceptT e m (ctx a)

Algebra sig m => Algebra (Reader r :+: sig) (ReaderT r m) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (ReaderT r m) -> (Reader r :+: sig) n a -> ctx () -> ReaderT r m (ctx a)

Algebra sig m => Algebra (Reader r :+: sig) (ReaderC r m) 
Instance details

Defined in Control.Carrier.Reader

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (ReaderC r m) -> (Reader r :+: sig) n a -> ctx () -> ReaderC r m (ctx a)

(Algebra sig m, Monoid w) => Algebra (Writer w :+: sig) (WriterT w m) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (WriterT w m) -> (Writer w :+: sig) n a -> ctx () -> WriterT w m (ctx a)

(Algebra sig m, Monoid w) => Algebra (Writer w :+: sig) (WriterT w m) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (WriterT w m) -> (Writer w :+: sig) n a -> ctx () -> WriterT w m (ctx a)

(Algebra sig m, Monoid w) => Algebra (Writer w :+: sig) (WriterT w m) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (WriterT w m) -> (Writer w :+: sig) n a -> ctx () -> WriterT w m (ctx a)

Algebra sig m => Algebra (State s :+: sig) (StateT s m) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (StateT s m) -> (State s :+: sig) n a -> ctx () -> StateT s m (ctx a)

Algebra sig m => Algebra (State s :+: sig) (StateT s m) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (StateT s m) -> (State s :+: sig) n a -> ctx () -> StateT s m (ctx a)

(Algebra sig m, Monoid w) => Algebra (Reader r :+: (Writer w :+: (State s :+: sig))) (RWST r w s m) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (RWST r w s m) -> (Reader r :+: (Writer w :+: (State s :+: sig))) n a -> ctx () -> RWST r w s m (ctx a)

(Algebra sig m, Monoid w) => Algebra (Reader r :+: (Writer w :+: (State s :+: sig))) (RWST r w s m) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (RWST r w s m) -> (Reader r :+: (Writer w :+: (State s :+: sig))) n a -> ctx () -> RWST r w s m (ctx a)

(Algebra sig m, Monoid w) => Algebra (Reader r :+: (Writer w :+: (State s :+: sig))) (RWST r w s m) 
Instance details

Defined in Control.Algebra

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (RWST r w s m) -> (Reader r :+: (Writer w :+: (State s :+: sig))) n a -> ctx () -> RWST r w s m (ctx a)

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 #