Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Readline m k
- prompt :: Has Readline sig m => String -> m (Int, Maybe String)
- print :: Has Readline sig m => Doc AnsiStyle -> m ()
- class (HFunctor sig, 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
Instances
Re-exports
class (HFunctor sig, 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
Instances
Algebra NonDet [] | |
Defined in Control.Algebra | |
Algebra Empty Maybe | |
Algebra Choose NonEmpty | |
MonadException m => Algebra Readline (ReadlineC m) Source # | |
Algebra sig m => Algebra sig (IdentityT m) | |
Defined in Control.Algebra | |
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 |
Defined in Control.Algebra | |
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 |
Defined in Control.Algebra | |
Algebra (Lift IO) IO | |
Algebra (Lift Identity) Identity | |
Monoid w => Algebra (Writer w) ((,) w) | |
Defined in Control.Algebra | |
Algebra (Error e) (Either e) | |
Monad m => Algebra (Lift m) (LiftC m) | |
Algebra (Reader r) ((->) r :: Type -> Type) | |
Defined in Control.Algebra | |
(Algebra sig m, Effect sig, Monoid w) => Algebra (Writer w :+: sig) (WriterT w m) | |
(Algebra sig m, Effect sig, Monoid w) => Algebra (Writer w :+: sig) (WriterT w m) | |
(Algebra sig m, Effect sig) => Algebra (Error e :+: sig) (ExceptT e m) | |
(Algebra sig m, Effect sig) => Algebra (State s :+: sig) (StateT s m) | |
(Algebra sig m, Effect sig) => Algebra (State s :+: sig) (StateT s m) | |
Algebra sig m => Algebra (Reader r :+: sig) (ReaderT r m) | |
Algebra sig m => Algebra (Reader r :+: sig) (ReaderC r m) | |
(Algebra sig m, Effect sig, Monoid w) => Algebra (Reader r :+: (Writer w :+: (State s :+: sig))) (RWST r w s m) | |
(Algebra sig m, Effect sig, Monoid w) => Algebra (Reader r :+: (Writer w :+: (State s :+: sig))) (RWST r w s m) | |
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.