| License | BSD-style (see the file LICENSE) |
|---|---|
| Maintainer | sjoerd@w3future.com |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Data.Functor.HFree
Description
A free functor is left adjoint to a forgetful functor. In this package the forgetful functor forgets class constraints.
Compared to Data.Functor.Free we're going up a level.
These free functors go between categories of functors and the natural
transformations between them.
- type (:~>) f g = forall b. f b -> g b
- newtype HFree c f a = HFree {}
- unit :: f :~> HFree c f
- rightAdjunct :: (c g, Functor g) => (f :~> g) -> HFree c f :~> g
- counit :: (c f, Functor f) => HFree c f :~> f
- leftAdjunct :: (HFree c f :~> g) -> f :~> g
- hfmap :: (f :~> g) -> HFree c f :~> HFree c g
- liftFree :: f a -> HFree c f a
- lowerFree :: (c f, Functor f) => HFree c f a -> f a
- convert :: (c (t f), Functor (t f), Monad f, MonadTrans t) => HFree c f a -> t f a
- iter :: c Identity => (forall b. f b -> b) -> HFree c f a -> a
- wrap :: f (HFree Monad f a) -> HFree Monad f a
Documentation
The higher order free functor for constraint c.
Instances
| Monad (HFree Monad f) Source | The free monad of a functor. |
| Functor (HFree c f) Source | |
| Applicative (HFree Monad f) Source | |
| Applicative (HFree Applicative f) Source | |
| Applicative (HFree Alternative f) Source | |
| Alternative (HFree Alternative f) Source |
leftAdjunct :: (HFree c f :~> g) -> f :~> g Source
leftAdjunct f = f . unit