>6ϑ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableNone%&*+2349;<=DOQRT  Products of Monoids are Monoid s themselves. But coproducts of Monoids are not. However, the free Monoid applied to the coproduct is a Monoid-, and it is the coproduct in the category of MonoidQs. This is also called the free product, and generalizes to any algebraic class.The free functor for class c.Free c a< is basically an expression tree with operations from class c' and variables/placeholders of type a, created with  \. Monadic bind allows you to replace each of these variables with another sub-expression.  S allows you to create `Free c` values, together with the operations from the class c.  & is the destructor of `Free c` values. counit = rightAdjunct id leftAdjunct f = f . unit transform f as = as >>= f unit -transform f . transform g = transform (g . f) (unfold f = coproduct (unfold f) unit . f and > are useful here. For example, the following creates the list [1..10] as a  Free Monoid: (unfold (b -> if b == 0 then mempty else  (b - 1) <>  b) 10 convert = rightAdjunct pure #convertClosed = rightAdjunct absurdDerive the instances of  c a for the class c, ,  and . For example: deriveInstances ''Num+  !"#$   !  !"#$ BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe%&*9;<=OQRT'"The cofree functor for constraint c., unit = leftAdjunct id- rightAdjunct f = counit . f%&'()*+,-./0123456%&'()*+,-./012'()*+,-6543.&/01%2%&'()*+,-./0123456 BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe +9;<=?DOQRT71Automatically find superclasses by searching the 9 instances789:;<=>?@ABCDEFGHIJ789:9:78789:;<=>?@ABCDEFGHIJ BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe %&*9:;OQRTK/The higher order cofree functor for constraint c.MNatural transformations.P unit = leftAdjunct idQ rightAdjunct f = counit . fZ The cofree comonad of a functor.KLMNOPQRSTUVWXYZ[\]KLMNOPQRSTUVWXYMKLNOPQRSTUVWXY]\[ZKLMNOPQRSTUVWXYZ[\] BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe*:OQRT^-The higher order free functor for constraint c.aNatural transformations.d counit = rightAdjunct ide leftAdjunct f = f . unitqThe free monad of a functor.^_`abcdefghijklmnopqrst^_`abcdefghijklma^_`bcdefghijklmtsrqpon^_`abcdefghijklmnopqrst BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableNone*:OQRTuFThe higher order free functor over two type parameters for constraint c.xNatural transformations.{ counit = rightAdjunct id| leftAdjunct f = f . unituvwxyz{|}~ uvwxyz{|}~xuvwyz{|}~uvwxyz{|}~         !"#$%&'()*++,-./0123456789:;<=>?@ABCDEFGHIIJKLMNOPQRSTUUVJKWXYZ[\]^_`abccdeKWfghijklmnopqrstuvwxywz{w|}~(free-functors-0.7-7EAAnL7hZleKHwyjzMAJM2Data.Functor.FreeData.Functor.CofreeData.Constraint.Class1Data.Functor.HCofreeData.Functor.HFreeData.Functor.HHFree InitialObject Coproduct Duplicate getDuplicateExtract getExtractFreerunFreeunit rightAdjunct rightAdjunctF rightAdjunctTcounit leftAdjunct transformunfoldconvert convertClosed coproductinLinRinitialderiveInstances $fShowFree$fShowShowHelper$fAlgebrafShowHelper$fTraversableFree$fFoldableFree$fAlgebrasLiftAFree$fAlgebrafFree $fComonadFree $fMonadFree$fApplicativeFree $fFunctorFreeTerminalObjectProductCofree leftAdjunctFproductoutLoutRterminal $fMonadCofree$fApplicativeCofree$fComonadCofree$fFunctorCofree SuperClass1scls1Class1cls1$fSuperClass1kbh$fSuperClass1kbb"$fClass1(->)BifunctorBiapplicative$fClass1(->)ArrowArrowLoop$fClass1(->)ArrowArrowApply$fClass1(->)ArrowArrowChoice$fClass1(->)ArrowZeroArrowPlus$fClass1(->)ArrowArrowZero$fClass1(->)CategoryArrow$fClass1(->)DivisibleDecidable"$fClass1(->)ContravariantDivisible$fClass1(->)FunctorComonad$fClass1(->)FunctorTraversable$fClass1(->)ApplicativeMonad"$fClass1(->)ApplicativeAlternative$fClass1(->)FunctorApplicativeHCofree:~>hfmaphextend liftCofree lowerCofreecoiterunwrap$fComonadHCofree$fTraversableHCofree$fFoldableHCofree$fFunctorHCofreeHFreerunHFreebindliftFree lowerFreeiterwrap$fDecidableHFree$fDivisibleHFree$fContravariantHFree $fMonadHFree$fAlternativeHFree$fApplicativeHFree$fFunctorHFreeHHFree runHHFree:~~>$fClosedHHFree$fChoiceHHFree$fStrongHHFree$fProfunctorHHFree$fBiapplicativeHHFree$fBifunctorHHFree$fArrowLoopHHFree$fArrowApplyHHFree$fArrowChoiceHHFree$fArrowPlusHHFree$fArrowZeroHHFree $fArrowHHFree$fCategoryTYPEHHFree$fProfunctorMonadHHFree$fProfunctorFunctorHHFree$fBifunctorMonadTYPETYPEHHFree($fBifunctorFunctorTYPETYPETYPETYPEHHFreebaseGHC.ShowShow Data.FoldableFoldableData.Traversable Traversable ShowHelperShowUnitShowRec LiftAFree getLiftAFree