Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class Functor f => Cotraversable f where
- collect :: Functor g => (a -> f b) -> g a -> f (g b)
- cosequence :: Functor g => g (f a) -> f (g a)
- cotraverse :: Functor g => (g a -> b) -> g (f a) -> f b
Documentation
class Functor f => Cotraversable f where Source #
Laws:
cosequence
=collect
id
cosequence
.cosequence
=id
collect
f =cosequence
.fmap
ffmap
f =runIdentity
.collect
(Identity
. f)fmap
distribute
.collect
f =getCompose
.collect
(Compose
. f)
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 # | |
Cotraversable (Proxy :: Type -> Type) Source # | |
Cotraversable f => Cotraversable (Cofree f) Source # | |
Cotraversable f => Cotraversable (Reverse f) Source # | |
Cotraversable f => Cotraversable (IdentityT f) Source # | |
Cotraversable f => Cotraversable (Backwards f) Source # | |
Bicotraversable p => Cotraversable (Join p) Source # | |
Cotraversable ((->) r :: Type -> Type) Source # | |
Defined in Data.Cotraversable | |
(Cotraversable f, Cotraversable g) => Cotraversable (Product f g) Source # | |
Cotraversable f => Cotraversable (ReaderT r f) Source # | |
(Cotraversable f, Cotraversable g) => Cotraversable (Compose f g) Source # | |