-- | Scary named folds...{-# LANGUAGE CPP #-}moduleData.Generics.Fixplate.Morphismswhere--------------------------------------------------------------------------------importData.FoldableimportData.Generics.Fixplate.Base#ifdef WITH_QUICKCHECKimportTest.QuickCheckimportData.Generics.Fixplate.TraversalsimportData.Generics.Fixplate.Test.Tools#endif ---------------------------------------------------------------------------------- | A /paramorphism/ is a generalized (right) fold.para::Functorf=>(Muf->fa->a)->Muf->aparah=gowheregot=ht(fmapgo$unFixt)para'::Functorf=>(f(Muf,a)->a)->Muf->apara'h=gowherego(Fixt)=h(fmapgo'$t)go't=(t,got)paraList::(Functorf,Foldablef)=>(Muf->[a]->a)->Muf->aparaListf=gowheregot=ft(toList$fmapgo$unFixt)-- | A /catamorphism/ is a simpler version of a paramorphismcata::Functorf=>(fa->a)->Muf->acatah=gowherego=h.fmapgo.unFix-- | An /anamorphism/ is simply an unfold.ana::Functorf=>(a->fa)->a->Mufanah=gowherego=Fix.fmapgo.h-- go x = Fix (fmap go (h x))-- | A /hylomorphism/ is the composition of a catamorphism and an anamorphism.hylo::Functorf=>(fa->a)->(b->fb)->(b->a)hylogh=catag.anah--------------------------------------------------------------------------------