category-0.2.4.1: Categorical types and classes

Safe HaskellNone
LanguageHaskell2010

Control.Categorical.Monad

Documentation

class Endofunctor s m => Monad s m where Source #

Minimal complete definition

unit

Methods

unit :: a `s` m a Source #

join :: m (m a) `s` m a Source #

bind :: (a `s` m b) -> m a `s` m b Source #

Instances
Monad m => Monad ((->) :: Type -> Type -> Type) (m :: Type -> Type) Source # 
Instance details

Defined in Control.Categorical.Monad

Methods

unit :: a -> m a Source #

join :: m (m a) -> m a Source #

bind :: (a -> m b) -> m a -> m b Source #

Monad ((->) :: Type -> Type -> Type) f => Monad ((->) :: Type -> Type -> Type) (IdentityT f :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

unit :: a -> IdentityT f a Source #

join :: IdentityT f (IdentityT f a) -> IdentityT f a Source #

bind :: (a -> IdentityT f b) -> IdentityT f a -> IdentityT f b Source #

Monad ((->) :: Type -> Type -> Type) f => Monad ((->) :: Type -> Type -> Type) (WriterT Either w f :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Writer

Methods

unit :: a -> WriterT Either w f a Source #

join :: WriterT Either w f (WriterT Either w f a) -> WriterT Either w f a Source #

bind :: (a -> WriterT Either w f b) -> WriterT Either w f a -> WriterT Either w f b Source #

(Monoid w, Monad ((->) :: Type -> Type -> Type) f) => Monad ((->) :: Type -> Type -> Type) (WriterT (,) w f :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Writer

Methods

unit :: a -> WriterT (,) w f a Source #

join :: WriterT (,) w f (WriterT (,) w f a) -> WriterT (,) w f a Source #

bind :: (a -> WriterT (,) w f b) -> WriterT (,) w f a -> WriterT (,) w f b Source #

Monad ((->) :: Type -> Type -> Type) f => Monad ((->) :: Type -> Type -> Type) (ReaderT ((->) :: Type -> Type -> Type) r f :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Reader

Methods

unit :: a -> ReaderT (->) r f a Source #

join :: ReaderT (->) r f (ReaderT (->) r f a) -> ReaderT (->) r f a Source #

bind :: (a -> ReaderT (->) r f b) -> ReaderT (->) r f a -> ReaderT (->) r f b Source #

Comonad ((->) :: Type -> Type -> Type) ɯ => Monad (NT (Cokleisli ((->) :: Type -> Type -> Type) ɯ) :: (k -> Type) -> (k -> Type) -> Type) (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

unit :: NT (Cokleisli (->) ɯ) a (IdentityT a) Source #

join :: NT (Cokleisli (->) ɯ) (IdentityT (IdentityT a)) (IdentityT a) Source #

bind :: NT (Cokleisli (->) ɯ) a (IdentityT b) -> NT (Cokleisli (->) ɯ) (IdentityT a) (IdentityT b) Source #

Monad ((->) :: Type -> Type -> Type) m => Monad (NT (Kleisli ((->) :: Type -> Type -> Type) m) :: (k -> Type) -> (k -> Type) -> Type) (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

unit :: NT (Kleisli (->) m) a (IdentityT a) Source #

join :: NT (Kleisli (->) m) (IdentityT (IdentityT a)) (IdentityT a) Source #

bind :: NT (Kleisli (->) m) a (IdentityT b) -> NT (Kleisli (->) m) (IdentityT a) (IdentityT b) Source #

Monad (NT ((->) :: Type -> Type -> Type) :: (k -> Type) -> (k -> Type) -> Type) (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

unit :: NT (->) a (IdentityT a) Source #

join :: NT (->) (IdentityT (IdentityT a)) (IdentityT a) Source #

bind :: NT (->) a (IdentityT b) -> NT (->) (IdentityT a) (IdentityT b) Source #

Monad ((->) :: Type -> Type -> Type) (s r) => Monad (NT ((->) :: Type -> Type -> Type) :: (k1 -> Type) -> (k1 -> Type) -> Type) (ReaderT s r :: (k1 -> Type) -> k1 -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Reader

Methods

unit :: NT (->) a (ReaderT s r a) Source #

join :: NT (->) (ReaderT s r (ReaderT s r a)) (ReaderT s r a) Source #

bind :: NT (->) a (ReaderT s r b) -> NT (->) (ReaderT s r a) (ReaderT s r b) Source #

(<=<) :: Monad s m => (b `s` m c) -> (a `s` m b) -> a `s` m c infixr 1 Source #

(>=>) :: Monad s m => (a `s` m b) -> (b `s` m c) -> a `s` m c infixr 1 Source #

newtype Kleisli s m a b Source #

Constructors

Kleisli 

Fields

Instances
Monad s m => Functor (Kleisli s m :: β -> β -> Type) (s :: β -> β -> Type) (m :: β -> β) Source # 
Instance details

Defined in Control.Categorical.Monad

Methods

map :: Kleisli s m a b -> s (m a) (m b) Source #

Functor s t m => Functor (s :: k2 -> k2 -> Type) ((->) :: Type -> Type -> Type) (Kleisli t m a :: k2 -> Type) Source # 
Instance details

Defined in Control.Categorical.Monad

Methods

map :: s a0 b -> Kleisli t m a a0 -> Kleisli t m a b Source #

(Functor s (Kleisli ((->) :: Type -> Type -> Type) m) f, Endofunctor ((->) :: Type -> Type -> Type) m) => Functor (s :: k -> k -> Type) (Kleisli ((->) :: Type -> Type -> Type) m :: Type -> Type -> Type) (IdentityT f :: k -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

map :: s a b -> Kleisli (->) m (IdentityT f a) (IdentityT f b) Source #

Category s => Functor (Dual s :: k2 -> k2 -> Type) (NT ((->) :: Type -> Type -> Type) :: (k1 -> Type) -> (k1 -> Type) -> Type) (Kleisli s m :: k2 -> k1 -> Type) Source # 
Instance details

Defined in Control.Categorical.Monad

Methods

map :: Dual s a b -> NT (->) (Kleisli s m a) (Kleisli s m b) Source #

Monad s m => Category (Kleisli s m :: k -> k -> Type) Source # 
Instance details

Defined in Control.Categorical.Monad

Methods

id :: Kleisli s m a a #

(.) :: Kleisli s m b c -> Kleisli s m a b -> Kleisli s m a c #

Monad ((->) :: Type -> Type -> Type) m => Functor (NT (Kleisli ((->) :: Type -> Type -> Type) m) :: (k -> Type) -> (k -> Type) -> Type) (NT (Kleisli ((->) :: Type -> Type -> Type) m) :: (k -> Type) -> (k -> Type) -> Type) (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

map :: NT (Kleisli (->) m) a b -> NT (Kleisli (->) m) (IdentityT a) (IdentityT b) Source #

Monad ((->) :: Type -> Type -> Type) m => Comonad (NT (Kleisli ((->) :: Type -> Type -> Type) m) :: (k -> Type) -> (k -> Type) -> Type) (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

counit :: NT (Kleisli (->) m) (IdentityT a) a Source #

cut :: NT (Kleisli (->) m) (IdentityT a) (IdentityT (IdentityT a)) Source #

cobind :: NT (Kleisli (->) m) (IdentityT a) b -> NT (Kleisli (->) m) (IdentityT a) (IdentityT b) Source #

Monad ((->) :: Type -> Type -> Type) m => Monad (NT (Kleisli ((->) :: Type -> Type -> Type) m) :: (k -> Type) -> (k -> Type) -> Type) (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

unit :: NT (Kleisli (->) m) a (IdentityT a) Source #

join :: NT (Kleisli (->) m) (IdentityT (IdentityT a)) (IdentityT a) Source #

bind :: NT (Kleisli (->) m) a (IdentityT b) -> NT (Kleisli (->) m) (IdentityT a) (IdentityT b) Source #

class Endofunctor s ɯ => Comonad s ɯ where Source #

Minimal complete definition

counit

Methods

counit :: ɯ a `s` a Source #

cut :: ɯ a `s` ɯ (ɯ a) Source #

cobind :: (ɯ a `s` b) -> ɯ a `s` ɯ b Source #

Instances
Comonad ((->) :: Type -> Type -> Type) Identity Source # 
Instance details

Defined in Control.Categorical.Monad

Methods

counit :: Identity a -> a Source #

cut :: Identity a -> Identity (Identity a) Source #

cobind :: (Identity a -> b) -> Identity a -> Identity b Source #

Comonad ((->) :: Type -> Type -> Type) NonEmpty Source # 
Instance details

Defined in Control.Categorical.Monad

Methods

counit :: NonEmpty a -> a Source #

cut :: NonEmpty a -> NonEmpty (NonEmpty a) Source #

cobind :: (NonEmpty a -> b) -> NonEmpty a -> NonEmpty b Source #

Comonad ((->) :: Type -> Type -> Type) ((,) a :: Type -> Type) Source # 
Instance details

Defined in Control.Categorical.Monad

Methods

counit :: (a, a0) -> a0 Source #

cut :: (a, a0) -> (a, (a, a0)) Source #

cobind :: ((a, a0) -> b) -> (a, a0) -> (a, b) Source #

Comonad ((->) :: Type -> Type -> Type) (Arg a :: Type -> Type) Source # 
Instance details

Defined in Control.Categorical.Monad

Methods

counit :: Arg a a0 -> a0 Source #

cut :: Arg a a0 -> Arg a (Arg a a0) Source #

cobind :: (Arg a a0 -> b) -> Arg a a0 -> Arg a b Source #

Comonad ((->) :: Type -> Type -> Type) f => Comonad ((->) :: Type -> Type -> Type) (IdentityT f :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

counit :: IdentityT f a -> a Source #

cut :: IdentityT f a -> IdentityT f (IdentityT f a) Source #

cobind :: (IdentityT f a -> b) -> IdentityT f a -> IdentityT f b Source #

Monoid m => Comonad ((->) :: Type -> Type -> Type) ((->) m :: Type -> Type) Source # 
Instance details

Defined in Control.Categorical.Monad

Methods

counit :: (m -> a) -> a Source #

cut :: (m -> a) -> (m -> (m -> a)) Source #

cobind :: ((m -> a) -> b) -> (m -> a) -> (m -> b) Source #

(Comonad ((->) :: Type -> Type -> Type) (p w), Comonad ((->) :: Type -> Type -> Type) f) => Comonad ((->) :: Type -> Type -> Type) (WriterT p w f :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Writer

Methods

counit :: WriterT p w f a -> a Source #

cut :: WriterT p w f a -> WriterT p w f (WriterT p w f a) Source #

cobind :: (WriterT p w f a -> b) -> WriterT p w f a -> WriterT p w f b Source #

Comonad ((->) :: Type -> Type -> Type) ɯ => Comonad ((->) :: Type -> Type -> Type) (ReaderT (,) r ɯ :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Reader

Methods

counit :: ReaderT (,) r ɯ a -> a Source #

cut :: ReaderT (,) r ɯ a -> ReaderT (,) r ɯ (ReaderT (,) r ɯ a) Source #

cobind :: (ReaderT (,) r ɯ a -> b) -> ReaderT (,) r ɯ a -> ReaderT (,) r ɯ b Source #

Monad ((->) :: Type -> Type -> Type) m => Comonad (NT (Kleisli ((->) :: Type -> Type -> Type) m) :: (k -> Type) -> (k -> Type) -> Type) (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

counit :: NT (Kleisli (->) m) (IdentityT a) a Source #

cut :: NT (Kleisli (->) m) (IdentityT a) (IdentityT (IdentityT a)) Source #

cobind :: NT (Kleisli (->) m) (IdentityT a) b -> NT (Kleisli (->) m) (IdentityT a) (IdentityT b) Source #

Comonad ((->) :: Type -> Type -> Type) ɯ => Comonad (NT (Cokleisli ((->) :: Type -> Type -> Type) ɯ) :: (k -> Type) -> (k -> Type) -> Type) (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

counit :: NT (Cokleisli (->) ɯ) (IdentityT a) a Source #

cut :: NT (Cokleisli (->) ɯ) (IdentityT a) (IdentityT (IdentityT a)) Source #

cobind :: NT (Cokleisli (->) ɯ) (IdentityT a) b -> NT (Cokleisli (->) ɯ) (IdentityT a) (IdentityT b) Source #

Comonad (NT ((->) :: Type -> Type -> Type) :: (k -> Type) -> (k -> Type) -> Type) (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

counit :: NT (->) (IdentityT a) a Source #

cut :: NT (->) (IdentityT a) (IdentityT (IdentityT a)) Source #

cobind :: NT (->) (IdentityT a) b -> NT (->) (IdentityT a) (IdentityT b) Source #

Comonad ((->) :: Type -> Type -> Type) (s r) => Comonad (NT ((->) :: Type -> Type -> Type) :: (k1 -> Type) -> (k1 -> Type) -> Type) (ReaderT s r :: (k1 -> Type) -> k1 -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Reader

Methods

counit :: NT (->) (ReaderT s r a) a Source #

cut :: NT (->) (ReaderT s r a) (ReaderT s r (ReaderT s r a)) Source #

cobind :: NT (->) (ReaderT s r a) b -> NT (->) (ReaderT s r a) (ReaderT s r b) Source #

(=<=) :: Comonad s ɯ => (ɯ b `s` c) -> (ɯ a `s` b) -> ɯ a `s` c infixr 1 Source #

(=>=) :: Comonad s ɯ => (ɯ a `s` b) -> (ɯ b `s` c) -> ɯ a `s` c infixr 1 Source #

newtype Cokleisli s ɯ a b Source #

Constructors

Cokleisli 

Fields

Instances
Comonad s ɯ => Functor (Cokleisli s ɯ :: β -> β -> Type) (s :: β -> β -> Type) (ɯ :: β -> β) Source # 
Instance details

Defined in Control.Categorical.Monad

Methods

map :: Cokleisli s ɯ a b -> s (ɯ a) (ɯ b) Source #

Category s => Functor (s :: k2 -> k2 -> Type) ((->) :: Type -> Type -> Type) (Cokleisli s ɯ a :: k2 -> Type) Source # 
Instance details

Defined in Control.Categorical.Monad

Methods

map :: s a0 b -> Cokleisli s ɯ a a0 -> Cokleisli s ɯ a b Source #

(Functor s (Cokleisli ((->) :: Type -> Type -> Type) ɯ) f, Endofunctor ((->) :: Type -> Type -> Type) ɯ) => Functor (s :: k -> k -> Type) (Cokleisli ((->) :: Type -> Type -> Type) ɯ :: Type -> Type -> Type) (IdentityT f :: k -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

map :: s a b -> Cokleisli (->) ɯ (IdentityT f a) (IdentityT f b) Source #

Functor s t ɯ => Functor (Dual s :: k2 -> k2 -> Type) (NT ((->) :: Type -> Type -> Type) :: (k1 -> Type) -> (k1 -> Type) -> Type) (Cokleisli t ɯ :: k2 -> k1 -> Type) Source # 
Instance details

Defined in Control.Categorical.Monad

Methods

map :: Dual s a b -> NT (->) (Cokleisli t ɯ a) (Cokleisli t ɯ b) Source #

Comonad s ɯ => Category (Cokleisli s ɯ :: k -> k -> Type) Source # 
Instance details

Defined in Control.Categorical.Monad

Methods

id :: Cokleisli s ɯ a a #

(.) :: Cokleisli s ɯ b c -> Cokleisli s ɯ a b -> Cokleisli s ɯ a c #

Comonad ((->) :: Type -> Type -> Type) ɯ => Functor (NT (Cokleisli ((->) :: Type -> Type -> Type) ɯ) :: (k -> Type) -> (k -> Type) -> Type) (NT (Cokleisli ((->) :: Type -> Type -> Type) ɯ) :: (k -> Type) -> (k -> Type) -> Type) (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

map :: NT (Cokleisli (->) ɯ) a b -> NT (Cokleisli (->) ɯ) (IdentityT a) (IdentityT b) Source #

Comonad ((->) :: Type -> Type -> Type) ɯ => Comonad (NT (Cokleisli ((->) :: Type -> Type -> Type) ɯ) :: (k -> Type) -> (k -> Type) -> Type) (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

counit :: NT (Cokleisli (->) ɯ) (IdentityT a) a Source #

cut :: NT (Cokleisli (->) ɯ) (IdentityT a) (IdentityT (IdentityT a)) Source #

cobind :: NT (Cokleisli (->) ɯ) (IdentityT a) b -> NT (Cokleisli (->) ɯ) (IdentityT a) (IdentityT b) Source #

Comonad ((->) :: Type -> Type -> Type) ɯ => Monad (NT (Cokleisli ((->) :: Type -> Type -> Type) ɯ) :: (k -> Type) -> (k -> Type) -> Type) (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.Functor.Trans.Identity

Methods

unit :: NT (Cokleisli (->) ɯ) a (IdentityT a) Source #

join :: NT (Cokleisli (->) ɯ) (IdentityT (IdentityT a)) (IdentityT a) Source #

bind :: NT (Cokleisli (->) ɯ) a (IdentityT b) -> NT (Cokleisli (->) ɯ) (IdentityT a) (IdentityT b) Source #