Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

## Synopsis

- chrono :: Functor f => GAlgebra (Cofree f) f b -> GCoalgebra (Free f) f a -> a -> b
- codyna :: Functor f => Algebra f b -> GCoalgebra (Free f) f a -> a -> b
- dyna :: Functor f => GAlgebra (Cofree f) f b -> Coalgebra f a -> a -> b
- elgot :: Functor f => Algebra f b -> ElgotCoalgebra (Either b) f a -> a -> b
- coelgot :: Functor f => ElgotAlgebra ((,) a) f b -> Coalgebra f a -> a -> b
- futu :: (Corecursive t f, Functor f) => GCoalgebra (Free f) f a -> a -> t
- gprepro :: (Steppable t f, Recursive t f, Functor f, Comonad w) => DistributiveLaw f w -> GAlgebra w f a -> (forall a. f a -> f a) -> t -> a
- gpostpro :: (Steppable t f, Corecursive t f, Functor f, Monad m) => DistributiveLaw m f -> (forall a. f a -> f a) -> GCoalgebra m f a -> a -> t
- stream :: Coalgebra (XNor c) b -> (b -> a -> b) -> b -> [a] -> [c]
- fstream :: Coalgebra (XNor c) b -> (b -> a -> b) -> Coalgebra (XNor c) b -> b -> [a] -> [c]
- cotraverse :: (Steppable t (f a), Steppable u (f b), Corecursive u (f b), Bitraversable f, Traversable (f b), Monad m) => (a -> m b) -> t -> m u
- zygoHistoPrepro :: (Steppable t f, Recursive t f, Functor f) => (f b -> b) -> (f (EnvT b (Cofree f) a) -> a) -> (forall c. f c -> f c) -> t -> a

# Documentation

elgot :: Functor f => Algebra f b -> ElgotCoalgebra (Either b) f a -> a -> b Source #

Unlike most `hylo`

s, `elgot`

composes an algebra and coalgebra in a way
that allows information to move between them. The coalgebra can return,
effectively, a pre-folded branch, short-circuiting parts of the process.

futu :: (Corecursive t f, Functor f) => GCoalgebra (Free f) f a -> a -> t Source #

gprepro :: (Steppable t f, Recursive t f, Functor f, Comonad w) => DistributiveLaw f w -> GAlgebra w f a -> (forall a. f a -> f a) -> t -> a Source #

gpostpro :: (Steppable t f, Corecursive t f, Functor f, Monad m) => DistributiveLaw m f -> (forall a. f a -> f a) -> GCoalgebra m f a -> a -> t Source #

stream :: Coalgebra (XNor c) b -> (b -> a -> b) -> b -> [a] -> [c] Source #

The metamorphism definition from Gibbons’ paper.

fstream :: Coalgebra (XNor c) b -> (b -> a -> b) -> Coalgebra (XNor c) b -> b -> [a] -> [c] Source #

cotraverse :: (Steppable t (f a), Steppable u (f b), Corecursive u (f b), Bitraversable f, Traversable (f b), Monad m) => (a -> m b) -> t -> m u Source #