| Richard Bird and Lambert Meertens. Nested datatypes. In Johan Jeuring, editor, Proceedings of the Fourth International Conference on Mathematics of Program Construction (MPC'98), volume 1422 of LNCS, pages 52--67. Springer Verlag, 1998. |
....by help of parameters: Let List(A) 1 A List(A) be the type of lists over A. Then FinTree = List(FinTree) is nested in the sense of an interleaving of the de nitions of FinTree and List(FinTree) Certainly, this can be represented as a simultaneous de nition. Nesting in the sense advocated in [BM98] is di erent: The rst author gratefully acknowledges the support by the PhD Programme Logic in Computer Science (GKLI) of the Deutsche Forschungs Gemeinschaft. The second author has bene tted from nancial support by the EC ESPRIT project 21900 TYPES and the EU IST working group 29001 ....
Richard Bird and Lambert Meertens. Nested datatypes. In Johan Jeuring, editor, Mathematics of Program Construction, MPC'98, Proceedings, volume 1422 of Lecture Notes in Computer Science, pages 52-67. Springer Verlag, 1998.
.... need for power allegories: relations inclusion, meet, converse and the power transpose P B A of B A relators (monotonic functors) etc : The question is: point free relation calculus nondeterministic mappings Nested datatypes These are based on non regular functors, e.g. [BM98]: data Nest a = NilN ConsN (a, Nest (a,a) It so happens that Nest a (Tree a) OE data Tree a = Val a Bin (Tree a) Tree a) OE l = 81 i length l : i = depth(l i) balanced(l i) So, OE could be captured (implicitly) by using Nest a as intermediate data structure. Very ....
R. Bird and L. Meertens. Nested datatypes. In J. Jeuring, editor, MPC'98: Mathematics of Program Construction, number 1422 in Lecture Notes in Computer Science, pages 52--67. Springer, 1998.
....trie for the unit type is a Maybe value (it is Nothing if the nite map is empty and of the form Just v otherwise) a trie for a sum is a product of tries and a trie for a product is a composition of tries. Note that Trie (as well as Rep) is not only a phantom type but also a so called nested type [5], as the de nition involves recursive calls , e.g. Trie 1 (Trie 2 ) that are substitution instances of the de ned type. The generic look up function on tries is given by the following de nition. lookup : 8 : Trie Maybe lookup ( T 1 m) m lookup (Left a) T ta tb) ....
Richard Bird and Lambert Meertens. Nested datatypes. In J. Jeuring, editor, Fourth International Conference on Mathematics of Program Construction, MPC'98, Marstrand, Sweden, volume 1422 of Lecture Notes in Computer Science, pages 52-67. Springer-Verlag, June 1998.
.... and monotonicity presented in [2] On top of these notions, we de ne the system MIt of generalized (co)iteration for arbitrary ranks, which we then specialize to rank 1 (types) and rank 2 (type transformers) To give a feel for our system, we spell out some examples involving nested datatypes [6]. 3.1 Containment and Monotonicity of Constructors Containment. The key to extending Mendler style iteration and coiteration [15] to nite kinds consists in identifying an appropriate notion of predicate of containment between two constructors of the same kind . For types, the canonical choice ....
R. Bird and L. Meertens. Nested datatypes. In J. Jeuring, ed., Proc. of 4th Int. Conf. on Mathematics of Program Construction, MPC'98, vol. 1422 of Lect. Notes in Comput. Sci., pp. 52-67. Springer-Verlag, 1998.
.... we de ne the system MIt of generalized (co)iteration for inductive and coinductive constructors of arbitrary ranks, which we then specialize to rank 1 (types) and rank 2 (type transformers) To give a feel for our system, we spell out some examples involving nested or non uniform datatypes [7]. 3.1 Containment and Monotonicity of Constructors Containment. The key to extending Mendler style iteration and coiteration [19] to nite kinds consists in identifying an appropriate containment relation for constructors of the same kind . For types, the canonical choice is implication. For an ....
R. Bird and L. Meertens. Nested datatypes. In J. Jeuring, ed., Proc. of 4th Int. Conf. on Mathematics of Program Construction, MPC'98, vol. 1422 of Lect. Notes in Comput. Sci., pp. 52-67. Springer-Verlag, 1998.
....logarithmic access, is C. Okasaki s type of binary random access lists [30] data Fork A = fork A A data Sequ A = empty zero (Sequ (Fork A) one A (Sequ (Fork A) Since the type argument is changed in the recursive calls, Sequ is an example of a so called nested or non regular data type [4]. Nested data types have recently received a great deal of attention since they can capture data structural invariants in a way that regular data types cannot. For instance, Sequ captures the invariant that binary random access lists are sequences of perfect binary leaf trees stored in increasing ....
....is provided. The rationale behind this restriction is that type inference in the presence of polymorphic recursion is undecidable [10] 5 Since Sequ is a nested type, it cannot be expressed as a fixed point of a functor. However, it can be rephrased as a fixed point of a higher order functor [4]. Again, we will carry out the construction to generate examples of higherorder kinded data types. The higher order base functor associated with Sequ is data SequF S A = emptyF zeroF (S (Fork A) oneF A (S (Fork A) Since Sequ has kind # #, its higher order base functor has kind ....
Richard Bird and Lambert Meertens. Nested datatypes. In J. Jeuring, editor, Fourth International Conference on Mathematics of Program Construction, MPC'98, Marstrand, Sweden, volume 1422 of Lecture Notes in Computer Science, pages 52--67. Springer-Verlag, June 1998.
....regular and nested datatypes respectively. Standard folds and simple folds arise from the semantics of regular and nested datatypes respectively. Good introductions to the material in this chapter include [BJJM99] 14 and [BdM97] Neither of these cover Section 2. 5, however, which is based on [BM98] and [BP99b] 2.2 A naive model for type constructors Let us examine a typical recursive datatype. data List a = Nil Cons (a, List a) In words this declares that a list is empty or an element and a list . The word or translates case selection. The word and translates tupling of types. Now ....
....T F T . Here, quite inconveniently, it is the functor Nest that appears on both sides, not the object Nest A. Therefore, we need a notion of an isomorphism between functors, also denoted and defined later, so that we can define Nest as a fixpoint instead. This is the approach is taken in [BM98] and [BP99b] For an appropriate mapping NestF from endofunctors to endofunctors, we Now we must find NestF . Putting the two isomorphisms together suggests NestF Nest A = Base (A, Nest (Pair A) Written point free, this is (NestF Nest) A = Base Pair#) A Abstracting the above ....
[Article contains additional citation context not shown here]
Richard Bird and Lambert Meertens. Nested datatypes. In J. Jeuring, editor, Proceedings 4th Int. Conf. on Mathematics of Program Construction, MPC'98, Marstrand, Sweden, 15--17 June 1998, volume 1422, pages 52--67. Springer-Verlag, Berlin, 1998.
.... a functional language or a typed lambda calculus is implicit in [9] and appears explicated in [12,7] In the functional programming community, also the general theory of heterogeneous, non uniform or nested datatypes (recursive constructors of rank 2) is currently on the research agenda, see [10,11,20,27]. Typed lambda calculi featuring heterogeneous and higher kind inductive and coinductive constructors are the topic of [23,1,2] A very accessible extended presentation of aspects of Fiore, Plotkin and Turi s work [15] appears in [14] Hofmann [21] has given a category theoretic explanation of the ....
Bird, R. and L. Meertens, Nested datatypes, in: J. Jeuring, ed., Proc. of 4th Int. Conf. on Mathematics of Program Construction, MPC'98 (Marstrand, June
.... a fixed point operator this is the approach taken in PolyP [19] However, this is technically rather awkward and never completely general as type recursion may span over several types (mutual recursion) and as it may involve type constructors rather than types (so called nested data types, see [6]) Thus, we would need an infinite family of fixed point operators. Furthermore, checking equality of higher order kinded type constructors is undecidable. Haskell avoids the latter problem by using name equivalence rather than structural equivalence, which motivates the second solution. We ....
Richard Bird and Lambert Meertens. Nested datatypes. In J. Jeuring, editor, Fourth International Conference on Mathematics of Program Construction, MPC'98, Marstrand, Sweden, volume 1422 of Lecture Notes in Computer Science, pages 52--67. Springer-Verlag, June 1998.
....non uniform datatype, non regular datatype, polymorphic recursion, fold, universal property, functor category. 1. Introduction The fold operator of functional programming can be defined on any regular datatype [BdM97] but there is a problem when extending its definition to nested datatypes [BM98] because some of its parameters are required to be polymorphic. A solution to this problem, proposed by Bird and Paterson [BP99b] was to introduce a new kind of operator called a generalised fold. Like an ordinary fold, the generalised fold of a given initial algebra is characterised uniquely by ....
....However, it is not immediately obvious to see how such a function should be defined. This is one reason why higher order operations that capture common patterns of computation, like fold, are particularly important for nested datatypes. The initial algebra semantics of nested datatypes proposed in [BM98, MJ01] leads to the following definition of fold on this datatype: fold : #a. n a) #a. a Nest b fold e f Nil = e The universal property associated with this definition is identical to that for lists (1) apart from the type declarations. The problem with this fold is that its type ....
[Article contains additional citation context not shown here]
R. Bird and L. Meertens. Nested datatypes. In LNCS 1422: Mathematics of Program Construction, p. 52--67. Springer, 1998.
....environment which interprets those names. I choose to give inductive definitions in natural deduction style. Although this requires more space than the datatype declarations of conventional programming languages, they allow dependent families to be presented much more clearly: even nested types [BM98, BP99] must be defined uniformly over their indices, whilst the full notion of family allows constructors to apply only at particular indices. I also give type signatures to defined functions in this way, preferring to present the universal quantification inherent in their type dependency via schematic ....
Richard Bird and Lambert Meertens. Nested datatypes. In Mathematics of Program Construction, volume 1422 of LNCS, pages 52--67. Springer-Verlag, 1998.
....linear inductive types (i.e. where the signature functor has the form T (X) A 1 X A 0 ) but in general we need to construct functors de ned by terminal coalgebras in categories of endofunctors. Those correspond to nested or heterogenous datatypes which have been the subject of recent work [BM98,AR99,Bla00]. 1.1 Examples We give some examples which are instances of our general construction , prop. 8. We use the usual syntax for products and coproducts and X:F (X) to denote initial algebras and X:F (X) for terminal coalgebras. See section 2 for the details. The isomorphisms stated below exist ....
....) However, it is easy to see that the naturality of implies H 1 ( H 2 ( The type F: X:X F (F (X) has a straightforward representation in a functional programming language like Haskell which allows heterogenous datatypes. A variation of this type, namely F: X:1 X F (F (X) is used in [BM98] as an example for heterogenous datatypes under the name Bushes. We can represent F: X:X F (F (X) as 1 We only give the e ect on objects since the morphism part of the functor can be derived from the fact that all the operations we use are functorial in their arguments, i.e. T can be ....
R. Bird and L. Meertens. Nested datatypes. In J. Jeuring, editor, Mathematics of Program Construction, number 1422 in LNCS, pages 52 - 67. Springer Verlag, 1998.
....data Node a k = Node a k a The de nition of Perfect is somewhat unusual in that the recursive call on the right hand side, Perfect (Node a k) k , is not identical to the left hand side of the equation: Perfect is an example of a so called nested datatype, a term coined by R. Bird and L. Meertens [5]. Since Perfect only encompasses perfect binary search trees, the size of a tree of type Perfect a a can be computed in logarithmic time. sizep : Perfect a k Int sizep (Zero a) 1 sizep (Succ t) 2 sizep t 1 3 The function sizep counts the number of values of type a in a tree of type ....
Richard Bird and Lambert Meertens. Nested datatypes. In J. Jeuring, editor, Fourth International Conference on Mathematics of Program Construction, MPC'98, Marstrand, Sweden, volume 1422 of Lecture Notes in Computer Science, pages 52-67. Springer-Verlag, June 1998. 37
.... 1 Nat Nat X ) Nat ssum X x d = case d x of One 0 (n,m,y) n m ssum X y d Calculating the conclusion this time yields sumzip = ssum [Nat] Nat] zW Finally, lifting proposition 3. 1 to the category C C of endofunctors, we can derive the build fusion rule for nested data types [1]. Consider, e.g. the type constructor Nest, that can be de ned as a xpoint of the functor : C C C C , mapping (F ) X:1 X F (X X) The elements of the datatype Nest Nat are the lists where the i th entry is an element of Nat 2 i . Abbreviating Nest Nat to fNatg, we can now de ....
R. Bird and L. Meertens. Nested datatypes. In Proceedings MFPS '98, volume 1422 of Lecture Notes in Computer Science, pages 52-67. Springer, 1998.
....the initial algebra semantics of datatypes. This is both a blessing and a curse. It is a blessing because the underlying theory is beautiful and well developed. It is a curse because the initial algebra semantics is restricted to so called regular datatypes. Recent work by R. Bird and L. Meertens [3] on the semantics of non regular or nested datatypes suggests that an extension to general datatypes is not entirely straightforward. Here we propose an alternative that extends polytypism to arbitrary datatypes, including nested datatypes and mutually recursive datatypes. The central idea is to ....
....France Since the recursive call of Perfect on the right hand side is not a copy of the declared type on the left hand side, the equation cannot be rewritten into the form Perfect a =G(a;Perfect a) for some G. Away out of this dilemma is to consider initial algebras of higher order functors [3]. If we lift coproduct ( and product ( Theta) to functors, F 1 F 2 ) T = F 1 T F 2 T and (F 1 Theta F 2 ) T = F 1 T Theta F 2 T, the above type definitions can be rewritten as functor equations: List = K1 Id Theta List ; Perfect = Id Perfect Delta (Id Theta Id) where KT is the ....
[Article contains additional citation context not shown here]
Richard Bird and Lambert Meertens. Nested datatypes. In J. Jeuring, editor, Fourth International Conference on Mathematics of Program Construction, MPC'98, Marstrand, Sweden, volume 1422 of Lecture Notes in Computer Science, pages 52--67. Springer-Verlag, June 1998.
No context found.
Richard Bird and Lambert Meertens. Nested datatypes. In Johan Jeuring, editor, Proceedings of the Fourth International Conference on Mathematics of Program Construction (MPC'98), volume 1422 of LNCS, pages 52--67. Springer Verlag, 1998.
No context found.
Richard Bird and Lambert Meertens. Nested datatypes. In J. Jeuring, editor, Proceedings 4th Int. Conf. on Mathematics of Program Construction, MPC'98, Marstrand, Sweden, 15--17 June 1998, volume 1422, pages 52--67. Springer-Verlag, Berlin, 1998.
No context found.
Richard Bird and Lambert Meertens. Nested datatypes. In J. Jeuring, editor, Fourth International Conference on Mathematics of Program Construction, MPC'98, Marstrand, Sweden, volume 1422 of Lecture Notes in Computer Science, pages 52--67. Springer-Verlag, June 1998.
No context found.
R. Bird and L. Meertens. Nested datatypes. In J. Jeuring, ed., Proc. of 4th Int. Conf. on Mathematics of Program Construction, MPC'98, vol. 1422 of Lect. Notes in Comput. Sci., pp. 52--67. Springer-Verlag, 1998.
No context found.
Richard Bird and Lambert Meertens. Nested datatypes. In J. Jeuring, editor, Fourth International Conference on Mathematics of Program Construction, MPC'98, Marstrand, Sweden, volume 1422 of Lecture Notes in Computer Science, pages 52--67. Springer-Verlag, June 1998.
No context found.
Richard Bird and Lambert Meertens. Nested datatypes. In J. Jeuring, editor, Proceedings 4th Int. Conf. on Mathematics of Program Construction, MPC'98, Marstrand, Sweden, 15--17 June 1998, volume 1422, pages 52--67. Springer-Verlag, Berlin, 1998.
No context found.
Richard Bird and Lambert Meertens. Nested datatypes. In Johan Jeuring, editor, Mathematics of Program Construction, MPC'98, Proceedings, volume 1422 of Lecture Notes in Computer Science, pages 52-67. Springer Verlag, 1998.
No context found.
Richard Bird and Lambert Meertens. Nested datatypes. In J. Jeuring, editor, Fourth International Conference on Mathematics of Program Construction, MPC'98, Marstrand, Sweden, volume 1422 of Lecture Notes in Computer Science, pages 52--67. Springer-Verlag, June 1998.
No context found.
R. Bird and L. Meertens. Nested datatypes. In J. Jeuring, ed., Proc. of 4th Int. Conf. on Mathematics of Program Construction, MPC'98, vol. 1422 of Lect. Notes in Comput. Sci., pp. 52-67. Springer-Verlag, 1998.
No context found.
Richard Bird and Lambert Meertens. Nested datatypes. In J. Jeuring, editor, Fourth International Conference on Mathematics of Program Construction, MPC'98, Marstrand, Sweden, volume 1422 of Lecture Notes in Computer Science, pages 52-67. Springer-Verlag, June 1998.
First 50 documents
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