#|ϱ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ $Algebra, ColAlgebra, and other stuff(c) gspia 2020-BSDgspiaSafe -.HUV!:fcf-containersType-level Second. Tuples (,) and Either have Second-instances.Example%:kind! Eval (Second ((+) 1) '("a",3))2Eval (Second ((+) 1) '("a",3)) :: (TL.Symbol, Nat) = '("a", 4)fcf-containersType-level First. Tuples (,) and Either have First-instances.Example$:kind! Eval (First ((+) 1) '(3,"a"))1Eval (First ((+) 1) '(3,"a")) :: (Nat, TL.Symbol) = '(4, "a")fcf-containersHylomorphism uses first ( to build a structure (unfold) and then " to process the structure (fold).Example+data NToOneCoA :: CoAlgebra (ListF Nat) Nat:{% type instance Eval (NToOneCoA b) =  If (Eval (b < 1) ) 'NilF ('ConsF b ( b TL.- 1)):}%:kind! Eval (Hylo SumAlg NToOneCoA 5)%Eval (Hylo SumAlg NToOneCoA 5) :: Nat= 15fcf-containers Ana can also be used to build a  structure.Example+data NToOneCoA :: CoAlgebra (ListF Nat) Nat:{% type instance Eval (NToOneCoA b) =  If (Eval (b < 1) ) 'NilF ('ConsF b ( b TL.- 1)):}:kind! Eval (Ana NToOneCoA 3))Eval (Ana NToOneCoA 3) :: Fix (ListF Nat)B= 'Fix ('ConsF 3 ('Fix ('ConsF 2 ('Fix ('ConsF 1 ('Fix 'NilF))))))fcf-containersWrite the function to give a #, and feed it in together with an .2Check Fcf.Alg.List to see example algebras in use.fcf-containers)Commonly used name describing the method  eats.fcf-containers)Commonly used name describing the method  eats.fcf-containersStructure that , can fold and that is a result structure of .   CListF structure working with Algebras, ColAlgebras, and other stuff(c) gspia 2020-BSDgspiaSafe -.HUV fcf-containers>Equal tests for list equality. We may change the name to (==).Example%:kind! Eval (Equal '[1,2,3] '[1,2,3])&Eval (Equal '[1,2,3] '[1,2,3]) :: Bool= 'True%:kind! Eval (Equal '[1,2,3] '[1,3,2])&Eval (Equal '[1,2,3] '[1,3,2]) :: Bool= 'False fcf-containersToList for type-level lists.Example:kind! Eval (ToList 1)Eval (ToList 1) :: [Nat]= '[1] fcf-containersSnoc for type-level lists.Example:kind! Eval (Snoc '[1,2,3] 4)Eval (Snoc '[1,2,3] 4) :: [Nat]= '[1, 2, 3, 4] fcf-containersType-level Any.Example-:kind! Eval (Any (Flip (<) 5) '[0,1,2,3,4,5]).Eval (Any (Flip (<) 5) '[0,1,2,3,4,5]) :: Bool= 'True-:kind! Eval (Any (Flip (<) 0) '[0,1,2,3,4,5]).Eval (Any (Flip (<) 0) '[0,1,2,3,4,5]) :: Bool= 'Falsefcf-containers5Give true if any of the booleans in the list is true.Example!:kind! Eval (Or '[ 'True, 'True])"Eval (Or '[ 'True, 'True]) :: Bool= 'True#:kind! Eval (Or '[ 'False, 'False])$Eval (Or '[ 'False, 'False]) :: Bool= 'Falsefcf-containersType-level All.Example-:kind! Eval (All (Flip (<) 6) '[0,1,2,3,4,5]).Eval (All (Flip (<) 6) '[0,1,2,3,4,5]) :: Bool= 'True-:kind! Eval (All (Flip (<) 5) '[0,1,2,3,4,5]).Eval (All (Flip (<) 5) '[0,1,2,3,4,5]) :: Bool= 'Falsefcf-containers6Give true if all of the booleans in the list are true.Example":kind! Eval (And '[ 'True, 'True])#Eval (And '[ 'True, 'True]) :: Bool= 'True*:kind! Eval (And '[ 'True, 'True, 'False])+Eval (And '[ 'True, 'True, 'False]) :: Bool= 'Falsefcf-containersTailsExample:kind! Eval (Tails '[0,1,2,3])"Eval (Tails '[0,1,2,3]) :: [[Nat]].= '[ '[0, 1, 2, 3], '[1, 2, 3], '[2, 3], '[3]]fcf-containersbIsInfixOf take two type-level lists and returns true iff the first list is a infix of the second.Example2:kind! Eval (IsInfixOf '[2,3,4] '[0,1,2,3,4,5,6])3Eval (IsInfixOf '[2,3,4] '[0,1,2,3,4,5,6]) :: Bool= 'True2:kind! Eval (IsInfixOf '[2,4,4] '[0,1,2,3,4,5,6])3Eval (IsInfixOf '[2,4,4] '[0,1,2,3,4,5,6]) :: Bool= 'Falsefcf-containersdIsSuffixOf take two type-level lists and returns true iff the first list is a suffix of the second.Example0:kind! Eval (IsSuffixOf '[3,4,5] '[0,1,2,3,4,5])1Eval (IsSuffixOf '[3,4,5] '[0,1,2,3,4,5]) :: Bool= 'True0:kind! Eval (IsSuffixOf '[3,4,5] '[0,1,3,2,4,5])1Eval (IsSuffixOf '[3,4,5] '[0,1,3,2,4,5]) :: Bool= 'False+:kind! Eval (IsSuffixOf '[] '[0,1,3,2,4,5]),Eval (IsSuffixOf '[] '[0,1,3,2,4,5]) :: Bool= 'True+:kind! Eval (IsSuffixOf '[0,1,3,2,4,5] '[]),Eval (IsSuffixOf '[0,1,3,2,4,5] '[]) :: Bool= 'Falsefcf-containerseIsPrefixOf takes two type-level lists and returns true iff the first list is a prefix of the second.Example0:kind! Eval (IsPrefixOf '[0,1,2] '[0,1,2,3,4,5])1Eval (IsPrefixOf '[0,1,2] '[0,1,2,3,4,5]) :: Bool= 'True0:kind! Eval (IsPrefixOf '[0,1,2] '[0,1,3,2,4,5])1Eval (IsPrefixOf '[0,1,2] '[0,1,3,2,4,5]) :: Bool= 'False+:kind! Eval (IsPrefixOf '[] '[0,1,3,2,4,5]),Eval (IsPrefixOf '[] '[0,1,3,2,4,5]) :: Bool= 'True+:kind! Eval (IsPrefixOf '[0,1,3,2,4,5] '[]),Eval (IsPrefixOf '[0,1,3,2,4,5] '[]) :: Bool= 'Falsefcf-containers, applied to a predicate p and a type-level list xsZ, returns a type-level tuple where first element is longest prefix (possibly empty) of xs of elements that do not satisfy p1 and second element is the remainder of the list:Example3:kind! Eval (Break (Flip (>) 3) '[1,2,3,4,1,2,3,4])>Eval (Break (Flip (>) 3) '[1,2,3,4,1,2,3,4]) :: ([Nat], [Nat])"= '( '[1, 2, 3], '[4, 1, 2, 3, 4])):kind! Eval (Break (Flip (<) 9) '[1,2,3])4Eval (Break (Flip (<) 9) '[1,2,3]) :: ([Nat], [Nat])= '( '[], '[1, 2, 3])):kind! Eval (Break (Flip (>) 9) '[1,2,3])4Eval (Break (Flip (>) 9) '[1,2,3]) :: ([Nat], [Nat])= '( '[1, 2, 3], '[])fcf-containers, applied to a predicate p and a type-level list xsZ, returns a type-level tuple where first element is longest prefix (possibly empty) of xs of elements that satisfy p1 and second element is the remainder of the list:Example2:kind! Eval (Span (Flip (<) 3) '[1,2,3,4,1,2,3,4])=Eval (Span (Flip (<) 3) '[1,2,3,4,1,2,3,4]) :: ([Nat], [Nat])"= '( '[1, 2], '[3, 4, 1, 2, 3, 4])(:kind! Eval (Span (Flip (<) 9) '[1,2,3])3Eval (Span (Flip (<) 9) '[1,2,3]) :: ([Nat], [Nat])= '( '[1, 2, 3], '[])(:kind! Eval (Span (Flip (<) 0) '[1,2,3])3Eval (Span (Flip (<) 0) '[1,2,3]) :: ([Nat], [Nat])= '( '[], '[1, 2, 3])fcf-containers!Intercalate for type-level lists.ExampleI:kind! Eval (Intercalate '[", "] '[ '["Lorem"], '["ipsum"], '["dolor"] ])QEval (Intercalate '[", "] '[ '["Lorem"], '["ipsum"], '["dolor"] ]) :: [TL.Symbol]*= '["Lorem", ", ", "ipsum", ", ", "dolor"]fcf-containers!Intersperse for type-level lists.Example&:kind! Eval (Intersperse 0 '[1,2,3,4])(Eval (Intersperse 0 '[1,2,3,4]) :: [Nat]= '[1, 0, 2, 0, 3, 0, 4]fcf-containers PartitionExampleA:kind! Eval (Fcf.Alg.List.Partition ((>=) 35) '[ 20, 30, 40, 50])EEval (Fcf.Alg.List.Partition ((>=) 35) '[ 20, 30, 40, 50]) :: ([Nat],E [Nat])= '( '[20, 30], '[40, 50])fcf-containersSum a Nat-list.Example:kind! Eval (Sum '[1,2,3])Eval (Sum '[1,2,3]) :: Nat= 6fcf-containers8Example algebra to calculate the prod of Nats in a list.3:kind! Eval (Cata ProdAlg =<< ListToFix '[1,2,3,4])3Eval (Cata ProdAlg =<< ListToFix '[1,2,3,4]) :: Nat= 24fcf-containers7Example algebra to calculate the sum of Nats in a list.2:kind! Eval (Cata SumAlg =<< ListToFix '[1,2,3,4])2Eval (Cata SumAlg =<< ListToFix '[1,2,3,4]) :: Nat= 10 fcf-containers)Example algebra to calculate list length.0:kind! Eval (Cata LenAlg =<< ListToFix '[1,2,3])0Eval (Cata LenAlg =<< ListToFix '[1,2,3]) :: Nat= 3!fcf-containersListToFix can be used to turn a norma type-level list into the base functor type ListF, to be used with e.g. Cata. For examples in use, see   and .Ideally, we would have one ToFix type-level function for which we could give type instances for different type-level types, like lists, trees etc. See TODO.md."fcf-containers Base functor for a list of type [a].  !"$#"$#!  :Map (association) data-type for the type-level programming(c) gspia 2020-BSDgspiaSafe -.HUVW%fcf-containers PartitionExampleC:kind! Eval (Partition ((>=) 35) =<< FromList '[ '(5,50), '(3,30)])FEval (Partition ((>=) 35) =<< FromList '[ '(5,50), '(3,30)]) :: (MapC L Nat Nat, N MapC Nat Nat),= '( 'MapC '[ '(3, 30)], 'MapC '[ '(5, 50)])&fcf-containers FilterWithKeyExample@:kind! Eval (FilterWithKey (>=) =<< FromList '[ '(3,5), '(6,4)])AEval (FilterWithKey (>=) =<< FromList '[ '(3,5), '(6,4)]) :: MapCF Nat Nat= 'MapC '[ '(6, 4)]'fcf-containersFilterExample@:kind! Eval (Filter ((>=) 35) =<< FromList '[ '(5,50), '(3,30)])BEval (Filter ((>=) 35) =<< FromList '[ '(5,50), '(3,30)]) :: MapC F Nat Nat= 'MapC '[ '(3, 30)](fcf-containersToListExample8:kind! Eval (ToList =<< FromList '[ '(5,"a"), '(3,"b")])<Eval (ToList =<< FromList '[ '(5,"a"), '(3,"b")]) :: [(Nat, ? Symbol)]= '[ '(5, "a"), '(3, "b")]:kind! Eval (ToList =<< Empty)#Eval (ToList =<< Empty) :: [(k, v)]= '[])fcf-containersAssocsExample8:kind! Eval (Assocs =<< FromList '[ '(5,"a"), '(3,"b")])<Eval (Assocs =<< FromList '[ '(5,"a"), '(3,"b")]) :: [(Nat, ? Symbol)]= '[ '(5, "a"), '(3, "b")]:kind! Eval (Assocs =<< Empty)#Eval (Assocs =<< Empty) :: [(k, v)]= '[]*fcf-containersKeysExample6:kind! Eval (Keys =<< FromList '[ '(5,"a"), '(3,"b")])8Eval (Keys =<< FromList '[ '(5,"a"), '(3,"b")]) :: [Nat] = '[5, 3]:kind! Eval (Keys =<< Empty)Eval (Keys =<< Empty) :: [k]= '[]+fcf-containersElemsExample7:kind! Eval (Elems =<< FromList '[ '(5,"a"), '(3,"b")])<Eval (Elems =<< FromList '[ '(5,"a"), '(3,"b")]) :: [Symbol] = '["a", "b"]:kind! Eval (Elems =<< Empty)Eval (Elems =<< Empty) :: [v]= '[],fcf-containersFoldr{Fold the values in the map using the given right-associative binary operator, such that 'foldr f z == foldr f z . elems'.DNote: the order of values in MapC is not well defined at the moment.ExampleJ:kind! Eval (Fcf.Data.MapC.Foldr (+) 0 =<< (FromList '[ '(1,1), '(2,2)]))JEval (Fcf.Data.MapC.Foldr (+) 0 =<< (FromList '[ '(1,1), '(2,2)])) :: Nat= 3/fcf-containersDisjointExampleh:kind! Eval (Disjoint (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(5,"B"), '(7,"C")])))iEval (Disjoint (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(5,"B"), '(7,"C")]))) :: Bool= 'Falseh:kind! Eval (Disjoint (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(2,"B"), '(7,"C")])))iEval (Disjoint (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(2,"B"), '(7,"C")]))) :: Bool= 'True0:kind! Eval (Disjoint (Eval Empty) (Eval Empty))1Eval (Disjoint (Eval Empty) (Eval Empty)) :: Bool= 'True0fcf-containers IntersectionExamplel:kind! Eval (Intersection (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(5,"B"), '(7,"C")])))nEval (Intersection (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(5,"B"), '(7,"C")]))) :: MapC o Nat q Symbol= 'MapC '[ '(5, "b")]1fcf-containers DifferenceExamplej:kind! Eval (Difference (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(5,"B"), '(7,"C")])))lEval (Difference (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(5,"B"), '(7,"C")]))) :: MapC m Nat o Symbol= 'MapC '[ '(3, "a")]2fcf-containersUnionExamplef:kind! Eval (Union (Eval (FromList '[ '(5,"a"), '(3,"b")])) (Eval (FromList '[ '(5,"A"), '(7,"c")])) )hEval (Union (Eval (FromList '[ '(5,"a"), '(3,"b")])) (Eval (FromList '[ '(5,"A"), '(7,"c")])) ) :: MapC i Nat k Symbol+= 'MapC '[ '(7, "c"), '(5, "a"), '(3, "b")]3fcf-containersSizeExample6:kind! Eval (Size =<< FromList '[ '(5,"a"), '(3,"b")])6Eval (Size =<< FromList '[ '(5,"a"), '(3,"b")]) :: Nat= 24fcf-containersNullExample6:kind! Eval (Null =<< FromList '[ '(5,"a"), '(3,"b")])7Eval (Null =<< FromList '[ '(5,"a"), '(3,"b")]) :: Bool= 'False:kind! Eval (Null =<< Empty)Eval (Null =<< Empty) :: Bool= 'True5fcf-containers NotMemberExample=:kind! Eval (NotMember 5 =<< FromList '[ '(5,"a"), '(3,"b")])>Eval (NotMember 5 =<< FromList '[ '(5,"a"), '(3,"b")]) :: Bool= 'False=:kind! Eval (NotMember 7 =<< FromList '[ '(5,"a"), '(3,"b")])>Eval (NotMember 7 =<< FromList '[ '(5,"a"), '(3,"b")]) :: Bool= 'True6fcf-containersMemberExample::kind! Eval (Member 5 =<< FromList '[ '(5,"a"), '(3,"b")]);Eval (Member 5 =<< FromList '[ '(5,"a"), '(3,"b")]) :: Bool= 'True::kind! Eval (Member 7 =<< FromList '[ '(5,"a"), '(3,"b")]);Eval (Member 7 =<< FromList '[ '(5,"a"), '(3,"b")]) :: Bool= 'False7fcf-containersLookupExample::kind! Eval (Lookup 5 =<< FromList '[ '(5,"a"), '(3,"b")])CEval (Lookup 5 =<< FromList '[ '(5,"a"), '(3,"b")]) :: Maybe Symbol = 'Just "a"::kind! Eval (Lookup 7 =<< FromList '[ '(5,"a"), '(3,"b")])CEval (Lookup 7 =<< FromList '[ '(5,"a"), '(3,"b")]) :: Maybe Symbol = 'Nothing8fcf-containersAdjustExampleJ:kind! Eval (Adjust (Append "new ") 5 =<< FromList '[ '(5,"a"), '(3,"b")])KEval (Adjust (Append "new ") 5 =<< FromList '[ '(5,"a"), '(3,"b")]) :: MapCS Nat Symbol$= 'MapC '[ '(5, "new a"), '(3, "b")]J:kind! Eval (Adjust (Append "new ") 7 =<< FromList '[ '(5,"a"), '(3,"b")])KEval (Adjust (Append "new ") 7 =<< FromList '[ '(5,"a"), '(3,"b")]) :: MapCS Nat Symbol = 'MapC '[ '(5, "a"), '(3, "b")]0:kind! Eval (Adjust (Append "new ") 7 =<< Empty)<Eval (Adjust (Append "new ") 7 =<< Empty) :: MapC Nat Symbol = 'MapC '[]9fcf-containersDeleteExample::kind! Eval (Delete 5 =<< FromList '[ '(5,"a"), '(3,"b")]);Eval (Delete 5 =<< FromList '[ '(5,"a"), '(3,"b")]) :: MapCC Nat Symbol= 'MapC '[ '(3, "b")]::kind! Eval (Delete 7 =<< FromList '[ '(5,"a"), '(3,"b")]);Eval (Delete 7 =<< FromList '[ '(5,"a"), '(3,"b")]) :: MapCC Nat Symbol = 'MapC '[ '(5, "a"), '(3, "b")] :kind! Eval (Delete 7 =<< Empty)'Eval (Delete 7 =<< Empty) :: MapC Nat v = 'MapC '[]:fcf-containers-InsertWith if old there, map if no old, addExampleK:kind! Eval (InsertWith Append 5 "xxx" =<< FromList '[ '(5,"a"), '(3,"b")])LEval (InsertWith Append 5 "xxx" =<< FromList '[ '(5,"a"), '(3,"b")]) :: MapCT Nat Symbol#= 'MapC '[ '(5, "xxxa"), '(3, "b")]K:kind! Eval (InsertWith Append 7 "xxx" =<< FromList '[ '(5,"a"), '(3,"b")])LEval (InsertWith Append 7 "xxx" =<< FromList '[ '(5,"a"), '(3,"b")]) :: MapCT Nat Symbol-= 'MapC '[ '(5, "a"), '(3, "b"), '(7, "xxx")]1:kind! Eval (InsertWith Append 7 "xxx" =<< Empty)=Eval (InsertWith Append 7 "xxx" =<< Empty) :: MapC Nat Symbol= 'MapC '[ '(7, "xxx")];fcf-containersInsertExampleD:kind! Eval (Insert 3 "hih" =<< FromList '[ '(1,"haa"), '(2,"hoo")])FEval (Insert 3 "hih" =<< FromList '[ '(1,"haa"), '(2,"hoo")]) :: MapC M Nat Symbol1= 'MapC '[ '(3, "hih"), '(1, "haa"), '(2, "hoo")]<fcf-containers6Use FromList to construct a MapC from type-level list.Example1:kind! Eval (FromList '[ '(1,"haa"), '(2,"hoo")])=Eval (FromList '[ '(1,"haa"), '(2,"hoo")]) :: MapC Nat Symbol$= 'MapC '[ '(1, "haa"), '(2, "hoo")]=fcf-containers SingletonExample:kind! Eval (Singleton 1 "haa")+Eval (Singleton 1 "haa") :: MapC Nat Symbol= 'MapC '[ '(1, "haa")]>fcf-containersEmptyExample&:kind! (Eval Empty :: MapC Nat Symbol)2(Eval Empty :: MapC Nat Symbol) :: MapC Nat Symbol = 'MapC '[]&:kind! (Eval Empty :: MapC Int String)2(Eval Empty :: MapC Int String) :: MapC Int [Char] = 'MapC '[]+See also the other examples in this module.?fcf-containersA type corresponding to Map in the containers. We call this MapC because name Map is reserved to the map-function in Fcf-package.The representation is based on type-level lists. Please, do not use that fact but rather use the exposed API. (We hope to change the internal data type to balanced tree similar to the one used in containers. See TODO.md.)%&'()*+,-./0123456789:;<=>?@?@43765/+*)>=;:92108.-,'&%<(-Set data-structure for type-level programming(c) gspia 2020-BSDgspiaSafe -.HUV[Afcf-containers#Get the type-level list out of the Q.Example7:kind! Eval (ToList =<< PowerSet =<< FromList '[1,2,3])=Eval (ToList =<< PowerSet =<< FromList '[1,2,3]) :: [Set Nat]== '[ 'Set '[], 'Set '[3], 'Set '[2], 'Set '[2, 3], 'Set '[1],1 'Set '[1, 2], 'Set '[1, 3], 'Set '[1, 2, 3]][:kind! Eval (Qsort NatListOrd =<< Map ToList =<< ToList =<< PowerSet =<< FromList '[1,2,3])_Eval (Qsort NatListOrd =<< Map ToList =<< ToList =<< PowerSet =<< FromList '[1,2,3]) :: [[Nat]]B= '[ '[], '[1], '[1, 2], '[1, 2, 3], '[1, 3], '[2], '[2, 3], '[3]]Bfcf-containers5Use FromList to construct a Set from type-level list.Example:kind! Eval (FromList '[1, 2])"Eval (FromList '[1, 2]) :: Set Nat= 'Set '[1, 2]Cfcf-containers\Calculate the power sets of a given type-level list. The algorithm is based on Gray codes.Example4:kind! Eval (PowerSet =<< FromList '["a", "b", "c"])AEval (PowerSet =<< FromList '["a", "b", "c"]) :: Set (Set Symbol)= 'Set< '[ 'Set '[], 'Set '["c"], 'Set '["b"], 'Set '["b", "c"],7 'Set '["a"], 'Set '["a", "b"], 'Set '["a", "c"], 'Set '["a", "b", "c"]];:kind! Eval (PowerSet =<< FromList '[Int, Char, Maybe Int])CEval (PowerSet =<< FromList '[Int, Char, Maybe Int]) :: Set (Set *)= 'Set1 '[ 'Set '[], 'Set '[Maybe Int], 'Set '[Char],? 'Set '[Char, Maybe Int], 'Set '[Int], 'Set '[Int, Char],< 'Set '[Int, Maybe Int], 'Set '[Int, Char, Maybe Int]]Dfcf-containersType-level set intersection.ExampleN:kind! Eval (Intersection (Eval (FromList '[3, 5])) (Eval (FromList '[5, 7])))OEval (Intersection (Eval (FromList '[3, 5])) (Eval (FromList '[5, 7]))) :: Set P Nat = 'Set '[5]Efcf-containersType-level set difference.ExampleL:kind! Eval (Difference (Eval (FromList '[3, 5])) (Eval (FromList '[5, 7])))MEval (Difference (Eval (FromList '[3, 5])) (Eval (FromList '[5, 7]))) :: Set N Nat = 'Set '[3]Ffcf-containersType-level set union.ExampleH:kind! Eval (Union (Eval (FromList '[5, 3])) (Eval (FromList '[5, 7])) )IEval (Union (Eval (FromList '[5, 3])) (Eval (FromList '[5, 7])) ) :: Set J Nat= 'Set '[7, 5, 3]Gfcf-containersIsProperSubsetOf ExampleF:kind! Eval (IsProperSubsetOf ('Set '[0,1,2,3,4]) ('Set '[0,1,2,3,4]))GEval (IsProperSubsetOf ('Set '[0,1,2,3,4]) ('Set '[0,1,2,3,4])) :: Bool= 'FalseD:kind! Eval (IsProperSubsetOf ('Set '[0,2,1,3]) ('Set '[0,1,2,3,4]))EEval (IsProperSubsetOf ('Set '[0,2,1,3]) ('Set '[0,1,2,3,4])) :: Bool= 'TrueHfcf-containers IsSubsetOf Example7:kind! Eval (IsSubsetOf ('Set '[]) ('Set '[0,1,2,3,4]))8Eval (IsSubsetOf ('Set '[]) ('Set '[0,1,2,3,4])) :: Bool= 'True::kind! Eval (IsSubsetOf ('Set '[0,1]) ('Set '[0,1,2,3,4]));Eval (IsSubsetOf ('Set '[0,1]) ('Set '[0,1,2,3,4])) :: Bool= 'True@:kind! Eval (IsSubsetOf ('Set '[0,2,1,3,4]) ('Set '[0,1,2,3,4]))AEval (IsSubsetOf ('Set '[0,2,1,3,4]) ('Set '[0,1,2,3,4])) :: Bool= 'TrueB:kind! Eval (IsSubsetOf ('Set '[0,1,2,3,4,5]) ('Set '[0,1,2,3,4]))CEval (IsSubsetOf ('Set '[0,1,2,3,4,5]) ('Set '[0,1,2,3,4])) :: Bool= 'FalseIfcf-containersSizeExample':kind! Eval (Size =<< FromList '[5, 3])'Eval (Size =<< FromList '[5, 3]) :: Nat= 2Jfcf-containersNullExample':kind! Eval (Null =<< FromList '[5, 3])(Eval (Null =<< FromList '[5, 3]) :: Bool= 'False:kind! Eval (Null =<< Empty)Eval (Null =<< Empty) :: Bool= 'TrueKfcf-containers NotMemberExample.:kind! Eval (NotMember 5 =<< FromList '[5, 3])/Eval (NotMember 5 =<< FromList '[5, 3]) :: Bool= 'False.:kind! Eval (NotMember 7 =<< FromList '[5, 3])/Eval (NotMember 7 =<< FromList '[5, 3]) :: Bool= 'TrueLfcf-containersMemberExample+:kind! Eval (Member 5 =<< FromList '[5, 3]),Eval (Member 5 =<< FromList '[5, 3]) :: Bool= 'True+:kind! Eval (Member 7 =<< FromList '[5, 3]),Eval (Member 7 =<< FromList '[5, 3]) :: Bool= 'FalseMfcf-containersDeleteExample+:kind! Eval (Delete 5 =<< FromList '[5, 3])/Eval (Delete 5 =<< FromList '[5, 3]) :: Set Nat = 'Set '[3]+:kind! Eval (Delete 7 =<< FromList '[5, 3])/Eval (Delete 7 =<< FromList '[5, 3]) :: Set Nat= 'Set '[5, 3]Nfcf-containersInsertExample+:kind! Eval (Insert 3 =<< FromList '[1, 2])/Eval (Insert 3 =<< FromList '[1, 2]) :: Set Nat= 'Set '[3, 1, 2]+:kind! Eval (Insert 2 =<< FromList '[1, 2])/Eval (Insert 2 =<< FromList '[1, 2]) :: Set Nat= 'Set '[1, 2]Ofcf-containers SingletonExample:kind! Eval (Singleton 1)Eval (Singleton 1) :: Set Nat = 'Set '[1]Pfcf-containersEmptyExample:kind! (Eval Empty :: Set Nat)"(Eval Empty :: Set Nat) :: Set Nat = 'Set '[]+See also the other examples in this module.Qfcf-containersSet-definition.ABCDEFGHIJKLMNOPQRQRLKJIHGPONMCFEDBAType level symbols(c) gspia 2020-BSDgspiaSafe -.HUV} Sfcf-containersEquality of symbolsExample:kind! Eval ("b" == "a")Eval ("b" == "a") :: Bool= 'FalseTfcf-containers#Larger-than comparison for symbols.Example:kind! Eval ("b" > "a")Eval ("b" > "a") :: Bool= 'TrueUfcf-containers!Less-than comparison for symbols.Example:kind! Eval ("a" < "b")Eval ("a" < "b") :: Bool= 'TrueVfcf-containers,Larger-than-or-equal comparison for symbols.Example:kind! Eval ("b" >= "a")Eval ("b" >= "a") :: Bool= 'TrueWfcf-containers*Less-than-or-equal comparison for symbols.Example:kind! Eval ("b" <= "a")Eval ("b" <= "a") :: Bool= 'FalseXfcf-containers_SymbolOrd - compare two symbols and give type-level Ordering ( $ 'LT $, $ 'EQ$ or $ 'GT $ ).Example:kind! Eval (SymbolOrd "a" "b")$Eval (SymbolOrd "a" "b") :: Ordering= 'LTYfcf-containersIsDigitExample:kind! Eval (IsDigit "3")Eval (IsDigit "3") :: Bool= 'True:kind! Eval (IsDigit "a")Eval (IsDigit "a") :: Bool= 'FalseZfcf-containers IsSpaceDelimExample:kind! Eval (IsSpaceDelim "a")Eval (IsSpaceDelim "a") :: Bool= 'False:kind! Eval (IsSpaceDelim "\n") Eval (IsSpaceDelim "\n") :: Bool= 'True[fcf-containersIsTabExample:kind! Eval (IsTab "a")Eval (IsTab "a") :: Bool= 'False:kind! Eval (IsTab "\t")Eval (IsTab "\t") :: Bool= 'True\fcf-containers IsNewlineExample:kind! Eval (IsNewLine "a")Eval (IsNewLine "a") :: Bool= 'False:kind! Eval (IsNewLine "\n")Eval (IsNewLine "\n") :: Bool= 'True]fcf-containersIsSpaceExample:kind! Eval (IsSpace "a")Eval (IsSpace "a") :: Bool= 'False:kind! Eval (IsSpace " ")Eval (IsSpace " ") :: Bool= 'True^fcf-containersIntercalate type-level symbols.Example1:kind! Eval (Intercalate "+" '["aa", "bb", "cc"])4Eval (Intercalate "+" '["aa", "bb", "cc"]) :: Symbol = "aa+bb+cc"%:kind! Eval (Intercalate "+" '["aa"])(Eval (Intercalate "+" '["aa"]) :: Symbol= "aa"!:kind! Eval (Intercalate "+" '[])$Eval (Intercalate "+" '[]) :: Symbol= ""_fcf-containersAppend two type-level symbols.Example :kind! Eval (Append "hmm" " ok")#Eval (Append "hmm" " ok") :: Symbol = "hmm ok"STUVWXYZ[\]^__^]\[ZYXWVUTS+Type-level Text data structure with methods(c) gspia 2020-BSDgspiaSafe -.HUV=u1`fcf-containersIsInfixOf for type-level text.Exampleg:kind! Eval (IsInfixOf ('Text '["m", "i", "a"]) ('Text '["a", "a", "m", "i", "a", "i", "n", "e", "n"]))hEval (IsInfixOf ('Text '["m", "i", "a"]) ('Text '["a", "a", "m", "i", "a", "i", "n", "e", "n"])) :: Bool= 'Trueafcf-containersIsSuffixOf for type-level text.Exampleh:kind! Eval (IsSuffixOf ('Text '["n", "e", "n"]) ('Text '["a", "a", "m", "i", "a", "i", "n", "e", "n"]))iEval (IsSuffixOf ('Text '["n", "e", "n"]) ('Text '["a", "a", "m", "i", "a", "i", "n", "e", "n"])) :: Bool= 'Truebfcf-containersIsPrefixOf for type-level text.Examplec:kind! Eval (IsPrefixOf ('Text '["a", "a"]) ('Text '["a", "a", "m", "i", "a", "i", "n", "e", "n"]))dEval (IsPrefixOf ('Text '["a", "a"]) ('Text '["a", "a", "m", "i", "a", "i", "n", "e", "n"])) :: Bool= 'Truecfcf-containers'Unwords for type-level text. This uses z. to add space-symbol between the given texts.ExampleW:kind! Eval (Unwords '[ 'Text '["o", "k"], 'Text '["h", "m", "m "], 'Text '["a", "b"]])XEval (Unwords '[ 'Text '["o", "k"], 'Text '["h", "m", "m "], 'Text '["a", "b"]]) :: Text7= 'Text '["o", "k", " ", "h", "m", "m ", " ", "a", "b"]dfcf-containersUUnlines for type-level text. This adds a newline to each Text and then concats them.ExampleW:kind! Eval (Unlines '[ 'Text '["o", "k"], 'Text '["h", "m", "m "], 'Text '["a", "b"]])XEval (Unlines '[ 'Text '["o", "k"], 'Text '["h", "m", "m "], 'Text '["a", "b"]]) :: Text?= 'Text '["o", "k", "\n", "h", "m", "m ", "\n", "a", "b", "\n"]efcf-containersWords for type-level text.ExampleR:kind! Eval (Words =<< FromList '[ "o", "k", " ", "h", "m", "m ", "\n", "a", "b"])UEval (Words =<< FromList '[ "o", "k", " ", "h", "m", "m ", "\n", "a", "b"]) :: [Text]C= '[ 'Text '["o", "k"], 'Text '["h", "m", "m "], 'Text '["a", "b"]]ffcf-containersLines for type-level text.ExampleS:kind! Eval (Lines =<< FromList '[ "o", "k", "\n", "h", "m", "m ", "\n", "a", "b"])VEval (Lines =<< FromList '[ "o", "k", "\n", "h", "m", "m ", "\n", "a", "b"]) :: [Text]C= '[ 'Text '["o", "k"], 'Text '["h", "m", "m "], 'Text '["a", "b"]]fcf-containersHelper for Splitfcf-containersHelper for Splitgfcf-containersSplit for type-level text.Example_:kind! Eval (Split S.IsSpace (Eval (FromList '[ "c", "d", " ", "b", "f", " ", "a", "b", "h"])))bEval (Split S.IsSpace (Eval (FromList '[ "c", "d", " ", "b", "f", " ", "a", "b", "h"]))) :: [Text]B= '[ 'Text '["c", "d"], 'Text '["b", "f"], 'Text '["a", "b", "h"]]fcf-containersHelper for SplitOnfcf-containersHelper for SplitOnE:kind! Eval (SOTake '["a", "b"] '[ "c", "d", "a", "b", "f", "g"] '[])LEval (SOTake '["a", "b"] '[ "c", "d", "a", "b", "f", "g"] '[]) :: ([Symbol],L [Symbol])= '( '["c", "d"], '["f", "g"])hfcf-containersSplitOn for type-level text.Exampleu:kind! Eval (SplitOn (Eval (FromList '["a", "b"])) (Eval (FromList '[ "c", "d", "a", "b", "f", "g", "a", "b", "h"])))xEval (SplitOn (Eval (FromList '["a", "b"])) (Eval (FromList '[ "c", "d", "a", "b", "f", "g", "a", "b", "h"]))) :: [Text]8= '[ 'Text '["c", "d"], 'Text '["f", "g"], 'Text '["h"]]ifcf-containersYStrip the space, newline and tab -symbols from the beginning and and of type-level text.ExampleF:kind! Eval (Strip ('Text '[" ", " ", "a", "a", "m", "u", " ", "\n"]))GEval (Strip ('Text '[" ", " ", "a", "a", "m", "u", " ", "\n"])) :: Text= 'Text '["a", "a", "m", "u"]jfcf-containersDropAround for type-level text.ExampleM:kind! Eval (DropAround S.IsDigit ('Text '["3","4","a","a","m","u","1","2"]))NEval (DropAround S.IsDigit ('Text '["3","4","a","a","m","u","1","2"])) :: Text= 'Text '["a", "a", "m", "u"]kfcf-containers'DropWhileEnd for type-level text. === ExampleG:kind! Eval (DropWhileEnd S.IsDigit ('Text '["a","a","m","u","1","2"]))HEval (DropWhileEnd S.IsDigit ('Text '["a","a","m","u","1","2"])) :: Text= 'Text '["a", "a", "m", "u"]lfcf-containersDropWhile for type-level text.ExampleD:kind! Eval (DropWhile S.IsDigit ('Text '["1","2","a","a","m","u"]))EEval (DropWhile S.IsDigit ('Text '["1","2","a","a","m","u"])) :: Text= 'Text '["a", "a", "m", "u"]mfcf-containers!TakeWhileEnd for type-level text.ExampleQ:kind! Eval (TakeWhileEnd (Not <=< S.IsDigit) ('Text '["1","2","a","a","m","u"]))REval (TakeWhileEnd (Not <=< S.IsDigit) ('Text '["1","2","a","a","m","u"])) :: Text= 'Text '["a", "a", "m", "u"]nfcf-containersTakeWhile for type-level text.ExampleN:kind! Eval (TakeWhile (Not <=< S.IsDigit) ('Text '["a","a","m","u","1","2"]))OEval (TakeWhile (Not <=< S.IsDigit) ('Text '["a","a","m","u","1","2"])) :: Text= 'Text '["a", "a", "m", "u"]ofcf-containersDropEnd for type-level text.Example?:kind! Eval (DropEnd 2 ('Text '["a", "a", "m", "u", "n", "a"]))@Eval (DropEnd 2 ('Text '["a", "a", "m", "u", "n", "a"])) :: Text= 'Text '["a", "a", "m", "u"]pfcf-containersDrop for type-level text.Example<:kind! Eval (Drop 2 ('Text '["a", "a", "m", "u", "n", "a"]))=Eval (Drop 2 ('Text '["a", "a", "m", "u", "n", "a"])) :: Text= 'Text '["m", "u", "n", "a"]qfcf-containersTakeEnd for type-level text.Example::kind! Eval (TakeEnd 4 ('Text '["h", "a", "a", "m", "u"]));Eval (TakeEnd 4 ('Text '["h", "a", "a", "m", "u"])) :: Text= 'Text '["a", "a", "m", "u"]rfcf-containersTake for type-level text.Example7:kind! Eval (Take 4 ('Text '["a", "a", "m", "u", "n"]))8Eval (Take 4 ('Text '["a", "a", "m", "u", "n"])) :: Text= 'Text '["a", "a", "m", "u"]sfcf-containersAll for type-level text.Example::kind! Eval (All S.IsDigit ('Text '["a","a","m","u","1"]));Eval (All S.IsDigit ('Text '["a","a","m","u","1"])) :: Bool= 'False2:kind! Eval (All S.IsDigit ('Text '["3","2","1"]))3Eval (All S.IsDigit ('Text '["3","2","1"])) :: Bool= 'Truetfcf-containersAny for type-level text.Example::kind! Eval (Any S.IsDigit ('Text '["a","a","m","u","1"]));Eval (Any S.IsDigit ('Text '["a","a","m","u","1"])) :: Bool= 'True6:kind! Eval (Any S.IsDigit ('Text '["a","a","m","u"]))7Eval (Any S.IsDigit ('Text '["a","a","m","u"])) :: Bool= 'Falseufcf-containersConcatMap for type-level text.Example:{ "data IsIsymb :: Symbol -> Exp Bool2type instance Eval (IsIsymb s) = Eval ("i" S.== s)#data Isymb2aa :: Symbol -> Exp Text&type instance Eval (Isymb2aa s) = Eval (If (IsIsymb @@ s)! (Pure ('Text '["a","a"])) (Pure ('Text '[s])) ):}C:kind! Eval (ConcatMap Isymb2aa ('Text '["i","m","u"," ","i","h"]))DEval (ConcatMap Isymb2aa ('Text '["i","m","u"," ","i","h"])) :: Text1= 'Text '["a", "a", "m", "u", " ", "a", "a", "h"]vfcf-containersConcat for type-level text.ExampleC:kind! Eval (Concat '[ 'Text '["l","a"], 'Text '["k","a","n","a"]])DEval (Concat '[ 'Text '["l","a"], 'Text '["k","a","n","a"]]) :: Text'= 'Text '["l", "a", "k", "a", "n", "a"]wfcf-containersReplace for type-level text.Examplej:kind! Eval (Replace ('Text '["t","u"]) ('Text '["l","a"]) ('Text '["t","u","u","t","u","t","t","a","a"]))kEval (Replace ('Text '["t","u"]) ('Text '["l","a"]) ('Text '["t","u","u","t","u","t","t","a","a"])) :: Text6= 'Text '["l", "a", "u", "l", "a", "t", "t", "a", "a"]xfcf-containersReverse for type-level text.Example3:kind! Eval (Reverse ('Text '["a", "a", "m", "u"]))4Eval (Reverse ('Text '["a", "a", "m", "u"])) :: Text= 'Text '["u", "m", "a", "a"]?:kind! Eval (Reverse =<< Reverse ('Text '["a", "a", "m", "u"]))@Eval (Reverse =<< Reverse ('Text '["a", "a", "m", "u"])) :: Text= 'Text '["a", "a", "m", "u"]yfcf-containers Intersperse for type-level text.Example;:kind! Eval (Intersperse "." ('Text '["a", "a", "m", "u"]))<Eval (Intersperse "." ('Text '["a", "a", "m", "u"])) :: Text,= 'Text '["a", ".", "a", ".", "m", ".", "u"]zfcf-containers Intercalate for type-level text.Exampleq:kind! Eval (Intercalate ('Text '[" ", "&", " "]) ('[ 'Text '["a", "a", "m", "u"], 'Text '["v", "a", "l", "o"]]))rEval (Intercalate ('Text '[" ", "&", " "]) ('[ 'Text '["a", "a", "m", "u"], 'Text '["v", "a", "l", "o"]])) :: Text@= 'Text '["a", "a", "m", "u", " ", "&", " ", "v", "a", "l", "o"]{fcf-containersMap for type-level text.Example:{ "data IsIsymb :: Symbol -> Exp Bool2type instance Eval (IsIsymb s) = Eval ("i" S.== s)$data Isymb2e :: Symbol -> Exp Symbol%type instance Eval (Isymb2e s) = Eval (If (IsIsymb @@ s) (Pure "e") (Pure s) ):}0:kind! Eval (Map Isymb2e ('Text '["i","m","u"]))1Eval (Map Isymb2e ('Text '["i","m","u"])) :: Text= 'Text '["e", "m", "u"]|fcf-containersJCompare the length of type-level text to given Nat and give the Ordering.Example;:kind! Eval (CompareLength ('Text '["a", "a", "m", "u"]) 3)@Eval (CompareLength ('Text '["a", "a", "m", "u"]) 3) :: Ordering= 'GT}fcf-containers5Take all except the last symbol from type-level text.Example5:kind! Eval (Init ('Text '["a", "a", "m", "u", "n"]))<Eval (Init ('Text '["a", "a", "m", "u", "n"])) :: Maybe Text%= 'Just ('Text '["a", "a", "m", "u"]):kind! Eval (Init ('Text '[]))%Eval (Init ('Text '[])) :: Maybe Text = 'Nothing~fcf-containers"Get the tail of a type-level text.Example5:kind! Eval (Tail ('Text '["h", "a", "a", "m", "u"]))<Eval (Tail ('Text '["h", "a", "a", "m", "u"])) :: Maybe Text%= 'Just ('Text '["a", "a", "m", "u"]):kind! Eval (Tail ('Text '[]))%Eval (Tail ('Text '[])) :: Maybe Text = 'Nothingfcf-containers(Get the first symbol of type-level text.Example0:kind! Eval (Head ('Text '["a", "a", "m", "u"]))9Eval (Head ('Text '["a", "a", "m", "u"])) :: Maybe Symbol = 'Just "a":kind! Eval (Head ('Text '[]))'Eval (Head ('Text '[])) :: Maybe Symbol = 'Nothingfcf-containers)Get the last symbol from type-level text.Example7:kind! Eval (Unsnoc ('Text '["a", "a", "m", "u", "n"]))9Eval (Unsnoc ('Text '["a", "a", "m", "u", "n"])) :: MaybeD (Symbol, Text)+= 'Just '("n", 'Text '["a", "a", "m", "u"]) :kind! Eval (Unsnoc ('Text '[]))1Eval (Unsnoc ('Text '[])) :: Maybe (Symbol, Text) = 'Nothingfcf-containers*Get the first symbol from type-level text.Example7:kind! Eval (Uncons ('Text '["h", "a", "a", "m", "u"]))9Eval (Uncons ('Text '["h", "a", "a", "m", "u"])) :: MaybeD (Symbol, Text)+= 'Just '("h", 'Text '["a", "a", "m", "u"]) :kind! Eval (Uncons ('Text '[]))1Eval (Uncons ('Text '[])) :: Maybe (Symbol, Text) = 'Nothingfcf-containersAppend two type-level texts.Example<:kind! Eval (Append ('Text '["a", "a"]) ('Text '["m", "u"]))=Eval (Append ('Text '["a", "a"]) ('Text '["m", "u"])) :: Text= 'Text '["a", "a", "m", "u"]fcf-containers-Add a symbol to the end of a type-level text.Example/:kind! Eval (Snoc ('Text '["a", "a", "m"]) "u")0Eval (Snoc ('Text '["a", "a", "m"]) "u") :: Text= 'Text '["a", "a", "m", "u"]fcf-containers3Add a symbol to the beginning of a type-level text.Example 4:kind! Eval (Cons "h" ('Text '["a", "a", "m", "u"]))YEval (Cons "h" ('Text '["a", "a", "m", "u"])) :: Text = 'Text '["h", "a", "a", "m", "u"]fcf-containersLengthExample-:kind! Eval (Length =<< FromList '["a", "b"])-Eval (Length =<< FromList '["a", "b"]) :: Nat= 2fcf-containersNullExample+:kind! Eval (Null =<< FromList '["a", "b"]),Eval (Null =<< FromList '["a", "b"]) :: Bool= 'False:kind! Eval (Null =<< Empty)Eval (Null =<< Empty) :: Bool= 'Truefcf-containersToSymbolExample9:kind! Eval (ToSymbol =<< FromList '["w", "o", "r", "d"])<Eval (ToSymbol =<< FromList '["w", "o", "r", "d"]) :: Symbol= "word"fcf-containers#Get the type-level list out of the .Example-:kind! Eval (ToList =<< FromList '["a", "b"])2Eval (ToList =<< FromList '["a", "b"]) :: [Symbol] = '["a", "b"]fcf-containers6Use FromList to construct a Text from type-level list.Example:kind! Eval (FromList '["h", "e", "l", "l", "u", "r", "e", "i"]) Eval (FromList '["h", "e", "l", "l", "u", "r", "e", "i"]) :: Text = 'Text '["h", "e", "l", "l", "u", "r", "e", "i"]fcf-containers SingletonExample:kind! Eval (Singleton "a")Eval (Singleton "a") :: Text= 'Text '["a"]fcf-containersEmptyExample:kind! (Eval Empty :: Text)(Eval Empty :: Text) :: Text = 'Text '[]+See also the other examples in this module.fcf-containersP is a data structure, that is, a list to hold type-level symbols of length one..`abcdefghijklmnopqrstuvwxyz{|}~.~}|{zyxwvutsrqponmlkjihgfedcba`.Tree data-structure for type-level programming(c) gspia 2020-BSDgspiaSafe -.HUVV fcf-containersGet the levels from a .Example_:kind! Eval (Levels ('Node 1 '[ 'Node 2 '[ 'Node 3 '[ 'Node 4 '[]]], 'Node 5 '[ 'Node 6 '[]]]))cEval (Levels ('Node 1 '[ 'Node 2 '[ 'Node 3 '[ 'Node 4 '[]]], 'Node 5 '[ 'Node 6 '[]]])) :: [[Nat]]"= '[ '[1], '[2, 5], '[3, 6], '[4]]fcf-containersGet the forests from a list of s.fcf-containers"Get the root nodes from a list of s.fcf-containersGet the forest from a .fcf-containersGet the root node from a .fcf-containers Flatten a .Example`:kind! Eval (Flatten ('Node 1 '[ 'Node 2 '[ 'Node 3 '[ 'Node 4 '[]]], 'Node 5 '[ 'Node 6 '[]]]))bEval (Flatten ('Node 1 '[ 'Node 2 '[ 'Node 3 '[ 'Node 4 '[]]], 'Node 5 '[ 'Node 6 '[]]])) :: [Nat]= '[1, 2, 3, 4, 5, 6]fcf-containers Unfold for a .fcf-containers Unfold for a .Example(data BuildNode :: Nat -> Exp (Nat,[Nat]):{$ type instance Eval (BuildNode x) =( If (Eval ((2 TL.* x TL.+ 1) >= 8)) '(x, '[])/ '(x, '[2 TL.* x, (2 TL.* x) TL.+ 1 ]):}$:kind! Eval (UnfoldTree BuildNode 1))Eval (UnfoldTree BuildNode 1) :: Tree Nat= 'Node 1, '[ 'Node 2 '[ 'Node 4 '[], 'Node 5 '[]],, 'Node 3 '[ 'Node 6 '[], 'Node 7 '[]]]fcf-containersFold a type-level .fcf-containersWSame as in containers, except not used for any term-level computation in this module.fcf-containersWSame as in containers, except not used for any term-level computation in this module. CTree-structures working with Algebras, ColAlgebras, and other stuff(c) gspia 2020-BSDgspiaSafe -.HUVmV fcf-containersRBTreeF is a btree functor. At the moment, it is used to build sorting algorithms.fcf-containers#Fibonaccis with Hylo, not efficientExample:kind! Eval (Fib 10)Eval (Fib 10) :: Nat= 55fcf-containersCoAlgebra for the Fib-function.fcf-containersMCoAlgebra to build TreeF's. This is an example from containers-package. See  and example in there.Q:kind! Eval (Ana BuildNodeCoA 1) :kind! Eval (Hylo CountNodesAlg BuildNodeCoA 1)fcf-containers.Size of the Tree is the number of nodes in it.ExampleSize is defined as % Cata CountNodesAlg =<< TreeToFix tr & and can be used with the following. (data BuildNode :: Nat -> Exp (Nat,[Nat]):{$ type instance Eval (BuildNode x) =( If (Eval ((2 TL.* x TL.+ 1) >= 8)) '(x, '[])0 '(x, '[ 2 TL.* x, (2 TL.* x) TL.+ 1 ]):}-:kind! Eval (Size =<< UnfoldTree BuildNode 1)-Eval (Size =<< UnfoldTree BuildNode 1) :: Nat= 7fcf-containersCount the nodes of TreeF. See the  for an example.fcf-containers(Sum the nodes of TreeF containing Nats. See the implementation of  for an example.fcf-containersVA function to transform a Tree into fixed structure that can be used by Cata and Ana.See the implementation of  for an example.fcf-containers is functor for s. ! has Map-instance (on structure). +Type-level sorting algorithms and utilities(c) gspia 2020-BSDgspiaSafe -.HUV|{fcf-containers%Qsort - give the comparison function a -> a -> Exp BoolC comparing your list elements and then Qsort will order the list.Example*:kind! Eval (Qsort (N.<) '[5,3,1,9,4,6,3]),Eval (Qsort (N.<) '[5,3,1,9,4,6,3]) :: [Nat]= '[1, 3, 3, 4, 5, 6, 9]7:kind! Eval (Qsort (S.<) '[ "bb", "e", "a", "e", "d" ])<Eval (Qsort (S.<) '[ "bb", "e", "a", "e", "d" ]) :: [Symbol]= '["a", "bb", "d", "e", "e"]fcf-containersComparison for Nat lists.Useful when sorting with Qsort.fcf-containersComparison for Symbol lists.Useful when sorting with Qsort.fcf-containersComparison for the Nats.=TODO: Would this fit to Fcf.Data.Nat on first-class-families?fcf-containersbGive true if the first list is before the second, given the comparison function for the elements.fcf-containers9Compare lists with the given comparison for the elements.    !"#$%&'()*+,-./'0123456789:;<=>?@ABCDEFGHHEI9:;JK<=>?BDFGLLMNOPQRSTUVW#X YZ[\]^_`abcdefghijkl%#7mnopqrXst=uEFGvvwxyz{|}~<          fcf-containers-0.3.0-inplaceFcf.Data.SymbolFcf.Alg.Morphism Fcf.Alg.List Fcf.Data.MapC Fcf.Data.Set Fcf.Data.Text Fcf.Data.Tree Fcf.Alg.Tree Fcf.Alg.Sortghc-prim GHC.TypesSymbolSecondFirstHyloAnaCata CoAlgebraAlgebraFixEqualToListSnocAnyOrAllAndTails IsInfixOf IsSuffixOf IsPrefixOf_ IsPrefixOfBreakSpan Intercalate PrependToAll InterspersePartHelp PartitionSumProdAlgSumAlgLenAlg ListToFixListFConsFNilF FilterWithKeyFilterAssocsKeysElemsFoldr MapWithKeyMapDisjoint Intersection DifferenceUnionSizeNull NotMemberMemberLookupAdjustDelete InsertWithInsertFromList SingletonEmptyMapCPowerSetIsProperSubsetOf IsSubsetOfSet==><>=<= SymbolOrdIsDigit IsSpaceDelimIsTab IsNewLineIsSpaceAppendUnwordsUnlinesWordsLinesSplitSplitOnStrip DropAround DropWhileEnd DropWhile TakeWhileEnd TakeWhileDropEndDropTakeEndTake ConcatMapConcatReplaceReverse CompareLengthInitTailHeadUnsnocUnconsConsLengthToSymbolTextLevels SubFLevels GetForestsGetRoots GetForestGetRootFlatten UnfoldForest UnfoldTreeFoldTreeForestTreeNodeBTreeFBEmptyFBNodeFFibBuildFibTreeCoA BuildNodeCoA CountNodesAlg SumNodesAlg TreeToFixTreeFNodeFPartCmpQsortInordPartHlp NatListOrd SymbolListOrdNatOrdListOrdListCmp ListCmpFnd SplitLoop SplitTakeSOLoopSOTake