úÎ!eś[Ă€      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁSafe16 Krecursion-schemesBase Functor for (C) 2008-2015 Edward Kmett BSD-style (see the file LICENSE)‘"Samuel Gélineau" <gelisam@gmail.com>, "Oleg Grenrus" <oleg.grenrus@iki.fi>, "Ryan Scott" <ryan.gl.scott@gmail.com> experimental non-portableSafe&'0167;<=>?FQSTV@,recursion-schemesBase functor of [].%recursion-schemesFokkinga's postpromorphism&recursion-schemesA generalized postpromorphism,recursion-schemesFokkinga's prepromorphism5recursion-schemesA generalized catamorphism6recursion-schemesA generalized catamorphism8recursion-schemesA generalized anamorphism9recursion-schemesA generalized anamorphism;recursion-schemesA generalized hylomorphism<recursion-schemesA generalized hylomorphism€recursion-schemes1Lambek's lemma provides a default definition for ( in terms of ) and "„recursion-schemes>The dual of Lambek's lemma, provides a default definition for " in terms of # and (Drecursion-schemes!A specialized, faster version of B for .Erecursion-schemes!A specialized, faster version of B for .Nrecursion-schemesCourse-of-value iterationTrecursion-schemesMendler-style iterationUrecursion-schemes'Mendler-style course-of-value iterationVrecursion-schemesElgot algebrasWrecursion-schemesElgot coalgebras: 0http://comonad.com/reader/2008/elgot-coalgebras/Xrecursion-schemes!Zygohistomorphic prepromorphisms:&A corrected and modernized version of Chttp://www.haskell.org/haskellwiki/Zygohistomorphic_prepromorphismsYrecursion-schemes Effectful 2.!This is a type specialisation of )./An example terminating a recursion immediately:NcataA (\alg -> case alg of { Nil -> pure (); Cons a _ -> Const [a] }) "hello" Const "h"Zrecursion-schemesAn effectful version of B. Properties: Z Š = §  Examples:OThe weird type of first argument allows user to decide an order of sequencing:Btransverse (\x -> print (void x) *> sequence x) "foo" :: IO String Cons 'f' () Cons 'o' () Cons 'o' ()Nil"foo"Btransverse (\x -> sequence x <* print (void x)) "foo" :: IO StringNil Cons 'o' () Cons 'o' () Cons 'f' ()"foo"[recursion-schemesA coeffectful version of B. Properties: [ : = š  Examples:Stateful transformations::{ cotransverse (\(u, b) -> case b of Nil -> Nil= Cons x a -> Cons (if u then toUpper x else x) (not u, a)) (True, "foobar") :: String:}"FoObAr"We can implement ©:{2let zipWith' :: (a -> b -> c) -> [a] -> [b] -> [c]Q zipWith' f = curry $ cotransverse $ \(xs, base) -> case (project xs, base) of! (Nil, _) -> Nil! (_, Nil) -> Nil1 (Cons x a, Cons y b) -> Cons (f x y) (a, b):}zipWith' (*) [1,2,3] [4,5,6] [4,10,18]zipWith' (*) [1,2,3] [4,5,6,8] [4,10,18]zipWith' (*) [1,2,3,3] [4,5,6] [4,10,18]Šrecursion-schemes/It may be better to work with the instance for Ș directly.#recursion-schemesa (Base t)-coalgebrarecursion-schemesseedrecursion-schemesresulting fixed point)recursion-schemesa (Base t)-algebrarecursion-schemes fixed pointrecursion-schemesresult5recursion-schemesa distributive lawrecursion-schemesa (Base t)-w-algebrarecursion-schemes fixed point6recursion-schemesa distributive lawrecursion-schemesa (Base t)-w-algebrarecursion-schemes fixed point8recursion-schemesa distributive lawrecursion-schemesa (Base t)-m-coalgebrarecursion-schemesseed9recursion-schemesa distributive lawrecursion-schemesa (Base t)-m-coalgebrarecursion-schemesseedGrecursion-schemes(A distributive for semi-mutual recursionD !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[D. ADE'()*+,-J5FHNO=>RS7/0GIPQ?@!"#$%&8:KLM1;BC26394<TUVWXYZ[SafeQV[( recursion-schemesRules of renaming data namesžrecursion-schemes9Build base functor with a sensible default configuration.e.g. `data Expr a = Lit a | Add (Expr a) (Expr a) | Expr a :* [Expr a] deriving (Show) ž ''Expr  will create Gdata ExprF a x = LitF a | AddF x x | x :*$ [x] deriving («, Ź, ­) type instance Base (Expr a) = ExprF a instance  Recursive (Expr a) where project (Lit x) = LitF x project (Add x y) = AddF x y project (x :* y) = x :*$ y instance  Corecursive (Expr a) where embed (LitF x) = Lit x embed (AddF x y) = Add x y embed (x :*$ y) = x :* y  ž = Ÿ   Notes:žn works properly only with ADTs. Existentials and GADTs aren't supported, as we don't try to do better than  lhttps://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#deriving-functor-instancesGHC's DeriveFunctor.Ÿrecursion-schemes/Build base functor with a custom configuration. recursion-schemesDefault  : append F or $, to data type, constructors and field names.Ąrecursion-schemes"How to name the base functor type.Default is to append F or $.ąrecursion-schemes1How to rename the base functor type constructors.Default is to append F or $.Łrecursion-schemes=How to rename the base functor type field names (in records).Default is to append F or $.źrecursion-schemes$makes clauses to rename constructorsŻrecursion-schemesExtract type variables°recursion-schemes&Apply arguments to a type constructor.±recursion-schemesProvides substitution for typesžŸ ĄąŁžŸ ĄąŁSafe[žČłŽ”¶·žčș       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«©Ź­©źŻ©°±ČłŽ©Ź”©¶·©Șžčș»ŒœŸżÀÁÂĂÄĆ!recursion-schemes-5.1.1.1-inplaceData.Functor.BaseData.Functor.FoldableData.Functor.Foldable.TH Data.ListNonEmptyPaths_recursion_schemes NonEmptyFheadtail$fBitraversableNonEmptyF$fBifoldableNonEmptyF$fBifunctorNonEmptyF$fTraversableNonEmptyF$fFoldableNonEmptyF$fFunctorNonEmptyF$fRead1NonEmptyF$fRead2NonEmptyF$fShow2NonEmptyF$fShow1NonEmptyF$fOrd1NonEmptyF$fOrd2NonEmptyF$fEq1NonEmptyF$fEq2NonEmptyF $fEqNonEmptyF$fOrdNonEmptyF$fShowNonEmptyF$fReadNonEmptyF$fGenericNonEmptyF$fGeneric1NonEmptyFNuMuFixListFNilCons Corecursiveembedanaapopostprogpostpro RecursiveprojectcataparagparapreprogpreproBasedistPara distParaThylofoldunfoldrefoldgcatagfolddistCataganagunfolddistAnaghylogrefoldfutugfutudistFutu distGFutuunfixhoistrefixhoistMuhoistNuzygodistZygogzygo distZygoTgapodistApodistGApo distGApoThistoghisto distHisto distGHistochronogchronomcatamhistoelgotcoelgotzygoHistoPreprocataA transverse cotransverse$fBitraversableListF$fBifoldableListF$fBifunctorListF$fTraversableListF$fFoldableListF$fFunctorListF $fRead1ListF $fRead2ListF $fShow2ListF $fShow1ListF $fOrd1ListF $fOrd2ListF $fEq1ListF $fEq2ListF $fReadFix $fShowFix$fOrdFix$fEqFix$fReadMu$fShowMu$fOrdMu$fEqMu$fReadNu$fShowNu$fOrdNu$fEqNu$fGCoerce:+::+:$fGCoerce:*::*: $fGCoerceV1V1 $fGCoerceU1U1 $fGCoerceK1K1 $fGCoerceM1M1 $fRecursiveNu$fCorecursiveNu$fCorecursiveF $fRecursiveF$fCorecursiveMu $fRecursiveMu$fCorecursiveFix$fRecursiveFix$fCorecursiveEither$fRecursiveEither$fCorecursiveMaybe$fRecursiveMaybe$fCorecursiveFreeT$fRecursiveFreeT$fCorecursiveFree$fRecursiveFree$fCorecursiveCofreeT$fRecursiveCofreeT$fCorecursiveCofree$fRecursiveCofree$fCorecursiveNatural$fRecursiveNatural$fCorecursiveNonEmpty$fRecursiveNonEmpty$fCorecursive[] $fRecursive[] $fEqListF $fOrdListF $fShowListF $fReadListF$fGenericListF$fGeneric1ListF $fDataFix BaseRulesmakeBaseFunctormakeBaseFunctorWith baseRules baseRulesType baseRulesConbaseRulesFieldlambekcolambekbaseData.Traversable sequenceAGHC.BasepureData.Functor.Identity runIdentityGHC.ListzipWithfr-5.1-3b8f4479Control.Monad.Free.ChurchFFunctor Data.FoldableFoldable Traversable mkMorphismtypeVarsconAppsT substTypeversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName