Module

Data.Functor.Mu

Package
purescript-fixed-points
Repository
slamdata/purescript-fixed-points

#Mu Source

newtype Mu f

Mu f is the least fixed point of a functor f, when it exists.

Constructors

Instances

  • Newtype (Mu f) _
  • (Eq1 f) => Eq (Mu f)

    To implement Eq, we require f to have higher-kinded equality.

  • (Eq1 f, Ord1 f) => Ord (Mu f)

    To implement Ord, we require f to have higher-kinded comparison.

  • (Show (f TacitString), Functor f) => Show (Mu f)

    Show is compositional, so we only f to be able to show a single layer of structure.

#transMu Source

transMu :: forall g f. Functor g => (forall a. f a -> g a) -> Mu f -> Mu g

Rewrites a tree along a natural transformation.

#roll Source

roll :: forall f. f (Mu f) -> Mu f

#unroll Source

unroll :: forall f. Mu f -> f (Mu f)