License | BSD-style (see the file LICENSE) |
---|---|
Maintainer | sjoerd@w3future.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe |
Language | Haskell2010 |
A cofree functor is right adjoint to a forgetful functor. In this package the forgetful functor forgets class constraints.
Compared to Data.Functor.Cofree
we're going up a level.
These free functors go between categories of functors and the natural
transformations between them.
Synopsis
- type (:~>) f g = forall b. f b -> g b
- data HCofree c g a where
- counit :: HCofree c g :~> g
- leftAdjunct :: c f => (f :~> g) -> f :~> HCofree c g
- unit :: c g => g :~> HCofree c g
- rightAdjunct :: (f :~> HCofree c g) -> f :~> g
- transform :: (forall r. c r => (r :~> f) -> r :~> g) -> HCofree c f :~> HCofree c g
- hfmap :: (f :~> g) -> HCofree c f :~> HCofree c g
- hextend :: (HCofree c f :~> g) -> HCofree c f :~> HCofree c g
- liftCofree :: c f => f a -> HCofree c f a
- lowerCofree :: HCofree c f a -> f a
- convert :: (c (t f), Comonad f, ComonadTrans t) => t f a -> HCofree c f a
- coiter :: c Identity => (forall b. b -> f b) -> a -> HCofree c f a
- unwrap :: HCofree Comonad g a -> g (HCofree Comonad g a)
Documentation
data HCofree c g a where Source #
The higher order cofree functor for constraint c
.
Instances
(forall (x :: Type -> Type). c x => Functor x) => Functor (HCofree c g) Source # | |
(forall (x :: Type -> Type). c x => Foldable x) => Foldable (HCofree c g) Source # | |
Defined in Data.Functor.HCofree fold :: Monoid m => HCofree c g m -> m # foldMap :: Monoid m => (a -> m) -> HCofree c g a -> m # foldr :: (a -> b -> b) -> b -> HCofree c g a -> b # foldr' :: (a -> b -> b) -> b -> HCofree c g a -> b # foldl :: (b -> a -> b) -> b -> HCofree c g a -> b # foldl' :: (b -> a -> b) -> b -> HCofree c g a -> b # foldr1 :: (a -> a -> a) -> HCofree c g a -> a # foldl1 :: (a -> a -> a) -> HCofree c g a -> a # toList :: HCofree c g a -> [a] # null :: HCofree c g a -> Bool # length :: HCofree c g a -> Int # elem :: Eq a => a -> HCofree c g a -> Bool # maximum :: Ord a => HCofree c g a -> a # minimum :: Ord a => HCofree c g a -> a # | |
(forall (x :: Type -> Type). c x => Traversable x) => Traversable (HCofree c g) Source # | |
Defined in Data.Functor.HCofree | |
(forall (x :: Type -> Type). c x => Comonad x) => Comonad (HCofree c g) Source # | The cofree comonad of a functor. |
liftCofree :: c f => f a -> HCofree c f a Source #
lowerCofree :: HCofree c f a -> f a Source #