recursion-schemes-ext-0.1.0.2: Amateur addenda to recursion-schemes

Safe HaskellSafe
LanguageHaskell2010

Data.Foldable.Functor.Extensions

Synopsis

Documentation

dicata :: Recursive a => (Base a (b, a) -> b) -> (Base a (b, a) -> a) -> a -> b Source #

Catamorphism collapsing along two data types simultaneously. Basically a fancy zygomorphism.

dendro Source #

Arguments

:: (SubHom (Base t) (Base t') a b, Recursive t') 
=> t

dummy type

-> (Base t a -> a)

A (Base t)-algebra

-> (Base t' b -> b)

A (Base t')-algebra

-> t' 
-> b 

A dendromorphism allows us to entangle two catamorphisms

micro :: Corecursive a => (b -> Either a (Base a b)) -> b -> a Source #

A micromorphism is an Elgot algebra specialized to unfolding.

symplecto Source #

Arguments

:: (SubHom g f b b, CoSubHom g f a a) 
=> (g b -> b)

A g-algebra

-> (a -> g a)

A g-coalgebra

-> (f b -> b)

An f-algebra

-> (a -> f a)

An f-coalgebra

-> a 
-> b 

Entangle two hylomorphisms. Not the same thing as a symplectomorphism from geometry.

chema :: (CoSubHom (Base t) (Base t') a b, Corecursive t') => (a -> Base t a) -> (b -> Base t' b) -> b -> t' Source #

cataM :: (Recursive t, Traversable (Base t), Monad m) => (Base t a -> m a) -> t -> m a Source #

class (Functor f, Functor g) => SubHom f g a b where Source #

Class that yields g-algebra homomorphisms between mutually recursive types.

Minimal complete definition

homo

Methods

homo :: (f a -> a) -> (g b -> b) -> g b -> b Source #

Homomorphism of g-algebras parametrized by an f-algebra

class (Functor f, Functor g) => CoSubHom f g a b where Source #

Class that yields g-coalgebra homomorphisms between mutually recursive types.

Minimal complete definition

homoCo

Methods

homoCo :: (a -> f a) -> (b -> g b) -> b -> g b Source #

Homomorphism of g-coalgebras paramterized by an f-coalgebra

class Dummy t where Source #

Minimal complete definition

dummy

Methods

dummy :: t Source #

Instances