## Comparing Approaches to Polytypic Programming (1999)

Citations: | 1 - 0 self |

### BibTeX

@TECHREPORT{Halenbeek99comparingapproaches,

author = {Joost Halenbeek},

title = {Comparing Approaches to Polytypic Programming},

institution = {},

year = {1999}

}

### OpenURL

### Abstract

This document can be represented by the datatype Html4 as follows: my_html :: Html4 ParType my_html = List [ Heading (HeadingPar 1) (Text (TextPar "My Home Page")) , HRule , Break , Heading (HeadingPar 2) (Text (TextPar "Links to my friends:")) , List [ Link (UrlPar "http://...martijn...") (Text (TextPar "Martijn")) , Link (UrlPar "http://...michiel...") (Text (TextPar "Jantje")) ] ] To compress my_html using the strategy described above, its shape and data must be separated. The data can be obtained by attening, it is a list of values of type ParType: [ HeadingPar 1 , TextPar "My Home Page" , HeadingPar 2 , TextPar "Links to my friends:" , UrlPar "http://...martijn..." , TextPar "Martijn" , UrlPar "http://..jantje..." , TextPar "Jantje" ] The shape of my_html is obtained by replacing each datum by (), i.e. by leaving out the data. Since all data is declared as a parameter, the shape consists of just constructors. The rst step in shape compression is attening the shape to a list of constructors. Here is a representation of the attened shape of my_html: [ List, Cons, Heading, Text , Cons, HRule , Cons, Break , Cons, Heading, Text , Cons, List, Cons, Link, Text , Cons, Link, Text , Nil , Nil ] The list is formatted such that the represented structure is still visible. Since all datatypes in Haskell are sum-of-product datatypes, all datatypes in PolyP are sum-of-product datatypes too. The constructors of any datatype in PolyP can therefore be coded as natural numbers indicating which injection into the sum each constructor represents. These numbers are easily retrieved by inspecting the data declaration of a given datatype. We call such a number the

### Citations

179 | A system of constructor classes: overloading and implicit higher-order polymorphism
- Jones
- 1993
(Show Context)
Citation Context ...s based on an extension of the Hindley-Milner type system with qualied and higher-order polymorphic types, that is also used for type inference in an environment with constructor classes. (See Jones [=-=Jon93]) -=-For detailed information on the PolyP type system, see [Jan97]. Here we su��ce by discussing the type checking of the polytypic construct. Consider the inductive denition of a polytypic function :... |

175 | PolyP—a polytypic programming language extension - Jansson, Jeuring - 1997 |

96 | Bananas in space: extending fold and unfold to exponential types
- Meijer, Hutton
- 1995
(Show Context)
Citation Context ...alculation and transformation (see [Mee86]). We will present the categorical concepts that are necessary for understanding the subsequent sections by showing their implementation in Haskell. See also =-=[MH95]-=- for a similar implementation. Categories. A category consists of a collection of objects and a collection of arrows. Each arrow has a source object and a target object. Two arrows can be composed to ... |

95 |
Algorithmics –towards programming as a mathematical activity
- Meertens
- 1986
(Show Context)
Citation Context ...ced to the categorical approach to datatype theory that originates with Hagino (see [Hag87]). The Squiggol community adopted this and showed its merits for program calculation and transformation (see =-=[Mee86]-=-). We will present the categorical concepts that are necessary for understanding the subsequent sections by showing their implementation in Haskell. See also [MH95] for a similar implementation. Categ... |

81 | Nested datatypes
- Bird, Meertens
- 1998
(Show Context)
Citation Context ...ed nested datatypes. These datatypes have been neglected in functional programming until recently. Now people are discovering some of their theoretical importance and practical applications (see also =-=[BM98]-=-). To be precise, we shall model nested datatypes by higher-order functors in the Haskell dialect Hugs 1.3c [Jon98] and discuss the pros and cons of this approach. 5.1 What is a Nested Datatype? Recal... |

60 | A semantics for shape
- Jay
- 1995
(Show Context)
Citation Context ...typic combinators are dened using qualied kinds. 4.4 Semantics The intended semantics for FML interprets functors as functors shapely over lists, which is a notion that stems from shape theory (see [J=-=ay95-=-]). Informally, a functorsF is shapely over lists if values of type FA can be uniquely identied by their shape of type F1 and their content of type List(A). The idea of canonical isomorphisms and thei... |

41 | Calculate polytypically
- Meertens
- 1996
(Show Context)
Citation Context ...g a structure, summing the contents of a structure or testing the membership of a given value to a structure, can be dened with crush. Another term for functions dened with crush is reductions. See [M=-=ee96]-=- for a detailed discussion on the crush combinator for regular datatypes. One way of transforming the concept of reductions to nested datatypes in the higher-order semantics is to abstract from the da... |

35 | Dictionary-free overloading by partial evaluation
- Jones
- 1995
(Show Context)
Citation Context ...s a dictionary containing the instances of the functions inn and out with D and the functor representation of D. The use of evidence parameters is heavily based on the work of Jones on qualied types [=-=Jon94-=-]. We will illustrate the translation process by giving a translation of the function fmap. The denition of fmap that we gave earlier in terms of the polytypic construct is translated to the following... |

32 |
Category theoretic approach to data types
- Hagino
- 1987
(Show Context)
Citation Context ...ctors. We conclude with Section 6. Chapter 2 Categorical Datatypes in Haskell In this section, the reader is introduced to the categorical approach to datatype theory that originates with Hagino (see =-=[Hag87]-=-). The Squiggol community adopted this and showed its merits for program calculation and transformation (see [Mee86]). We will present the categorical concepts that are necessary for understanding the... |

27 | Functorial ML
- Bellè, Jay, et al.
- 1996
(Show Context)
Citation Context ...r construction and destruction with respect to composite functors and projection functors are the subject of the next section. 1 In this thesis we consider the set of FML combinators that was used in =-=[BJM96-=-], but we have renamed them a la [JBM98]. Type Inference. Milner's type inference algorithm W, which infers principal typings for HM terms, can be modied to calculate most general typings for FML term... |

5 | Functional polytypic programming | use and implementation
- Jansson
- 1997
(Show Context)
Citation Context ...ualied and higher-order polymorphic types, that is also used for type inference in an environment with constructor classes. (See Jones [Jon93]) For detailed information on the PolyP type system, see [=-=Jan97]-=-. Here we su��ce by discussing the type checking of the polytypic construct. Consider the inductive denition of a polytypic function : polytypic :: = case f of ff i ! e i g Type checking makes s... |

1 |
Functorial ML. Extended version of
- Jay, Belle, et al.
(Show Context)
Citation Context ...pect to composite functors and projection functors are the subject of the next section. 1 In this thesis we consider the set of FML combinators that was used in [BJM96], but we have renamed them a la =-=[JBM9-=-8]. Type Inference. Milner's type inference algorithm W, which infers principal typings for HM terms, can be modied to calculate most general typings for FML terms. The most important modication is th... |

1 |
A technical summary of the new features in hugs 1.3c. Available from ftp://ftp.cs.nott.ac.uk/ haskell/hugs/hugs13/ WhatsNew
- Jones
- 1998
(Show Context)
Citation Context ...discovering some of their theoretical importance and practical applications (see also [BM98]). To be precise, we shall model nested datatypes by higher-order functors in the Haskell dialect Hugs 1.3c =-=[Jon98-=-] and discuss the pros and cons of this approach. 5.1 What is a Nested Datatype? Recall from Section 3.1 that a datatype D is regular if all uses of D on the right hand side of its denition are applie... |