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

Safe HaskellNone
LanguageHaskell2010

Data.Cotraversable

Documentation

class Functor f => Cotraversable f where Source #

Methods

collect :: Functor g => (a -> f b) -> g a -> f (g b) Source #

cosequence :: Functor g => g (f a) -> f (g a) Source #

cotraverse :: Functor g => (g a -> b) -> g (f a) -> f b Source #

Instances

Cotraversable Identity Source # 

Methods

collect :: Functor g => (a -> Identity b) -> g a -> Identity (g b) Source #

cosequence :: Functor g => g (Identity a) -> Identity (g a) Source #

cotraverse :: Functor g => (g a -> b) -> g (Identity a) -> Identity b Source #

Cotraversable (Proxy *) Source # 

Methods

collect :: Functor g => (a -> Proxy * b) -> g a -> Proxy * (g b) Source #

cosequence :: Functor g => g (Proxy * a) -> Proxy * (g a) Source #

cotraverse :: Functor g => (g a -> b) -> g (Proxy * a) -> Proxy * b Source #

Cotraversable f => Cotraversable (Cofree f) Source # 

Methods

collect :: Functor g => (a -> Cofree f b) -> g a -> Cofree f (g b) Source #

cosequence :: Functor g => g (Cofree f a) -> Cofree f (g a) Source #

cotraverse :: Functor g => (g a -> b) -> g (Cofree f a) -> Cofree f b Source #

Cotraversable f => Cotraversable (Reverse * f) Source # 

Methods

collect :: Functor g => (a -> Reverse * f b) -> g a -> Reverse * f (g b) Source #

cosequence :: Functor g => g (Reverse * f a) -> Reverse * f (g a) Source #

cotraverse :: Functor g => (g a -> b) -> g (Reverse * f a) -> Reverse * f b Source #

Cotraversable f => Cotraversable (IdentityT * f) Source # 

Methods

collect :: Functor g => (a -> IdentityT * f b) -> g a -> IdentityT * f (g b) Source #

cosequence :: Functor g => g (IdentityT * f a) -> IdentityT * f (g a) Source #

cotraverse :: Functor g => (g a -> b) -> g (IdentityT * f a) -> IdentityT * f b Source #

Cotraversable f => Cotraversable (Backwards * f) Source # 

Methods

collect :: Functor g => (a -> Backwards * f b) -> g a -> Backwards * f (g b) Source #

cosequence :: Functor g => g (Backwards * f a) -> Backwards * f (g a) Source #

cotraverse :: Functor g => (g a -> b) -> g (Backwards * f a) -> Backwards * f b Source #

Bicotraversable p => Cotraversable (Join * p) Source # 

Methods

collect :: Functor g => (a -> Join * p b) -> g a -> Join * p (g b) Source #

cosequence :: Functor g => g (Join * p a) -> Join * p (g a) Source #

cotraverse :: Functor g => (g a -> b) -> g (Join * p a) -> Join * p b Source #

Cotraversable ((->) LiftedRep LiftedRep r) Source # 

Methods

collect :: Functor g => (a -> (LiftedRep -> LiftedRep) r b) -> g a -> (LiftedRep -> LiftedRep) r (g b) Source #

cosequence :: Functor g => g ((LiftedRep -> LiftedRep) r a) -> (LiftedRep -> LiftedRep) r (g a) Source #

cotraverse :: Functor g => (g a -> b) -> g ((LiftedRep -> LiftedRep) r a) -> (LiftedRep -> LiftedRep) r b Source #

(Cotraversable f, Cotraversable g) => Cotraversable (Product * f g) Source # 

Methods

collect :: Functor g => (a -> Product * f g b) -> g a -> Product * f g (g b) Source #

cosequence :: Functor g => g (Product * f g a) -> Product * f g (g a) Source #

cotraverse :: Functor g => (g a -> b) -> g (Product * f g a) -> Product * f g b Source #

Cotraversable f => Cotraversable (ReaderT * r f) Source # 

Methods

collect :: Functor g => (a -> ReaderT * r f b) -> g a -> ReaderT * r f (g b) Source #

cosequence :: Functor g => g (ReaderT * r f a) -> ReaderT * r f (g a) Source #

cotraverse :: Functor g => (g a -> b) -> g (ReaderT * r f a) -> ReaderT * r f b Source #

(Cotraversable f, Cotraversable g) => Cotraversable (Compose * * f g) Source # 

Methods

collect :: Functor g => (a -> Compose * * f g b) -> g a -> Compose * * f g (g b) Source #

cosequence :: Functor g => g (Compose * * f g a) -> Compose * * f g (g a) Source #

cotraverse :: Functor g => (g a -> b) -> g (Compose * * f g a) -> Compose * * f g b Source #