fixpoint-0.1.1: Data types as fixpoints

Data.Fixpoint

Synopsis

Documentation

class Functor (Pre t) => Fixpoint t whereSource

The class of data types representable by fixpoints.

Associated Types

data Pre t :: * -> *Source

Methods

project :: t -> Pre t tSource

Projection from the data type to its underlying functor.

inject :: Pre t t -> tSource

Injection from the underlying functor into the data type.

Instances

Fixpoint [a] 

cata :: Fixpoint t => (Pre t s -> s) -> t -> sSource

Catamorphism (same as fold)

fold :: Fixpoint t => (Pre t s -> s) -> t -> sSource

Catamorphism (same as cata)

ana :: Fixpoint t => (s -> Pre t s) -> s -> tSource

Anamorphism (same as unfold)

unfold :: Fixpoint t => (s -> Pre t s) -> s -> tSource

Anamorphism (same as ana)

hylo :: Fixpoint t => (Pre t s -> s) -> (p -> Pre t p) -> p -> sSource

Hylomorphism

para :: Fixpoint t => (Pre t (t, s) -> s) -> t -> sSource

Paramorphism