License | BSD-style (see the file LICENSE) |
---|---|
Maintainer | sjoerd@w3future.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
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
- deriveHCofreeInstance :: Name -> Q [Dec]
- 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
c ~=> Functor => Functor (HCofree c a) Source # | |
c ~=> Foldable => Foldable (HCofree c a) Source # | |
Defined in Data.Functor.HCofree fold :: Monoid m => HCofree c a m -> m # foldMap :: Monoid m => (a0 -> m) -> HCofree c a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> HCofree c a a0 -> m # foldr :: (a0 -> b -> b) -> b -> HCofree c a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> HCofree c a a0 -> b # foldl :: (b -> a0 -> b) -> b -> HCofree c a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> HCofree c a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> HCofree c a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> HCofree c a a0 -> a0 # toList :: HCofree c a a0 -> [a0] # null :: HCofree c a a0 -> Bool # length :: HCofree c a a0 -> Int # elem :: Eq a0 => a0 -> HCofree c a a0 -> Bool # maximum :: Ord a0 => HCofree c a a0 -> a0 # minimum :: Ord a0 => HCofree c a a0 -> a0 # | |
c ~=> Traversable => Traversable (HCofree c a) Source # | |
Defined in Data.Functor.HCofree | |
c ~=> Comonad => 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 #