Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class Functor t => IsStack t where
- class (Monad m, MonadIdentity mark, IsStack f) => MonadStack mark f d m where
- newtype Stack (mark :: * -> *) (f :: * -> *) (d :: *) (a :: *) = Stack {}
- runStack :: (MonadIdentity mark, IsStack f) => f d -> Stack mark f d a -> Pair (mark (f d)) a
- newtype StackT (mark :: * -> *) (f :: * -> *) (d :: *) (m :: * -> *) (a :: *) = StackT {}
- runStackT :: (Monad m, MonadIdentity mark) => mark (f d) -> StackT mark f d m a -> m (Pair (mark (f d)) a)
- newtype StackTT (mark :: * -> *) (f :: * -> *) (d :: *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) = StackTT {}
- runStackTT :: (MonadIdentity mark, Monad m, MonadTrans t, IsStack f) => mark (f d) -> StackTT mark f d t m a -> t m (Pair (mark (f d)) a)
- data family Input (m :: Type -> Type) :: Type
- data family Output (m :: Type -> Type) a :: Type
- data family InputT (t :: (Type -> Type) -> Type -> Type) :: Type
- data family OutputT (t :: (Type -> Type) -> Type -> Type) a :: Type
- data family InputTT (u :: ((Type -> Type) -> Type -> Type) -> (Type -> Type) -> Type -> Type) (m :: Type -> Type) :: Type
- data family OutputTT (u :: ((Type -> Type) -> Type -> Type) -> (Type -> Type) -> Type -> Type) a :: Type
- data family Context (t :: Type -> Type) :: Type
Structure Classes
Effect Classes
class (Monad m, MonadIdentity mark, IsStack f) => MonadStack mark f d m where Source #
Class representing monads with access to a stack
of data with type d
and stack functor f
. Instances
should satisfy the following laws:
(1) push p a >> pop p === return (Just <$> a)
Nothing
push :: Proxy f -> mark d -> m () Source #
Push a value to the stack
push :: (Monad m1, MonadTrans t1, m ~ t1 m1, MonadStack mark f d m1) => Proxy f -> mark d -> m () Source #
Push a value to the stack
pop :: Proxy f -> m (mark (Maybe d)) Source #
Try to pop a value from the stack
pop :: (Monad m1, MonadTrans t1, m ~ t1 m1, MonadStack mark f d m1) => Proxy f -> m (mark (Maybe d)) Source #
Try to pop a value from the stack
Instances
Concrete Types
Monads
newtype Stack (mark :: * -> *) (f :: * -> *) (d :: *) (a :: *) Source #
Instances
(MonadIdentity mark, IsStack f) => MonadStack mark f d (Stack mark f d) Source # | |
Eq (mark (f d)) => Eq (Input (Stack mark f d)) Source # | |
Eq (mark (f d)) => Eq (Context (Stack mark f d)) Source # | |
Show (mark (f d)) => Show (Input (Stack mark f d)) Source # | |
Show (mark (f d)) => Show (Context (Stack mark f d)) Source # | |
(Eq (mark (f d)), Eq a) => Eq (Output (Stack mark f d) a) Source # | |
(Show (mark (f d)), Show a) => Show (Output (Stack mark f d) a) Source # | |
MonadIdentity mark => Monad (Stack mark f d) Source # | |
MonadIdentity mark => Functor (Stack mark f d) Source # | |
MonadIdentity mark => Applicative (Stack mark f d) Source # | |
Defined in Control.FX.Monad.Data.Stack pure :: a -> Stack mark f d a # (<*>) :: Stack mark f d (a -> b) -> Stack mark f d a -> Stack mark f d b # liftA2 :: (a -> b -> c) -> Stack mark f d a -> Stack mark f d b -> Stack mark f d c # (*>) :: Stack mark f d a -> Stack mark f d b -> Stack mark f d b # (<*) :: Stack mark f d a -> Stack mark f d b -> Stack mark f d a # | |
MonadIdentity mark => RunMonad (Stack mark f d) Source # | |
(Eq (f d), MonadIdentity mark) => EqIn (Stack mark f d) Source # | |
(Typeable f, Typeable d, Typeable a, Typeable mark) => Show (Stack mark f d a) Source # | |
data Output (Stack mark f d) a Source # | |
Defined in Control.FX.Monad.Data.Stack | |
data Input (Stack mark f d) Source # | |
Defined in Control.FX.Monad.Data.Stack | |
data Context (Stack mark f d) Source # | |
Defined in Control.FX.Monad.Data.Stack |
runStack :: (MonadIdentity mark, IsStack f) => f d -> Stack mark f d a -> Pair (mark (f d)) a Source #
Transformers
newtype StackT (mark :: * -> *) (f :: * -> *) (d :: *) (m :: * -> *) (a :: *) Source #
Instances
runStackT :: (Monad m, MonadIdentity mark) => mark (f d) -> StackT mark f d m a -> m (Pair (mark (f d)) a) Source #
Transformer Transformers
newtype StackTT (mark :: * -> *) (f :: * -> *) (d :: *) (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) Source #
Instances
runStackTT :: (MonadIdentity mark, Monad m, MonadTrans t, IsStack f) => mark (f d) -> StackTT mark f d t m a -> t m (Pair (mark (f d)) a) Source #
Values in Context
Monads
data family Input (m :: Type -> Type) :: Type #
Instances
data family Output (m :: Type -> Type) a :: Type #
Instances
Eq a => Eq (Output Maybe a) | |
(Eq (mark w), Eq a) => Eq (Output (WriteOnly mark w) a) | |
(Eq (mark (Maybe w)), Eq a) => Eq (Output (WriteOnce mark w) a) | |
(Eq (mark s), Eq a) => Eq (Output (State mark s) a) | |
Eq (mark a) => Eq (Output (ReadOnly mark r) a) | |
Eq a => Eq (Output Identity a) | |
Eq a => Eq (Output (Halt mark) a) | |
(Eq e, Eq a) => Eq (Output (Except mark e) a) | |
(Eq (Output m1 (Output m2 a)), Eq (Output m2 a)) => Eq (Output (Compose m1 m2) a) | |
(Eq (mark w), Eq a) => Eq (Output (AppendOnly mark w) a) | |
Defined in Control.FX.Monad.AppendOnly (==) :: Output (AppendOnly mark w) a -> Output (AppendOnly mark w) a -> Bool # (/=) :: Output (AppendOnly mark w) a -> Output (AppendOnly mark w) a -> Bool # | |
(Eq (mark (f d)), Eq a) => Eq (Output (Stack mark f d) a) Source # | |
Show a => Show (Output Maybe a) | |
(Show (mark w), Show a) => Show (Output (WriteOnly mark w) a) | |
(Show (mark (Maybe w)), Show a) => Show (Output (WriteOnce mark w) a) | |
(Show (mark s), Show a) => Show (Output (State mark s) a) | |
Show (mark a) => Show (Output (ReadOnly mark r) a) | |
Show a => Show (Output Identity a) | |
Show a => Show (Output (Halt mark) a) | |
(Show e, Show a) => Show (Output (Except mark e) a) | |
(Show (Output m1 (Output m2 a)), Show (Output m2 a)) => Show (Output (Compose m1 m2) a) | |
(Show (mark w), Show a) => Show (Output (AppendOnly mark w) a) | |
Defined in Control.FX.Monad.AppendOnly | |
(Show (mark (f d)), Show a) => Show (Output (Stack mark f d) a) Source # | |
data Output Maybe a | |
Defined in Control.FX.Monad.Class | |
data Output Identity a | |
Defined in Control.FX.Monad.Identity | |
data Output (Halt mark) a | |
newtype Output (WriteOnly mark w) a | |
Defined in Control.FX.Monad.WriteOnly | |
newtype Output (WriteOnce mark w) a | |
Defined in Control.FX.Monad.WriteOnce | |
data Output (State mark s) a | |
Defined in Control.FX.Monad.State | |
newtype Output (ReadOnly mark r) a | |
Defined in Control.FX.Monad.ReadOnly | |
newtype Output (Except mark e) a | |
Defined in Control.FX.Monad.Except | |
newtype Output (Compose m1 m2) a | |
Defined in Control.FX.Monad.Compose | |
newtype Output (AppendOnly mark w) a | |
Defined in Control.FX.Monad.AppendOnly | |
data Output (Stack mark f d) a Source # | |
Defined in Control.FX.Monad.Data.Stack |
Transformers
data family InputT (t :: (Type -> Type) -> Type -> Type) :: Type #
Instances
data family OutputT (t :: (Type -> Type) -> Type -> Type) a :: Type #
Instances
Transformer Transformers
data family InputTT (u :: ((Type -> Type) -> Type -> Type) -> (Type -> Type) -> Type -> Type) (m :: Type -> Type) :: Type #
Instances
data family OutputTT (u :: ((Type -> Type) -> Type -> Type) -> (Type -> Type) -> Type -> Type) a :: Type #
Instances
Equality
data family Context (t :: Type -> Type) :: Type #