hs-functors-0.1.1.0: Functors from products of Haskell and its dual to Haskell

Safe HaskellNone
LanguageHaskell2010

Control.Comonad

Documentation

class Functor ɯ => Comonad ɯ where Source #

Minimal complete definition

copure

Methods

copure :: ɯ a -> a Source #

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

(<<=) :: (ɯ a -> b) -> ɯ a -> ɯ b infixr 1 Source #

Instances

Comonad Identity Source # 

Methods

copure :: Identity a -> a Source #

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

(<<=) :: (Identity a -> b) -> Identity a -> Identity b Source #

Comonad NonEmpty Source # 

Methods

copure :: NonEmpty a -> a Source #

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

(<<=) :: (NonEmpty a -> b) -> NonEmpty a -> NonEmpty b Source #

(Semigroup m, Monoid m) => Comonad ((->) m) Source # 

Methods

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

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

(<<=) :: ((m -> a) -> b) -> (m -> a) -> m -> b Source #

Comonad ((,) a) Source # 

Methods

copure :: (a, a) -> a Source #

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

(<<=) :: ((a, a) -> b) -> (a, a) -> (a, b) Source #

Comonad (Arg a) Source # 

Methods

copure :: Arg a a -> a Source #

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

(<<=) :: (Arg a a -> b) -> Arg a a -> Arg a b Source #

Comonad ɯ => Comonad (IdentityT * ɯ) Source # 

Methods

copure :: IdentityT * ɯ a -> a Source #

cut :: IdentityT * ɯ a -> IdentityT * ɯ (IdentityT * ɯ a) Source #

(<<=) :: (IdentityT * ɯ a -> b) -> IdentityT * ɯ a -> IdentityT * ɯ b Source #

(=>>) :: Comonad ɯ => ɯ a -> (ɯ a -> b) -> ɯ b infixl 1 Source #

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

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

wfix :: Comonad ɯ => (ɯ a -> a) -> ɯ a Source #

newtype Cokleisli ɯ a b Source #

Constructors

Cokleisli 

Fields

Instances

(Cotraversable f, Functor ɯ) => Closed f (Cokleisli * ɯ) Source # 

Methods

closed :: Cokleisli * ɯ a b -> Cokleisli * ɯ (f a) (f b) Source #

Functor f => Costrong Either (Cokleisli * f) Source # 

Methods

costrongL :: Cokleisli * f (Either a c) (Either b c) -> Cokleisli * f a b Source #

costrongR :: Cokleisli * f (Either a b) (Either a c) -> Cokleisli * f b c Source #

Comonad ɯ => Strong Either (Cokleisli * ɯ) Source # 

Methods

strong :: Cokleisli * ɯ a₁ b₁ -> Cokleisli * ɯ a₂ b₂ -> Cokleisli * ɯ (Either a₁ a₂) (Either b₁ b₂) Source #

Comonad ɯ => Category * (Cokleisli * ɯ) Source # 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

Functor f => Profunctor (Cokleisli * f) Source # 

Methods

dimap :: (a -> b) -> (c -> d) -> Cokleisli * f b c -> Cokleisli * f a d Source #

lmap :: (a -> b) -> Cokleisli * f b c -> Cokleisli * f a c Source #

rmap :: (b -> c) -> Cokleisli * f a b -> Cokleisli * f a c Source #

Monad (Cokleisli k ɯ a) Source # 

Methods

(>>=) :: Cokleisli k ɯ a a -> (a -> Cokleisli k ɯ a b) -> Cokleisli k ɯ a b #

(>>) :: Cokleisli k ɯ a a -> Cokleisli k ɯ a b -> Cokleisli k ɯ a b #

return :: a -> Cokleisli k ɯ a a #

fail :: String -> Cokleisli k ɯ a a #

Functor (Cokleisli k ɯ a) Source # 

Methods

fmap :: (a -> b) -> Cokleisli k ɯ a a -> Cokleisli k ɯ a b #

(<$) :: a -> Cokleisli k ɯ a b -> Cokleisli k ɯ a a #

Applicative (Cokleisli k ɯ a) Source # 

Methods

pure :: a -> Cokleisli k ɯ a a #

(<*>) :: Cokleisli k ɯ a (a -> b) -> Cokleisli k ɯ a a -> Cokleisli k ɯ a b #

(*>) :: Cokleisli k ɯ a a -> Cokleisli k ɯ a b -> Cokleisli k ɯ a b #

(<*) :: Cokleisli k ɯ a a -> Cokleisli k ɯ a b -> Cokleisli k ɯ a a #