Zygohistomorphic prepromorphisms

From HaskellWiki
Revision as of 01:38, 9 June 2008 by Roconnor (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Used when you really need both semi-mutual recursion and history and to repeatedly apply a natural transformation as you get deeper into the functor.

import Control.Morphism.Zygo
import Control.Morphism.Prepro
import Control.Morphism.Histo
import Control.Functor.Algebra

zygohistomorphic_prepromorphism :: Algebra f b -> GAlgebra f (Cofree f) a -> (f :~> f) -> FixF f -> a
zygohistomorphic_prepromorphism f = g_prepro (distZygoT (liftAlgebra f) (distHisto id)) -- unless you want a generalized zygomorphism.