category-theory-presentation/categories/30_How/300_Catamorphisms/060_morphism_missing_information_retrieved.md
2013-02-28 16:49:12 +01:00

301 B

κατα-morphism: missing information retrieved

type Algebra f a = f a -> a
instance Functor (StrF a) =
	fmap f (Cons c x) = Cons c (f x)
	fmap _ Nil = Nil
cata :: Functor f => Algebra f a -> Mu f -> a
cata f = f . fmap (cata f) . outF