category-extras-0.53.1: Various modules and constructs inspired by category theory

Portabilitynon-portable (rank-2 polymorphism)
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>

Control.Morphism.Hylo

Description

Generalized hylomorphisms

Synopsis

Documentation

hylo :: Functor f => Algebra g b -> (f :~> g) -> Coalgebra f a -> a -> bSource

hylo :: (g b -> b) -> (forall c. f c -> g c) -> (a -> f b) -> a -> b

g_hylo :: (Comonad w, Functor f, Monad m) => Dist g w -> Dist m f -> GAlgebra g w b -> (f :~> g) -> GCoalgebra f m a -> a -> bSource

g_hylo :: (Comonad w, Functor f, Monad m) => (forall d. g (w d) -> w (g d)) -> (forall e. m (f e) -> f (m e)) -> (g (w b) -> b) -> (forall c. f c -> g c) -> a -> f (m a) -> a -> b

bihylo :: QFunctor f Hask Hask => Algebra (g d) b -> (f c :~> g d) -> Coalgebra (f c) a -> a -> bSource

g_bihylo :: (Comonad w, QFunctor f Hask Hask, Monad m) => Dist (g d) w -> Dist m (f c) -> GAlgebra (g d) w b -> (f c :~> g d) -> GCoalgebra (f c) m a -> a -> bSource

hhylo :: HFunctor f => HAlgebra f b -> HCoalgebra f a -> a :~> bSource

higher order hylomorphisms for use in building up and tearing down higher order functors