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

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

Control.Morphism.Ana

Description

 

Synopsis

Documentation

ana :: Functor f => Coalgebra f a -> a -> FixF fSource

Anamorphisms are a generalized form of unfoldr

g_ana :: (Functor f, Monad m) => Dist m f -> GCoalgebra f m a -> a -> FixF fSource

Generalized anamorphisms allow you to work with a monad given a distributive law

distAna :: Functor f => Dist Identity fSource

The distributive law for the identity monad

biana :: Bifunctor f Hask Hask Hask => Coalgebra (f b) a -> a -> Fix f bSource

g_biana :: (Bifunctor f Hask Hask Hask, Monad m) => Dist m (f b) -> GCoalgebra (f b) m a -> a -> Fix f bSource

hana :: HFunctor f => HCoalgebra f a -> a :~> FixH fSource

A higher-order anamorphism for constructing higher order functors.

kana :: HFunctor f => CointerpreterT f g h -> Lan g h :~> FixH fSource

runkana :: HFunctor f => CointerpreterT f g h -> (g b -> a) -> h b -> FixH f aSource