| G. Hutton. A tutorial on the universality and expressiveness of fold. Journal of Functional Programming, 9(4):355372, July 1999. |
....extend it to improve e ciency and to abstract the pattern of the traversal. Although the SSAX parser has been implemented in Scheme, this section will use Haskell notation. The latter is more succinct; furthermore, it is more convenient for direct comparison with important papers on tree folding [5][6] which use Haskell notation. Our trees are represented by the datatype data Tree = Leaf String Nd [Tree] Given such a tree, we turn to our rst problem of concatenating strings attached to all leaves, in their depth rst traversal order. If we view our trees as realizations of an XML ....
.... tree digest (md5Update node ctx) kids Can we separate the task of tree traversal and recursion from the task of transformation of a node and a state The bene ts of encapsulating common patterns of computation as higher order operators instead of using recursion directly are well known [11][5]. For lists, the common pattern of traversal is captured by the familiar foldl and foldr operators, which can be generalized to trees [11] 6] foldt: String a) a] a) Tree a foldt f g (Leaf str) f str foldt f g (Nd kids) g (map (foldt f g) kids) Unlike the functions ....
Hutton, G.: A tutorial on the universality and expressiveness of fold. Journal of Functional Programming, 9(4):355-372, July 1999.
.... been generalized to categorical data types [9,10] and is also known as the factorization of catamorphisms [11] For example, for one direction of the above correspondence, a monoid (a; 0) gives rise to an algebra [a] a satisfying (A I) and (A II) by setting malg = fold 0 : We refer to [12] for a detailed discussion of the recursion operator fold . Along this correspondence of Eilenberg Moore algebras for the list monad and monoids, our notion of algebra homomorphism introduced above corresponds exactly to homomorphisms of monoids, as the reader will easily verify. Of particular ....
G. Hutton. A Tutorial on the Universality and Expressiveness of Fold. J. of Functional Programming, 9(4):355-372, July 1999.
....attening transformation has been applied. This line of work has been extended by Riely Prins [15] who introduced a type system that rejects programs for which attening would worsen the depth complexity. We replace Blelloch s notion of containment by the more general concept of fold programs [10], which are straight forward to de ne over product sum types. The issue concerning the complexity of attening can be circumvented by relying on a thread based implementation of array based nested data parallelism [4] However, for a thread based implementation, the ecient realisation on ....
....by Sheard Fegaras [18] from an algebraic data type T , it generates a de nition fold T that is suciently expressive to encode the recursive structure of all primitive recursive functions over T . In higher order languages, the expressiveness of fold actually exceeds that of primitive recursion [10], but this is severely curtailed in our core language due to the lack of the ability to create closures. The de nition of fold. The following de nitions are subject to two constraints: a) functions appearing inside a data type may not be co variant with respect to that data type and (b) the ....
G. Hutton. A tutorial on the universality and expressiveness of fold. Journal of Functional Programming, 9(4):355-372, 1999.
....many problems can be speci ed in terms of an inverse of a known function. Functional programmers make use of a handful of laws and theorems to transform speci cations to optimising code. Among them, the fold fusion theorem has proved to be one of the most important in functional programming [16]. The converse of a function theorem is another useful tool worth adding to the functional programmer s arsenal. Its joint use with the fold fusion theorem turns out to be a recurring pattern in program derivation. 2 Theory The converse of a function is a relation, so the framework is a calculus ....
G. Hutton. A tutorial on the universality and expressiveness of fold . Journal of Functional Programming, 9(4):355-372, July 1999.
....be implemented equally well in an eager language or lazy language. We demonstrate this by presenting implementations of cycamores in both SML and Haskell. 1. 3 Related Work There is a vast literature on programming with fold and unfold operators on a variety of data structures; references include [14, 16, 8, 2, 7, 11]. Terminology di#ers widely in this literature. In the terminology of [16] fold and unfold are only given the informal names of bananas and lenses for the symbols used to write them, the results of fold(#) and unfold(#) are called, respectively, catamorphisms and anamorphisms, and the terms ....
G. Hutton. A tutorial on the universality and expressiveness of fold. J. Funct. Programming, 9(4):355--372, July 1999.
....for nested types cannot be typed in Haskell. 5 Related work The fold operator for list, usually called foldr , has its origins in the reduction operator of APL (Iverson, 1962) and in the insertion operator of FP (Backus, 1978) An excellent tutorial paper on foldr giving further references is (Hutton, 1999). By modeling datatypes as fixpoints of functors folds were generalized from lists to regular datatypes (Meijer et al. 1991) Folds for nested datatypes (which we call simple folds) first appeared in (Bird Meertens, 1998) where a functorial semantics for nests is presented. It was noted that ....
Hutton, Graham. (1999). A tutorial on the universality and expressiveness of fold. Journal of functional programming. To appear.
....programs that consume values of a least fixpoint type such as finite lists. Dually, the recursion operator unfold encapsulates a common pattern for defining programs that produce values of a greatest fixpoint type such as streams (infinite lists) Theory and applications of fold abound see [11,4] for recent surveys while in recent years it has become increasingly clear that the less well known concept of unfold is just as useful [5,6,10,13,15] Given the interest in fold and unfold, it is natural to ask when a program can be written using one of these operators. Surprisingly little is ....
....answer to our question h can be written in the form fold f precisely when h in = f Fh but is less helpful than it might be because it requires that we already know f. Given a specific h, however, the universal property can often be used to guide the construction of an appropriate f [11], but we do not consider this a completely satisfactory answer either, because this approach is only a heuristic, and it is sometimes di#cult to apply in practice. The problem with the universal property is that it concerns an intensional aspect of h, namely the function f that forms part of its ....
G. Hutton. A tutorial on the universality and expressiveness of fold. Journal of Functional Programming, 9(4):355--372, July 1999.
....programs that consume values of a least fixpoint type such as finite lists. Dually, the recursion operator unfold encapsulates a common pattern for defining programs that produce values of a greatest fixpoint type such as infinite lists or streams. Theory and applications of fold abound see [6, 2] for recent surveys while in recent years it has become increasingly clear that the less well known concept of unfold is just as useful [3, 4, 5, 7, 9] Given the interest in fold and unfold, it is natural to ask when a program can be written using one of these operators. Surprisingly little ....
....to our question h can be written in the form fold f precisely when h in = f F h but is less helpful than it might be because it requires that we already know f . Given a specific h, however, the universal property can often be used to guide the construction of an appropriate f [6], but we do not consider this a completely satisfactory answer either, because this approach is only a heuristic, and it is sometimes di#cult to apply in practice. The problem with the universal property is that it concerns an intensional aspect of h, namely the function f that forms part of its ....
G. Hutton. A tutorial on the universality and expressiveness of fold. Journal of Functional Programming, 9(4):355--372, July 1999.
....universal and fusion properties of this operator to conduct proofs in a purely calculational style that avoids the use of inductive or coinductive methods. This approach is dual to the use of fold and its associated properties in recursive programming, which has recently been surveyed in [12]. The article is aimed at a reader who is familiar with the basics of recursive programming and inductive proof, say to the level of [4, 3] No prior knowledge of corecursive programming and proof is assumed. For simplicity, we restrict our attention to corecursive programs that produce lists, ....
Graham Hutton. A tutorial on the universality and expressiveness of fold. To appear in the Journal of Functional Programming.
....universality and fusion properties of this operator to conduct proofs in a purely calculational style that avoids the use of either induction or coinduction. This approach is dual to the use of fold and its associated properties in recursive programming, which has recently been surveyed in [15]. The article is aimed at a reader who is familiar with the basics of recursive programming and structural induction, say to the level of [4, 3] No prior knowledge of corecursive programming and proof is assumed. For simplicity, we restrict our attention to corecursive programs that produce ....
Graham Hutton. A tutorial on the universality and expressiveness of fold. To appear in the Journal of Functional Programming.
No context found.
G. Hutton. A tutorial on the universality and expressiveness of fold. Journal of Functional Programming, 9(4):355372, July 1999.
No context found.
G. Hutton. A tutorial on the universality and expressiveness of fold. Jour. of Functional Programming, pages 355372, 1999.
No context found.
Hutton, G. A tutorial on the universality and expressiveness of fold. Journal of Functional Programming, 9(4):355-372, July 1999.
No context found.
Hutton, G., A Tutorial on the Universality and Expressiveness of Fold, Journal of Functional Programming, vol. 9, no. 4, pp. 355-372 (1999).
No context found.
Hutton, G. A tutorial on the universality and expressiveness of fold. Journal of Functional Programming 1 (1):1-17 (1953).
No context found.
G. Hutton. A tutorial on the universality and expressiveness of fold. J. Funct. Programming, 9(4):355--372, July 1999.
No context found.
Graham Hutton. A tutorial on the universality and expressiveness of fold. Journal of Functional Programming, 9(4):355-372, 1999.
No context found.
Hutton, G. A tutorial on the universality and expressiveness of fold. Journal of Functional Programming 1 (1):1-17 (1953).
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC