category-extras-0.53.6: Various modules and constructs inspired by category theoryContentsIndex
Control.Morphism.Prepro
Portabilitynon-portable (rank-2 polymorphism)
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>
Description
See Maarten Fokkinga''s PhD Dissertation for cascade and prepro. g_prepro is an obvious generalization. The prepro variants of other morphisms are distributed through the corresponding files.
Synopsis
prepro :: Functor f => Algebra f c -> (f :~> f) -> FixF f -> c
g_prepro :: (Functor f, Comonad w) => Dist f w -> GAlgebra f w a -> (f :~> f) -> FixF f -> a
cascade :: Bifunctor s Hask Hask Hask => (a -> a) -> Fix s a -> Fix s a
biprepro :: Bifunctor f Hask Hask Hask => Algebra (f a) c -> (f a :~> f a) -> Fix f a -> c
g_biprepro :: (Bifunctor f Hask Hask Hask, Comonad w) => Dist (f a) w -> GAlgebra (f a) w c -> (f a :~> f a) -> Fix f a -> c
Documentation
prepro :: Functor f => Algebra f c -> (f :~> f) -> FixF f -> c
Fokkinga's Prepromorphism
g_prepro :: (Functor f, Comonad w) => Dist f w -> GAlgebra f w a -> (f :~> f) -> FixF f -> a
Generalized prepromorphisms, parameterized by a comonad This is used to generate most of the specialized prepromorphisms in other modules. You can use the distributive law combinators to build up analogues of other recursion schemes.
cascade :: Bifunctor s Hask Hask Hask => (a -> a) -> Fix s a -> Fix s a
cascade f . map f = map f . cascade f
cascade f = biprepro InB (first f)
cascade f = x where x = InB . bimap id (x . fmap f) . outB
cascade f = x where x = InB . bimap id (fmap f . x) . outB
biprepro :: Bifunctor f Hask Hask Hask => Algebra (f a) c -> (f a :~> f a) -> Fix f a -> c
Prepromorphisms for bifunctors
g_biprepro :: (Bifunctor f Hask Hask Hask, Comonad w) => Dist (f a) w -> GAlgebra (f a) w c -> (f a :~> f a) -> Fix f a -> c
Generalized bifunctor prepromorphism, parameterized by a comonad
Produced by Haddock version 2.1.0