Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Readline (m :: Type -> Type) (k :: Type) where
- prompt :: Has Readline sig m => String -> m (Int, Maybe String)
- print :: Has Readline sig m => Doc AnsiStyle -> m ()
- 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
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
Instances
Algebra NonDet [] | |
Algebra Empty Maybe | |
Algebra Choose NonEmpty | |
(MonadIO m, MonadMask m) => Algebra Readline (ReadlineC m) Source # | |
Algebra sig m => Algebra sig (IdentityT 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 (Lift IO) IO | |
Algebra (Lift Identity) Identity | |
Monoid w => Algebra (Writer w) ((,) w) | |
Algebra (Error e) (Either e) | |
Monad m => Algebra (Lift m) (LiftC m) | |
Algebra (Reader r) ((->) r :: Type -> Type) | |
Algebra sig m => Algebra (Empty :+: sig) (MaybeT 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) | |
Algebra sig m => Algebra (Error e :+: sig) (ExceptT e 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 (Reader r :+: sig) (ReaderT r m) | |
Algebra sig m => Algebra (Reader r :+: sig) (ReaderC r 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) | |
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