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

Portabilitynon-portable (rank-2 polymorphism)
MaintainerEdward Kmett <>






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 :: QFunctor f Hask Hask => Coalgebra (f b) a -> a -> Fix f bSource

g_biana :: (QFunctor f 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