>1j      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ non-portable experimentalhpacheco@di.uminho.ptThe final object. ! The only possible value of type  is . The bottom value for any type. 2 It is many times used just for type annotations. (Creates a point to the terminal object. Converts elements into points. The infix split combinator. &Injects a value to the left of a sum. 'Injects a value to the right of a sum. The infix either combinator. The infix sum combinator. $Alias for the infix sum combinator. The application combinator. +The infix combinator for a constant point. 4Guard combinator that operates on Haskell booleans. :Infix guarc combinator that simulates the postfix syntax.  The uncurried split combinator. !The uncurried either combinator. &The uncurried composition combinator.  Swap the elements of a product. Swap the elements of a sum. +Distribute products over the left of sums. +Distribute sums over the left of products. ,Distribute products over the right of sums. ,Distribute sums over the right of products. 'Associate nested products to the left. )Associates nested products to the right. $Associates nested sums to the left. %Associates nested sums to the right.     non-portable experimentalhpacheco@di.uminho.pt6Semantically, we can say that 32 f :@!: 32 g = 32 (f ':@: g). Semantically, we can say that 32 f :*!: 32 g = 32 (f :*: g). !"Semantically, we can say that 32 f :+!: 32 g = 32 (f :+: g). #$%Semantically, we can say that % t = 32 (>= t). &'(In order to simplify type-level composition of functors, we can create fixpoint combinators that implicitely assume fixpoint application. Semantically, we can say that ( = 32 A@. )*The *i class provides the value-level translation between data types and their sum of products representations +6Packs a sum of products into one equivalent data type ,8unpacks a data type into the equivalent sum of products -VShort alias to express the structurally equivalent sum of products for some data type . Polytypic Prelude.Functor# class for functor representations /aFor desambiguation purposes, the type of the functor must be passed as an explicit paramaeter to / !The mapping over representations 0#Family of functor representations. The 0 family implements the implicit coercion between the application of a functor and the structurally equivalent sum of products. BFunctors applied to types can be represented as sums of products. 1+Family of patterns functors of data types. nThe type function is not necessarily injective, this is, different data types can have the same base functor. Semantically, we can say that a = 32 f. 2Explicit fixpoint operator. 34UThe unfolding of the fixpoint of a functor is a the functor applied to its fixpoint. 4( is specialized with the application of 0) in order to subsume functor application 5Composition of functors. 678Product of functors. 9:Sum of functors. ;<=Constant functor. >?@Identity functor. ABCPolytypic map function FA value of a data type that is the fixed point of the desired functor 0The mapping over the equivalent sum of products DEFGHIJ ExpandingAcontracting the fixed point of a functor is the same as consuming applying it's single type constructor #The list functor maps the specific  function over lists of types jThe composition functor applies in the nesting of the mapping function to the nested functor applications KThe product functor recursively applies the mapping function to both sides MThe sum functor recursively applies the mapping function to each alternative 1The constant functor preserves the argument type DThe identity functor applies the mapping function the argument type / !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ/@AB=>?:<;8956723410./-C*+,()%&'"#$ !DEFGHIJ/ ! !"#$#$%&'&'())*+,+,-.//012343456767899:<;;<=>?>?@ABABCDEFGHIJ non-portable experimentalhpacheco@di.uminho.ptK2In futumorphisms we add an alternative annotation c to the base functor of type b. L-In histomorphisms we add an extra annotation c to the base functor of type a. M,In accumulations we add an extra annotation b to the base functor of type a. NXIn zygomorphisms we extend the recursive occurences in the base functor functor of type a with an extra annotation b. OXThe functor of intermediate type of a paramorphism is the functor of the generated type b D with an alternative annotation to itself in recursive definitions. PWThe functor of intermediate type of a paramorphism is the functor of the consumed type a G extended with an extra annotation to itself in recursive definitions. QDefinition of an hylomorphism R1Definition of a catamorphism as an hylomorphism. Catamorphisms model the fundamental pattern of iteration, where constructors for recursive datatypes are repeatedly consumed by arbitrary functions.  They are usually called folds. S(Recursive definition of a catamorphism. T1Definition of an anamorphism as an hylomorphism. ]Anamorphisms resembles the dual of iteration and, hence, dene the inverse of catamorphisms. K Instead of consuming recursive types, they produce values of those types. U(Recursive definition of an anamorphism. VDefinition of a paramorphism. _Paramorphisms supply the gene of a catamorphism with a recursively computed copy of the input. 7The first introduction to paramorphisms is reported in  >http://www.cs.uu.nl/research/techreps/repo/CS-1990/1990-04.pdf. W(Recursive definition of a paramorphism. X1Definition of an apomorphism as an hylomorphism. Apomorphisms are the dual recursion patterns of paramorphisms, and therefore they can express functions dened by primitive corecursion. &They were introduced independently in  .http://www.cs.ut.ee/~varmo/papers/nwpt97.ps.gz and HProgram Construction and Generation Based on Recursive Types, MSc thesis. Y(Recursive definition of an apomorphism. Z1Definition of a zygomorphism as an hylomorphism. !Zygomorphisms were introduced in  Bhttp://dissertations.ub.rug.nl/faculties/science/1990/g.r.malcolm/. They can be seen as the asymmetric form of mutual iteration, where both a data consumer and an auxiliary function are defined ( 0http://www.fing.edu.uy/~pardo/papers/njc01.ps.gz). [2Definition of an accumulation as an hylomorphism. Accumulations  1http://www.fing.edu.uy/~pardo/papers/wcgp02.ps.gzS are binary functions that use the second parameter to store intermediate results. The so called accumulation techniquen is tipically used in functional programming to derive efficient implementations of some recursive functions. \oDefinition of an histomorphism as an hylomorphism (as long as the catamorphism is defined as an hylomorphism). Histomorphisms ( (http://cs.ioc.ee/~tarmo/papers/inf.ps.gz) capture the powerfull schemes of course-of-value iteration, and differ from catamorphisms for being able to apply the gene function at a deeper depth of recursion. B In other words, they allow to reuse sub-sub constructor results. ]The combinator ]E unpacks the functor of an histomorphism and selects the annotation. ^The combinator ^F unpacks the functor of an histomorphism and discards the annotation. _lDefinition of a futumorphism as an hylomorphism (as long as the anamorphism is defined as an hylomorphism). AFutumorphisms are the dual of histomorphisms and are proposed as 'cocourse-of-argument' coiterators by their creators ( (http://cs.ioc.ee/~tarmo/papers/inf.ps.gz). xIn the same fashion as histomorphisms, it allows to seed the gene with multiple levels of depth instead of having to do ' all at once' with an anamorphism. `The combinator `< packs the functor of a futumorphism from the base functor. aThe combinator a: packs the functor of an futumorphism from an annotation. b2Definition of a dynamorphism as an hylomorphisms. Dynamorphisms ( 1http://math.ut.ee/~eugene/kabanov-vene-mpc-06.pdf^) are a more general form of histomorphisms for capturing dynaming programming constructions. iInstead of following the recursion pattern of the input via structural recursion (as in histomorphisms), i dynamorphisms allow us to reuse the annotated structure in a bottom-up approach and avoiding rebuilding Z it every time an annotation is needed, what provides a more efficient dynamic algorithm. c3Definition of a chronomorphism as an hylomorphism. PThis recursion pattern subsumes histomorphisms, futumorphisms and dynamorphisms r and can be seen as the natural hylomorphism generalization from composing an histomorphism after a futumorphism.  Therefore, chronomorphisms can ' look back' when consuming a type and ' jump forward' when generating one, via it's fold/!unfold operations, respectively. UThe notion of chronomorphism is a recent recursion pattern (at least known as such). - The first and single reference available is  8http://comonad.com/reader/2008/time-for-chronomorphisms/. d,The Fixpoint combinator as an hylomorphism. d is a fixpoint combinator if d =    (  d). "After expanding the denitions of ,  and  A we see that this corresponds to the expected pointwise equation d f = f (d f). KLMNOPQRSTUVWXYZ[\]^_`abcdQRSTUPVWOXYNZM[L\]^K_`abcdKLMNOPQRSTUVWXYZ[\]^_`abcd non-portable experimentalhpacheco@di.uminho.pte=Class for mapping observations over functor representations. ffDerives a type representation for a functor. This is used for showing the functor for reursion trees. gdWatch values of a functor. Since the fixpoint of a functor recurses over himself, we cannot use the 8 instance for functor values applied to their fixpoint. h3Maps an observation over a functor representation. i#Polytypic mapping of observations. efghiefghiefghfghi non-portable experimentalhpacheco@di.uminho.pt jNRedefinition of hylomorphisms with observation of the intermediate data type. k;Redefinition of catamorphisms as observable hylomorphisms. l:Redefinition of anamorphisms as observable hylomorphisms. m;Redefinition of paramorphisms as observable hylomorphisms. n:Redefinition of apomorphisms as observable hylomorphisms. o;Redefinition of zygomorphisms as observable hylomorphisms. p;Redefinition of accumulations as observable hylomorphisms. q<Redefinition of histomorphisms as observable hylomorphisms. r;Redefinition of futumorphisms as observable hylomorphisms. s;Redefinition of dynamorphisms as observable hylomorphisms. t=Redefinition of chronomorphisms as observable hylomorphisms. jklmnopqrst jklmnopqrst jklmnopqrst non-portable experimentalhpacheco@di.uminho.ptuu%Datatype declaration of a rose tree. vw%Datatype declaration of a leaf tree. xyz'Datatype declaration of a binary tree. {|}(The fixpoint of the functor of streams. ~The fixpoint of the functor that represents a virtual matrix used to accumulate and look up values for the edit distance algorithm. Since matrixes are not inductive types, a walk-through of a matrix is used, consisting in a list of values from the matrix ordered predictability. 1For a more detailed explanation, please refer to  1http://math.ut.ee/~eugene/kabanov-vene-mpc-06.pdf. CThe fixpoint of the list functor with a specific terminal element. UThe fixpoint of the functor representing trees with maximal branching factor of two. 5The fixpoint of the functor for a binary shape tree. NThe fixpoint of the functor that is either a constant or defined recursively.  Pre-defined algebraic addition. LDefinition of algebraic addition as an anamorphism in the point-wise style. 2Defition of algebraic addition as an anamorphism. 5Definition of algebraic addition as an hylomorphism. 5Definition of algebraic addition as an accumulation. 4Definition of algebraic addition as an apomorphism. Pre-defined algebraic product. 3Definition of algebraic product as an hylomorphism  Pre-defined ' greater than' comparison. Definition of ' greater than' as an hylomorphism. 7Native recursive definition of the factorial function. HRecursive definition of the factorial function in the point-free style. bRecursive definition of the factorial function in the point-free style with structural recursion. 9Definition of the factorial function as an hylomorphism. 8Definition of the factorial function as a paramorphism. 8Definition of the factorial function as a zygomorphism. 7Native recursive definition of the fibonacci function. HRecursive definition of the fibonacci function in the point-free style. bRecursive definition of the fibonacci function in the point-free style with structural recursion. 9Definition of the fibonacci function as an hylomorphism. :Definition of the fibonacci function as an histomorphism. 8Definition of the fibonacci function as a dynamorphism. CNative recursive definition for the binary partitions of a number. YThe number of binary partitions for a number n is the number of unique ways to partition 4 this number (ignoring the order) into powers of 2. I | Definition of the binary partitioning of a number as an hylomorphism. FDefinition of the binary partitioning of a number as an hylomorphism. EDefinition of the binary partitioning of a number as a dynamorphism. :Recursive definition of the average of a set of integers. BDefinition of the average of a set of integers as a catamorphism. 0Pre-defined wrapping of an element into a list. 0Definition of wrapping in the point-free style. 6Definition of the tail of a list as a total function. :Definition of the tail of a list in the point-free style. 4Definition of the tail of a list as an anamorphism. 4Definition of the tail of a list as a paramorphism. ,Native recursion definition of list length. =Recursive definition of list length in the point-free style. WRecursive definition of list length in the point-free style with structural recursion. .Definition of list length as an hylomorphism. -Definition of list length as an anamorphism. -Definition of list length as a catamorphism. /Native recursive definition of list filtering. 1Definition of list filtering as an catamorphism. 0Generation of infinite lists as an anamorphism. 4Finite replication of an element as an anamorphism. 2Generation of a downwards list as an anamorphism. *Ordered list insertion as an apomorphism. *Ordered list insertion as a paramorphism. ;Append an element to the end of a list as an hylomorphism. :Append an element to the end of a list as an apomorphism. ACreates a bubble from a list. Used in the bubble sort algorithm. BExtraction of a number of elements from a list as an anamorphism. LNative recursive definition for partitioning a list at a specified element. NDefinition for partitioning a list at a specified element as an hylomorphism. )Incremental summation as a catamorphism. KIncrementation the elements of a list by a specified value a catamorphism. .Definition of list mapping as a catamorphism. 0Definition of list reversion as a catamorphism. :Definition of the quicksort algorithm as an hylomorphism. ;Definition of the bubble sort algorithm as an anamorphism. >Definition of the insertion sort algorithm as a catamorphism. :Definition of the heap sort algorithm as an hylomorphism. *Malcolm downwards accumulations on lists. ;Malcom downwards accumulations on lists as an anamorphism. PUncurried version of Malcom downwards accumulations on lists as an anamorphism. <Definition of the zip for lists of pairs as an anamorphism. <Definition of the subsequences of a list as a catamorphism.  Pre-defined list concatenation. &List concatenation as a catamorphism. 'List concatenation as an hylomorphism. =Native recursive definition of lists-of-lists concatenation. >Definition of lists-of-lists concatenation as an anamorphism. 6Sorted concatenation of two lists as an hylomorphism. 0Definition of inter addition as a catamorphism. 7Native recursive definition of integer multiplication. 8Definition of integer multiplication as a catamorphism. <Native recursive definition of the edit distance algorithm. KEdit distance is a classical dynamic programming algorithm that calculates P a measure of distance or dierence between lists with comparable elements. 0The edit distance algorithm as an hylomorphism. /The edit distance algorithm as a dynamorphism.  Stream head.  Stream tail. >Definition of a stream sequence generator as an anamorphism. &Identity o streams as an anamorphism. (Mapping over streams as an anamorphism. ,Malcolm downwards accumulations on streams. =Malcom downwards accumulations on streams as an anamorphism. RUncurried version of Malcom downwards accumulations on streams as an anamorphism. <Promotes streams elements to streams of singleton elements. =Definition of parwise exchange on streams as a futumorphism. BCounting the number of leaves in a binary tree as a catamorphism. ACounting the number of nodes in a binary tree as a catamorphism. GGeneration of a binary tree with a specified height as an anamorphism. :The preorder traversal on binary trees as a catamorphism. ;The postorder traversal on binary trees as a catamorphism. 5Extract the leaves of a leaf tree as a catamorphism. DGeneration of a leaft tree of a specified height as an anamorphism. 7Calculate the height of a leaf tree as a catamorphism. 9The postorder traversal on rose trees as a catamorphism. CGeneration of a rose tree of a specified height as an anamorphism. vuvwxyz{|}~u~}z|{wyxuvuuvvwyxxyz|{{|}~ non-portable experimentalhpacheco@di.uminho.pt ADefinition of the observable length function as an hylomorphism. @Definition of the observable length function as an anamorphism. @Definition of the observable length function as a catamorphism. DDefinition of the observable factorial function as an hylomorphism. CDefinition of the observable factorial function as a paramorphism. CDefinition of the observable factorial function as a zygomorphism. DDefinition of the observable fibonacci function as an hylomorphism. EDefinition of the observable fibonacci function as an histomorphism. CDefinition of the observable fibonacci function as a dynamorphism. DDefinition of the observable quicksort function as an hylomorphism. >Definition of the observable tail function as a paramorphism. >Definition of the observable add function as an accumulation.       !"#$%&'()*+,-./0123456789::;<=>??@ABCCDEEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  pointless-haskell-0.0.1Generics.Pointless.CombinatorsGenerics.Pointless.Functors$Generics.Pointless.RecursionPatterns#Generics.Pointless.Observe.Functors,Generics.Pointless.Observe.RecursionPatterns$Generics.Pointless.Examples.Examples#Generics.Pointless.Examples.ObserveOne_Lbangpnt/\><inlinr\/-|-<>app!grd?spliteithrcompswapcoswapdistlundistldistrundistrassoclassocrcoassoclcoassocr:@!:FixComp unFixComp:*!:FixProd unFixProd:+!:FixSumunFixSumKFixConst unFixConstIFixIdMuinnoutFFunctorfmapRepPFFixunFix:@:CompunComp:*::+:InrInlConstunConstIdunIdpmapnilconszerosucktruefalse maybe2boolFutuHistoAccumZygoApoParahylocatacataRecanaanaRecparaparaRecapoapoReczygoaccumhistooutloutrfutuinnlinnrdynachronofixFunctorO functorOfwatchfmapOomaphyloOcataOanaOparaOapoOzygoOaccumOhistoOfutuOdynaOchronoORoseForestLTreeBranchLeafTreeNodeEmptyStream EditDistLEditDistNeListBTreeBSTreeFromaddaddAnaPWaddAnaaddHyloaddAccumaddApoprodprodHylogtgtHylofactfactPFfactPF'factHylofactParafactZygofibfibPFfibPF'fibHylofibHistofibDynabpbpHylobpDynaaverage averageCatawrapwrapPFtailtailPFtailCatatailParalengthlengthPF lengthPF' lengthHylo lengthAna lengthCatafilter filterCata repeatAna replicateAna downtoAna insertApo insertParasnocsnocApobubbletakeAna partition partitionHyloisumfisummapCata reverseAnaqsortbsortisortmsplitmsorthsorthsplitmalcolm malcolmAna malcolmAna'zipAna subsequencescatcatCatacatHyloconcat concatCatamergesumCatamultmultCatasortededitdist editdistHylo editDistDynaheadStailSgenerateidStream mapStreammalcolmS malcolmSAna malcolmSAna'initsexchFutunleavesnnodesgenTreepreTreepostTreeleavesgenLTreeheightpreRosepostRosegenRose lengthHyloO lengthAnaO lengthCataO factHyloO factParaO factZygoOfibHyloO fibHistoOfibDynaO qsortHyloO tailParaO addAccumO$fMuFix $fFunctor[]baseGHC.Basemap $fFunctor:@: $fFunctor:*: $fFunctor:+:$fFunctorConst $fFunctorId.idnuGHC.ShowShowone