Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class (Monad m, forall x. Eq x => Eq (m x), forall x. Semigroup x => Semigroup (m x), forall x. Monoid x => Monoid (m x)) => MonadIdentity m where
- unwrap :: m a -> a
- class (Monad m, MonadIdentity mark) => MonadHalt mark m where
- halt :: mark () -> m a
- class (Monad m, MonadIdentity mark) => MonadExcept mark e m where
- class (Monad m, MonadIdentity mark) => MonadState mark s m where
- class (Monad m, Monoid w, MonadIdentity mark) => MonadWriteOnly mark w m where
- class (Monad m, MonadIdentity mark) => MonadReadOnly mark r m where
- class (Monad m, MonadIdentity mark) => MonadAppendOnly mark w m where
- class (Monad m, MonadIdentity mark) => MonadWriteOnce mark w m where
- class (Monad m, MonadIdentity mark) => MonadPrompt mark (p :: * -> *) m where
- prompt :: mark (p a) -> m (mark a)
- data Identity (a :: *) = Identity {
- unIdentity :: a
- newtype Compose (m1 :: * -> *) (m2 :: * -> *) (a :: *) = Compose {
- unCompose :: m1 (m2 a)
- newtype ReadOnly (mark :: * -> *) (r :: *) (a :: *) = ReadOnly {
- unReadOnly :: r -> a
- newtype State (mark :: * -> *) (s :: *) (a :: *) = State {}
- data Except (mark :: * -> *) (e :: *) (a :: *)
- newtype WriteOnly (mark :: * -> *) (w :: *) (a :: *) = WriteOnly {
- unWriteOnly :: Pair w a
- data Halt (mark :: * -> *) (a :: *)
- newtype AppendOnly (mark :: * -> *) (w :: *) (a :: *) = AppendOnly {
- unAppendOnly :: w -> Pair w a
- newtype WriteOnce (mark :: * -> *) (w :: *) (a :: *) = WriteOnce {
- unWriteOnce :: LeftZero w -> Pair (LeftZero w) a
- newtype IdentityT (m :: * -> *) (a :: *) = IdentityT {
- unIdentityT :: m a
- runIdentityT :: Monad m => IdentityT m a -> m (Identity a)
- class MonadTrans t1 => ComposableT t1 where
- data ComposeT (t1 :: (* -> *) -> * -> *) (t2 :: (* -> *) -> * -> *) (m :: * -> *) (a :: *)
- toComposeT :: t1 (t2 m) a -> ComposeT t1 t2 m a
- unComposeT :: ComposeT t1 t2 m a -> t1 (t2 m) a
- newtype ReadOnlyT (mark :: * -> *) (r :: *) (m :: * -> *) (a :: *) = ReadOnlyT {
- unReadOnlyT :: ReadOnly mark r (m a)
- runReadOnlyT :: (Monad m, MonadIdentity mark, Commutant mark) => mark r -> ReadOnlyT mark r m a -> m (mark a)
- newtype StateT (mark :: * -> *) (s :: *) (m :: * -> *) (a :: *) = StateT {}
- runStateT :: (Monad m, MonadIdentity mark) => mark s -> StateT mark s m a -> m (Pair (mark s) a)
- newtype HaltT (mark :: * -> *) (m :: * -> *) (a :: *) = HaltT {}
- runHaltT :: (Monad m, MonadIdentity mark) => HaltT mark m a -> m (Halt mark a)
- newtype ExceptT (mark :: * -> *) (e :: *) (m :: * -> *) (a :: *) = ExceptT {}
- runExceptT :: (Monad m, MonadIdentity mark) => ExceptT mark e m a -> m (Except mark e a)
- newtype WriteOnlyT (mark :: * -> *) (w :: *) (m :: * -> *) (a :: *) = WriteOnlyT {
- unWriteOnlyT :: m (WriteOnly mark w a)
- runWriteOnlyT :: (Monad m, MonadIdentity mark, Monoid w) => WriteOnlyT mark w m a -> m (Pair (mark w) a)
- newtype WriteOnceT (mark :: * -> *) (w :: *) (m :: * -> *) (a :: *) = WriteOnceT {
- unWriteOnceT :: LeftZero w -> m (Pair (LeftZero w) a)
- runWriteOnceT :: (Monad m, MonadIdentity mark) => WriteOnceT mark w m a -> m (Pair (mark (Maybe w)) a)
- newtype AppendOnlyT (mark :: * -> *) (w :: *) (m :: * -> *) (a :: *) = AppendOnlyT {
- unAppendOnlyT :: w -> m (Pair w a)
- runAppendOnlyT :: (Monad m, MonadIdentity mark, Monoid w) => AppendOnlyT mark w m a -> m (Pair (mark w) a)
- data IdentityTT (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) = IdentityTT {
- unIdentityTT :: t m a
- runIdentityTT :: (Monad m, MonadTrans t) => IdentityTT t m a -> t m (Identity a)
- data PromptTT (mark :: * -> *) (p :: * -> *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) = PromptTT {
- unPromptTT :: forall v. (a -> t m v) -> (forall u. p u -> (u -> t m v) -> t m v) -> t m v
- runPromptTT :: (Monad m, MonadTrans t, MonadIdentity mark, Commutant mark) => Eval p m -> PromptTT mark p t m a -> t m (mark a)
- data Eval (p :: * -> *) (m :: * -> *) = Eval {
- unEval :: forall u. p u -> m u
- runOverTT :: (RunMonadTransTrans u, RunMonadTrans v, OverableT v, Monad m, MonadTrans t, MonadTrans v) => InputTT u m -> InputT v -> OverTT v u t m a -> t m (OutputTT u (OutputT v a))
- class MonadTrans v => OverableT v where
- newtype StateTT (mark :: * -> *) (s :: *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) = StateTT {}
- runStateTT :: (MonadIdentity mark, Monad m, MonadTrans t) => mark s -> StateTT mark s t m a -> t m (Pair (mark s) a)
- newtype ReadOnlyTT (mark :: * -> *) (r :: *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) = ReadOnlyTT {
- unReadOnlyTT :: ReadOnlyT mark r (t m) a
- runReadOnlyTT :: (MonadIdentity mark, Commutant mark, Monad m, MonadTrans t) => mark r -> ReadOnlyTT mark r t m a -> t m (mark a)
- newtype WriteOnlyTT (mark :: * -> *) (w :: *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) = WriteOnlyTT {
- unWriteOnlyTT :: WriteOnlyT mark w (t m) a
- runWriteOnlyTT :: (MonadIdentity mark, Monad m, MonadTrans t, Monoid w) => mark () -> WriteOnlyTT mark w t m a -> t m (Pair (mark w) a)
- newtype ExceptTT (mark :: * -> *) (e :: *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) = ExceptTT {
- unExceptTT :: ExceptT mark e (t m) a
- runExceptTT :: (MonadIdentity mark, Monad m, MonadTrans t) => mark () -> ExceptTT mark e t m a -> t m (Except mark e a)
- newtype HaltTT (mark :: * -> *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) = HaltTT {}
- runHaltTT :: (Monad m, MonadTrans t, MonadIdentity mark) => HaltTT mark t m a -> t m (Halt mark a)
- newtype AppendOnlyTT (mark :: * -> *) (w :: *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) = AppendOnlyTT {
- unAppendOnlyTT :: AppendOnlyT mark w (t m) a
- runAppendOnlyTT :: (MonadIdentity mark, Monad m, MonadTrans t, Monoid w) => mark () -> AppendOnlyTT mark w t m a -> t m (Pair (mark w) a)
- newtype WriteOnceTT (mark :: * -> *) (w :: *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) = WriteOnceTT {
- unWriteOnceTT :: WriteOnceT mark w (t m) a
- runWriteOnceTT :: (MonadIdentity mark, Monad m, MonadTrans t) => mark () -> WriteOnceTT mark w t m a -> t m (Pair (mark (Maybe w)) a)
- class Monad m => RunMonad m where
- class MonadTrans t => RunMonadTrans t where
- class MonadTransTrans u => RunMonadTransTrans u where
- class EqIn (t :: * -> *) where
- type Catch e m a = m a -> (e -> m a) -> m a
- class (MonadTrans t, RunMonadTrans t) => LiftCatch t where
- class (MonadTransTrans u, RunMonadTransTrans u) => LiftCatchT u where
- liftCatchT :: (Monad m, MonadTrans t) => (forall x. Catch e (t m) (OutputTT u x)) -> forall x. Catch e (u t m) x
- type Draft w m a = m a -> m (Pair w a)
- class (MonadTrans t, RunMonadTrans t) => LiftDraft t where
- class (MonadTransTrans u, RunMonadTransTrans u) => LiftDraftT u where
- liftDraftT :: (Monad m, MonadTrans t, Monoid w) => (forall x. Draft w (t m) (OutputTT u x)) -> forall x. Draft w (u t m) x
- type Local r m a = (r -> r) -> m a -> m a
- class (MonadTrans t, RunMonadTrans t) => LiftLocal t where
- class (MonadTransTrans u, RunMonadTransTrans u) => LiftLocalT u where
- liftLocalT :: (Monad m, MonadTrans t) => (forall x. Local r (t m) (OutputTT u x)) -> forall x. Local r (u t m) x
- class Functor d => Commutant d where
- commute :: Applicative f => d (f a) -> f (d a)
- class (Commutant c, Monad c) => Central c
- class Bifunctor (f :: * -> * -> *) where
- newtype Wrap f a = Wrap {
- unWrap :: f a
- class Renaming f where
- data Pair (a :: *) (b :: *) = Pair {}
- data LeftZero (a :: *)
- data RightZero (a :: *)
- class IsMaybe (f :: * -> *) where
- class (forall m. Monad m => Monad (t m)) => MonadTrans (t :: (* -> *) -> * -> *) where
- class MonadTrans t => MonadFunctor t where
- class (forall t. MonadTrans t => MonadTrans (u t), forall t m. (Monad m, MonadTrans t) => Monad (u t m)) => MonadTransTrans (u :: ((* -> *) -> * -> *) -> (* -> *) -> * -> *) where
- liftT :: (Monad m, MonadTrans t) => t m a -> u t m a
Effect Classes
class (Monad m, forall x. Eq x => Eq (m x), forall x. Semigroup x => Semigroup (m x), forall x. Monoid x => Monoid (m x)) => MonadIdentity m where Source #
Class representing monads from which we can extract a pure value. Instances should satisfy the following laws:
(1) unwrap . return === id (2) return . unwrap === id (3) x >>= f === f (unwrap x)
Instances
class (Monad m, MonadIdentity mark) => MonadHalt mark m where Source #
Class representing monads which can fail catastrophically, returning nothing. Instances should satisfy the following laws:
(1) halt a >> x === halt a
Nothing
halt :: mark () -> m a Source #
Fail catastrophically, returning nothing.
halt :: (Monad m1, MonadTrans t1, m ~ t1 m1, MonadHalt mark m1) => mark () -> m a Source #
Fail catastrophically, returning nothing.
Instances
class (Monad m, MonadIdentity mark) => MonadExcept mark e m where Source #
Class representing monads which can raise and handle marked exceptions
of type mark e
. Instances should satisfy the following laws:
(1) catch (return a) h === return a (2) catch (throw e) h === h e (3) throw e >>= f === throw e
Nothing
throw :: mark e -> m a Source #
Raise an exception
throw :: (Monad m1, MonadTrans t1, m ~ t1 m1, MonadExcept mark e m1) => mark e -> m a Source #
Raise an exception
catch :: m a -> (mark e -> m a) -> m a Source #
Run a computation, applying a handler to any raised exceptions
catch :: (Monad m1, MonadTrans t1, m ~ t1 m1, LiftCatch t1, MonadExcept mark e m1) => m a -> (mark e -> m a) -> m a Source #
Run a computation, applying a handler to any raised exceptions
Instances
class (Monad m, MonadIdentity mark) => MonadState mark s m where Source #
Class representing monads with access to a marked mutable state mark s
.
Instances should satisfy the following laws:
(1) put s1 >> put s2 === put s2 (2) put s >> get === put s >> return s (3) get >>= put === return () (4) get >>= \\s -> get >>= k s === get >>= \\s -> k s s
Nothing
Retrieve the current state
get :: (Monad m1, MonadTrans t1, m ~ t1 m1, MonadState mark s m1) => m (mark s) Source #
Retrieve the current state
put :: mark s -> m () Source #
Replace the current state
put :: (Monad m1, MonadTrans t1, m ~ t1 m1, MonadState mark s m1) => mark s -> m () Source #
Replace the current state
Instances
class (Monad m, Monoid w, MonadIdentity mark) => MonadWriteOnly mark w m where Source #
Class representing monads with access to a marked write-only state
mark w
. Note that w
must be an instance of Monoid
. Instances should
satisfy the following laws:
(1) draft (tell w) === return ((),w) (2) tell mempty === return () (3) tell w1 >> tell w2 === tell (mappend w1 w2) (4) draft (return a) === return (a, mempty) (5) draft (x >>= f) === draft x >>= (draft' f) where draft' f (a,w) = mapsnd (mappend w) <$> draft (f a)
Nothing
tell :: mark w -> m () Source #
Combine a value with the current write-only state
tell :: (Monad m1, MonadTrans t1, m ~ t1 m1, MonadWriteOnly mark w m1) => mark w -> m () Source #
Combine a value with the current write-only state
draft :: m a -> m (Pair (mark w) a) Source #
Run a computation, returning the write-only state with the result rather than writing it
draft :: (Monad m1, MonadTrans t1, m ~ t1 m1, LiftDraft t1, MonadWriteOnly mark w m1) => m a -> m (Pair (mark w) a) Source #
Run a computation, returning the write-only state with the result rather than writing it
Instances
class (Monad m, MonadIdentity mark) => MonadReadOnly mark r m where Source #
Class representing monads with access to a marked read-only state
mark r
. Instances should satisfy the following laws:
(1) local u ask === fmap u ask (2) local u (local v x) === local (v . u) x (3) local u x >> ask === ask >>= \r -> local u x >> return r (4) local u (return a) === return a (5) local u (x >>= f) === local u x >>= (local u . f)
Nothing
Retrieve the read-only state
ask :: (Monad m1, MonadTrans t1, m ~ t1 m1, MonadReadOnly mark r m1) => m (mark r) Source #
Retrieve the read-only state
local :: (mark r -> mark r) -> m a -> m a Source #
Run a computation with a locally modified read-only state
local :: (Monad m1, MonadTrans t1, m ~ t1 m1, LiftLocal t1, MonadReadOnly mark r m1) => (mark r -> mark r) -> m a -> m a Source #
Run a computation with a locally modified read-only state
Instances
class (Monad m, MonadIdentity mark) => MonadAppendOnly mark w m where Source #
Class representing monads with access to a marked append-only state
mark w
. Instances should satisfy the following laws:
(1) jot mempty === return () (2) jot (a <> b) === jot a >> jot b (3) look === return mempty (4) x >> look >> y === x >> y (5) jot w >> look === jot w >> return w
Nothing
Retrieve the append-only state
look :: (Monad m1, MonadTrans t1, m ~ t1 m1, MonadAppendOnly mark w m1) => m (mark w) Source #
Retrieve the append-only state
jot :: mark w -> m () Source #
Append a value to the state
jot :: (Monad m1, MonadTrans t1, m ~ t1 m1, MonadAppendOnly mark w m1) => mark w -> m () Source #
Append a value to the state
Instances
class (Monad m, MonadIdentity mark) => MonadWriteOnce mark w m where Source #
Class representing monads with access to a write-once, read-many state
mark w
. Instances should satisfy the following laws.
(1) etch a >> etch b === etch a >> return False (2) etch a >> press === return (Just $ pure a)
Nothing
etch :: mark w -> m Bool Source #
Attempt to record the write-once state, returning True
if and
only if the write succeeds.
etch :: (Monad m1, MonadTrans t1, m ~ t1 m1, MonadWriteOnce mark w m1) => mark w -> m Bool Source #
Attempt to record the write-once state, returning True
if and
only if the write succeeds.
press :: m (Maybe (mark w)) Source #
Attempt to read a copy of the write-once state.
press :: (Monad m1, MonadTrans t1, m ~ t1 m1, MonadWriteOnce mark w m1) => m (Maybe (mark w)) Source #
Attempt to read a copy of the write-once state.
Instances
class (Monad m, MonadIdentity mark) => MonadPrompt mark (p :: * -> *) m where Source #
Class representing monads which can prompt an oracle for a monadic result.
Nothing
prompt :: mark (p a) -> m (mark a) Source #
Prompt an oracle of type mark (p a)
, receiving a monadic result
prompt :: (Monad m1, MonadTrans t1, m ~ t1 m1, MonadPrompt mark p m1) => mark (p a) -> m (mark a) Source #
Prompt an oracle of type mark (p a)
, receiving a monadic result
Instances
Concrete Types
Monads
data Identity (a :: *) Source #
Concrete identity monad
Identity | |
|
Instances
Monad Identity Source # | |
Functor Identity Source # | |
Applicative Identity Source # | |
EqIn Identity Source # | |
Commutant Identity Source # | |
Defined in Control.FX.Monad.Identity | |
MonadIdentity Identity Source # | |
Defined in Control.FX.Monad.Identity | |
RunMonad Identity Source # | |
Central Identity Source # | |
Defined in Control.FX.Monad.Identity | |
Eq (Context Identity) Source # | |
Eq (Input Identity) Source # | |
Eq a => Eq (Identity a) Source # | |
Show (Context Identity) Source # | |
Show (Input Identity) Source # | |
Show a => Show (Identity a) Source # | |
Semigroup a => Semigroup (Identity a) Source # | |
Monoid a => Monoid (Identity a) Source # | |
Eq a => Eq (Output Identity a) Source # | |
Show a => Show (Output Identity a) Source # | |
data Context Identity Source # | |
Defined in Control.FX.Monad.Identity | |
data Input Identity Source # | |
Defined in Control.FX.Monad.Identity | |
data Output Identity a Source # | |
Defined in Control.FX.Monad.Identity |
newtype Compose (m1 :: * -> *) (m2 :: * -> *) (a :: *) Source #
Concrete composite monad
Instances
newtype ReadOnly (mark :: * -> *) (r :: *) (a :: *) Source #
Concrete read-only state monad with state type r
ReadOnly | |
|
Instances
newtype State (mark :: * -> *) (s :: *) (a :: *) Source #
Concrete state monad
Instances
data Except (mark :: * -> *) (e :: *) (a :: *) Source #
Concrete exception monad, throwing marked exceptions of type
mark e
and producing values of type a
Instances
newtype WriteOnly (mark :: * -> *) (w :: *) (a :: *) Source #
Concrete write-only state monad with state type w
WriteOnly | |
|
Instances
data Halt (mark :: * -> *) (a :: *) Source #
Concrete monad representing catastrophic failure
mark e
and producing values of type a
Instances
newtype AppendOnly (mark :: * -> *) (w :: *) (a :: *) Source #
Concrete append-only state monad with state type w
AppendOnly | |
|
Instances
newtype WriteOnce (mark :: * -> *) (w :: *) (a :: *) Source #
Concrete write-once state monad
WriteOnce | |
|
Instances
Transformers
newtype IdentityT (m :: * -> *) (a :: *) Source #
Concrete identity monad transformer
IdentityT | |
|
Instances
class MonadTrans t1 => ComposableT t1 where Source #
Class representing monad transformers which can be composed on top of an arbitrary monad transformer.
data ComposeT (t1 :: (* -> *) -> * -> *) (t2 :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) Source #
Concrete composite monad transformer
toComposeT :: t1 (t2 m) a -> ComposeT t1 t2 m a Source #
unComposeT :: ComposeT t1 t2 m a -> t1 (t2 m) a Source #
Instances
newtype ReadOnlyT (mark :: * -> *) (r :: *) (m :: * -> *) (a :: *) Source #
Concrete ReadOnly
monad transformer
ReadOnlyT | |
|
Instances
runReadOnlyT :: (Monad m, MonadIdentity mark, Commutant mark) => mark r -> ReadOnlyT mark r m a -> m (mark a) Source #
newtype StateT (mark :: * -> *) (s :: *) (m :: * -> *) (a :: *) Source #
Concrete State
monad transformer
Instances
runStateT :: (Monad m, MonadIdentity mark) => mark s -> StateT mark s m a -> m (Pair (mark s) a) Source #
newtype HaltT (mark :: * -> *) (m :: * -> *) (a :: *) Source #
Concrete Maybe
monad transformer
Instances
newtype ExceptT (mark :: * -> *) (e :: *) (m :: * -> *) (a :: *) Source #
Concrete exception monad transformer
Instances
runExceptT :: (Monad m, MonadIdentity mark) => ExceptT mark e m a -> m (Except mark e a) Source #
newtype WriteOnlyT (mark :: * -> *) (w :: *) (m :: * -> *) (a :: *) Source #
Concrete write-only state monad transformer
WriteOnlyT | |
|
Instances
runWriteOnlyT :: (Monad m, MonadIdentity mark, Monoid w) => WriteOnlyT mark w m a -> m (Pair (mark w) a) Source #
newtype WriteOnceT (mark :: * -> *) (w :: *) (m :: * -> *) (a :: *) Source #
Concrete State
monad transformer
WriteOnceT | |
|
Instances
runWriteOnceT :: (Monad m, MonadIdentity mark) => WriteOnceT mark w m a -> m (Pair (mark (Maybe w)) a) Source #
newtype AppendOnlyT (mark :: * -> *) (w :: *) (m :: * -> *) (a :: *) Source #
Concrete State
monad transformer
AppendOnlyT | |
|
Instances
runAppendOnlyT :: (Monad m, MonadIdentity mark, Monoid w) => AppendOnlyT mark w m a -> m (Pair (mark w) a) Source #
Transformer Transformers
data IdentityTT (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) Source #
Concrete identity monad transformer transformer
IdentityTT | |
|
Instances
runIdentityTT :: (Monad m, MonadTrans t) => IdentityTT t m a -> t m (Identity a) Source #
data PromptTT (mark :: * -> *) (p :: * -> *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) Source #
Concrete prompt monad transformer transformer
PromptTT | |
|
Instances
runPromptTT :: (Monad m, MonadTrans t, MonadIdentity mark, Commutant mark) => Eval p m -> PromptTT mark p t m a -> t m (mark a) Source #
runOverTT :: (RunMonadTransTrans u, RunMonadTrans v, OverableT v, Monad m, MonadTrans t, MonadTrans v) => InputTT u m -> InputT v -> OverTT v u t m a -> t m (OutputTT u (OutputT v a)) Source #
class MonadTrans v => OverableT v where Source #
data OverTT (v :: (* -> *) -> * -> *) (u :: ((* -> *) -> * -> *) -> (* -> *) -> * -> *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) Source #
Concrete monad transformer transformer which applies a monad functor
Instances
newtype StateTT (mark :: * -> *) (s :: *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) Source #
Instances
runStateTT :: (MonadIdentity mark, Monad m, MonadTrans t) => mark s -> StateTT mark s t m a -> t m (Pair (mark s) a) Source #
newtype ReadOnlyTT (mark :: * -> *) (r :: *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) Source #
ReadOnlyTT | |
|
Instances
runReadOnlyTT :: (MonadIdentity mark, Commutant mark, Monad m, MonadTrans t) => mark r -> ReadOnlyTT mark r t m a -> t m (mark a) Source #
newtype WriteOnlyTT (mark :: * -> *) (w :: *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) Source #
WriteOnlyTT | |
|
Instances
runWriteOnlyTT :: (MonadIdentity mark, Monad m, MonadTrans t, Monoid w) => mark () -> WriteOnlyTT mark w t m a -> t m (Pair (mark w) a) Source #
newtype ExceptTT (mark :: * -> *) (e :: *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) Source #
ExceptTT | |
|
Instances
runExceptTT :: (MonadIdentity mark, Monad m, MonadTrans t) => mark () -> ExceptTT mark e t m a -> t m (Except mark e a) Source #
newtype HaltTT (mark :: * -> *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) Source #
Instances
runHaltTT :: (Monad m, MonadTrans t, MonadIdentity mark) => HaltTT mark t m a -> t m (Halt mark a) Source #
newtype AppendOnlyTT (mark :: * -> *) (w :: *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) Source #
AppendOnlyTT | |
|
Instances
runAppendOnlyTT :: (MonadIdentity mark, Monad m, MonadTrans t, Monoid w) => mark () -> AppendOnlyTT mark w t m a -> t m (Pair (mark w) a) Source #
newtype WriteOnceTT (mark :: * -> *) (w :: *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) Source #
WriteOnceTT | |
|
Instances
runWriteOnceTT :: (MonadIdentity mark, Monad m, MonadTrans t) => mark () -> WriteOnceTT mark w t m a -> t m (Pair (mark (Maybe w)) a) Source #
Values In Context
Monads
class Monad m => RunMonad m where Source #
Class representing monads that can be "run" inside some context
z
, producing a value in some result context f
.
Instances
RunMonad Maybe Source # | |
RunMonad Identity Source # | |
MonadIdentity mark => RunMonad (Halt mark) Source # | |
(Monoid w, MonadIdentity mark) => RunMonad (AppendOnly mark w) Source # | |
Defined in Control.FX.Monad.AppendOnly data Input (AppendOnly mark w) :: Type Source # data Output (AppendOnly mark w) a :: Type Source # run :: Input (AppendOnly mark w) -> AppendOnly mark w a -> Output (AppendOnly mark w) a Source # | |
(RunMonad m1, RunMonad m2, Central m2, Functor (Output m1)) => RunMonad (Compose m1 m2) Source # | |
MonadIdentity mark => RunMonad (Except mark e) Source # | |
(MonadIdentity mark, Commutant mark) => RunMonad (ReadOnly mark r) Source # | |
MonadIdentity mark => RunMonad (State mark s) Source # | |
MonadIdentity mark => RunMonad (WriteOnce mark w) Source # | |
(Monoid w, MonadIdentity mark) => RunMonad (WriteOnly mark w) Source # | |
Transformers
class MonadTrans t => RunMonadTrans t where Source #
Class representing monad transformers which can be run in an input context, producting a monadic value in an output context.
Instances
Transformer Transformers
class MonadTransTrans u => RunMonadTransTrans u where Source #
Class representing monad transformer transformers which can be "run" in a context z m
, producing a value in context t m (f a)
.
Instances
Equality
class EqIn (t :: * -> *) where Source #
Class representing types which can be compared for equality within an environment. Instances should satisfy the following laws:
(1) eqIn env x x === True (2) eqIn env x y === eqIn env y x (3) if (eqIn env x y) && (eqIn env y z) then eqIn env x z else True
Instances
Specialized Lifts
class (MonadTrans t, RunMonadTrans t) => LiftCatch t where Source #
Class representing monad transformers through which
catch
from MonadExcept
can be lifted. Instances
should satisfy the following law:
(1) lift (catch x h) === liftCatch catch (lift x) (lift . h)
Instances
class (MonadTransTrans u, RunMonadTransTrans u) => LiftCatchT u where Source #
Class representing monad transformer transformers through
which catch
from MonadExcept
can be lifted.
liftCatchT :: (Monad m, MonadTrans t) => (forall x. Catch e (t m) (OutputTT u x)) -> forall x. Catch e (u t m) x Source #
Instances
class (MonadTrans t, RunMonadTrans t) => LiftDraft t where Source #
Class representing monad transformers through which
draft
from MonadWriteOnly
can be lifted. Instances
should satisfy the following law:
(1) liftDraft draft (lift x) === lift (draft x)
Instances
class (MonadTransTrans u, RunMonadTransTrans u) => LiftDraftT u where Source #
Class representing monad transformer transformers through
which draft
from MonadWriteOnly
can be lifted.
liftDraftT :: (Monad m, MonadTrans t, Monoid w) => (forall x. Draft w (t m) (OutputTT u x)) -> forall x. Draft w (u t m) x Source #
Instances
class (MonadTrans t, RunMonadTrans t) => LiftLocal t where Source #
Class representing monad transformers through which local
from MonadReadOnly
can be lifted
Instances
class (MonadTransTrans u, RunMonadTransTrans u) => LiftLocalT u where Source #
Class representing monad transformer transformers through
which local
from MonadReadOnly
can be lifted.
liftLocalT :: (Monad m, MonadTrans t) => (forall x. Local r (t m) (OutputTT u x)) -> forall x. Local r (u t m) x Source #
Instances
Misc
class Functor d => Commutant d where Source #
Class representing Functor
s which "commute" with every
Applicative
in a precise sense. Instances should satisfy
the following law:
(1) commute . fmap pure === pure
This looks a lot like the sequenceA
function from Traversable
,
but that class entails a bunch of extra technology that we don't
really need.
The motivation for Commutant
comes from the observation that
most useful monads can be run to produce a "value", though in
general that value will depend on some other context. In every
case I've tried so far that context is a Commutant
functor,
which is enough to make a generic RunMonad
instance for
Compose
.
commute :: Applicative f => d (f a) -> f (d a) Source #
Instances
class (Commutant c, Monad c) => Central c Source #
Class representing monads that commute
with every other monad.
Instances should satisfy the following laws:
(1) commute . return === fmap return (2) commute . join === fmap join . commute . fmap commute (3) commute . fmap join === join . fmap commute . commute
Instances
class Bifunctor (f :: * -> * -> *) where Source #
Class representing bifunctors on the category of types. Instances should satisfy the following laws:
(1) bimap1 id === id (2) bimap1 (f . g) === bimap1 f . bimap1 g (3) bimap2 id === id (4) bimap2 (f . g) === bimap2 f . bimap2 g (5) bimap1 f . bimap2 g === bimap2 g . bimap1 f
bimap1 :: (a -> c) -> f a b -> f c b Source #
fmap
in the "first" component
bimap2 :: (b -> c) -> f a b -> f a c Source #
fmap
in the "second" component
Instances
Renaming f => Monad (Wrap f) Source # | |
Renaming f => Functor (Wrap f) Source # | |
Renaming f => Applicative (Wrap f) Source # | |
Renaming f => MonadIdentity (Wrap f) Source # | |
Defined in Control.FX.Monad.Class | |
(Renaming f, Eq a) => Eq (Wrap f a) Source # | |
(Renaming f, Semigroup a) => Semigroup (Wrap f a) Source # | |
(Renaming f, Monoid a) => Monoid (Wrap f a) Source # | |
data Pair (a :: *) (b :: *) Source #
Tuple type, isomorphic to (a,b)
. This is here so we can
have a partially applied tuple type Pair a
without syntax hacks.
Instances
Bifunctor Pair Source # | |
Eq (Context (Pair a)) Source # | |
Monoid a => Monad (Pair a) Source # | |
Functor (Pair c) Source # | |
Show (Context (Pair a)) Source # | |
Monoid a => Applicative (Pair a) Source # | |
Eq a => EqIn (Pair a) Source # | |
Commutant (Pair c) Source # | |
Defined in Control.FX.Functor.Pair | |
Monoid a => Central (Pair a) Source # | |
Defined in Control.FX.Monad.Class | |
(Eq a, Eq b) => Eq (Pair a b) Source # | |
(Show a, Show b) => Show (Pair a b) Source # | |
newtype Context (Pair a) Source # | |
Defined in Control.FX.Functor.Pair |
data LeftZero (a :: *) Source #
Type representing the left zero semigroup on a
with
an identity attached. As a functor LeftZero
is isomorphic
to Maybe
.
Instances
Functor LeftZero Source # | |
Applicative LeftZero Source # | |
EqIn LeftZero Source # | |
IsMaybe LeftZero Source # | |
Commutant LeftZero Source # | |
Defined in Control.FX.Functor.LeftZero | |
Eq (Context LeftZero) Source # | |
Eq a => Eq (LeftZero a) Source # | |
Show (Context LeftZero) Source # | |
Show a => Show (LeftZero a) Source # | |
Semigroup (LeftZero a) Source # | |
Monoid (LeftZero a) Source # | |
newtype Context LeftZero Source # | |
Defined in Control.FX.Functor.LeftZero |
data RightZero (a :: *) Source #
Type representing the right zero semigroup on a
with
an identity attached. As a functor RightZero
is isomorphic
to Maybe
.
Instances
Functor RightZero Source # | |
Applicative RightZero Source # | |
EqIn RightZero Source # | |
IsMaybe RightZero Source # | |
Commutant RightZero Source # | |
Defined in Control.FX.Functor.RightZero | |
Eq (Context RightZero) Source # | |
Eq a => Eq (RightZero a) Source # | |
Show (Context RightZero) Source # | |
Show a => Show (RightZero a) Source # | |
Semigroup (RightZero a) Source # | |
Monoid (RightZero a) Source # | |
newtype Context RightZero Source # | |
Defined in Control.FX.Functor.RightZero |
class IsMaybe (f :: * -> *) where Source #
Class representing type constructors which are isomorphic to Maybe
.
Instances should satisfy the following laws:
(1) toMaybe . fromMaybe == id (2) fromMaybe . toMaybe == id
fromMaybe :: Maybe a -> f a Source #
Convert from Maybe a
toMaybe :: f a -> Maybe a Source #
Convert to Maybe a
class (forall m. Monad m => Monad (t m)) => MonadTrans (t :: (* -> *) -> * -> *) where Source #
Class representing monad transformers
lift :: Monad m => m a -> t m a Source #
Lift a computation from the inner monad to the transformed monad
Instances
class MonadTrans t => MonadFunctor t where Source #
Class representing monad functors
Instances
class (forall t. MonadTrans t => MonadTrans (u t), forall t m. (Monad m, MonadTrans t) => Monad (u t m)) => MonadTransTrans (u :: ((* -> *) -> * -> *) -> (* -> *) -> * -> *) where Source #
Class representing monad transformer transformers
liftT :: (Monad m, MonadTrans t) => t m a -> u t m a Source #