category-extras-0.44.1: Various modules and constructs inspired by category theory.

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






ana :: Functor f => CoAlg f a -> a -> Fix fSource

Anamorphisms are a generalized form of unfoldr

g_ana :: (Functor f, Monad m) => Dist m f -> CoAlgM f m a -> a -> Fix 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 => CoAlg (f b) a -> a -> FixB f bSource

g_biana :: (Bifunctor f, Monad m) => Dist m (f b) -> CoAlgM (f b) m a -> a -> FixB f bSource

hana :: HFunctor f => CoAlgH f a -> Natural a (FixH f)Source

A higher-order anamorphism for constructing higher order functors.