Results 1  10
of
17
The Gentle Art of Levitation
"... We present a closed dependent type theory whose inductive types are given not by a scheme for generative declarations, but by encoding in a universe. Each inductive datatype arises by interpreting its description—a firstclass value in a datatype of descriptions. Moreover, the latter itself has a de ..."
Abstract

Cited by 20 (4 self)
 Add to MetaCart
We present a closed dependent type theory whose inductive types are given not by a scheme for generative declarations, but by encoding in a universe. Each inductive datatype arises by interpreting its description—a firstclass value in a datatype of descriptions. Moreover, the latter itself has a description. Datatypegeneric programming thus becomes ordinary programming. We show some of the resulting generic operations and deploy them in particular, useful ways on the datatype of datatype descriptions itself. Surprisingly this apparently selfsupporting setup is achievable without paradox or infinite regress. 1.
TypeSafe Diff for Families of Datatypes
"... The UNIX diff program finds the difference between two text files using a classic algorithm for determining the longest common subsequence; however, when working with structured input (e.g. program code), we often want to find the difference between treelike data (e.g. the abstract syntax tree). In ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
The UNIX diff program finds the difference between two text files using a classic algorithm for determining the longest common subsequence; however, when working with structured input (e.g. program code), we often want to find the difference between treelike data (e.g. the abstract syntax tree). In a functional programming language such as Haskell, we can represent this data with a family of (mutually recursive) datatypes. In this paper, we describe a functional, datatypegeneric implementation of diff (and the associated program patch). Our approach requires advanced type system features to preserve type safety; therefore, we present the code in Agda, a dependentlytyped language wellsuited to datatypegeneric programming. In order to establish the usefulness of our work, we show that its efficiency can be improved with memoization and that it can also be defined in Haskell.
The right kind of generic programming
 In Proceedings of the 8th ACM SIGPLAN Workshop on Generic Programming, WGP ’12
, 2012
"... Haskell is known for its strong, static type system. A good type system classifies values, constraining the valid terms of the language and preventing many common programming errors. The Glasgow Haskell Compiler (GHC) has further extended the type language of Haskell, adding support for typelevel c ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
Haskell is known for its strong, static type system. A good type system classifies values, constraining the valid terms of the language and preventing many common programming errors. The Glasgow Haskell Compiler (GHC) has further extended the type language of Haskell, adding support for typelevel computation and explicit type equality constraints. Typelevel programming is used to classify values, but types themselves have remained notoriously unclassified. Recently, however, the kindlevel language was extended with support for userdefined kinds and kind polymorphism. In this paper we revisit generic programming approaches that rely heavily on typelevel computation, and analyse how to improve them with the extended kind language. For instructive purposes, we list a series of advantages given by the new features, and also a number of shortcomings that prevent desirable use patterns.
When Is a Container a Comonad?
"... Abstract. Abbott, Altenkirch, Ghani and others have taught us that many parameterized datatypes (set functors) can be usefully analyzed via container representations in terms of a set of shapes and a set of positions in each shape. This paper builds on the observation that datatypes often carry addi ..."
Abstract

Cited by 2 (2 self)
 Add to MetaCart
Abstract. Abbott, Altenkirch, Ghani and others have taught us that many parameterized datatypes (set functors) can be usefully analyzed via container representations in terms of a set of shapes and a set of positions in each shape. This paper builds on the observation that datatypes often carry additional structure that containers alone do not account for. We introduce directed containers to capture the common situation where every position in a datastructure determines another datastructure, informally, the subdatastructure rooted by that position. Some natural examples are nonempty lists and nodelabelled trees, and datastructures with a designated position (zippers). While containers denote set functors via a fullyfaithful functor, directed containers interpret fullyfaithfully into comonads. But more is true: every comonad whose underlying functor is a container is represented by a directed container. In fact, directed containers are the same as containers that are comonads. We also describe some constructions of directed containers. We have formalized our development in the dependently typed programming language Agda. 1
Enumerating WellTyped Terms Generically
, 2009
"... We use generic programming techniques to generate welltyped lambda terms. We encode welltyped terms by generalized algebraic datatypes (GADTs) and existential types. The Spine approach (??) to generic programming supports GADTs, but it does not support the definition of generic producers for exist ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
We use generic programming techniques to generate welltyped lambda terms. We encode welltyped terms by generalized algebraic datatypes (GADTs) and existential types. The Spine approach (??) to generic programming supports GADTs, but it does not support the definition of generic producers for existentials. We describe how to extend the Spine approach to support existentials and we use the improved Spine to define a generic enumeration function. We show that the enumeration function can be used to generate the terms of simply typed lambda calculus.
A Categorical Treatment of Ornaments
"... Abstract—Ornaments aim at taming the multiplication of specialpurpose datatypes in dependently typed programming languages. In type theory, purpose is logic. By presenting datatypes as the combination of a structure and a logic, ornaments relate these specialpurpose datatypes through their common ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
Abstract—Ornaments aim at taming the multiplication of specialpurpose datatypes in dependently typed programming languages. In type theory, purpose is logic. By presenting datatypes as the combination of a structure and a logic, ornaments relate these specialpurpose datatypes through their common structure. In the original presentation, the concept of ornament was introduced concretely for an example universe of inductive families in type theory, but it was clear that the notion was more general. This paper digs out the abstract notion of ornaments in the form of a categorical model. As a necessary first step, we abstract the universe of datatypes using the theory of polynomial functors. We are then able to characterise ornaments as cartesian morphisms between polynomial functors. We thus gain access to powerful mathematical tools that shall help us understand and develop ornaments. We shall also illustrate the adequacy of our model. Firstly, we rephrase the standard ornamental constructions into our framework. Thanks to its conciseness, we gain a deeper understanding of the structures at play. Secondly, we develop new ornamental constructions, by translating categorical structures into type theoretic artefacts.
Jubilee Campus, University of Nottingham,
"... Abstract. Bundy and Richardson [7] presented a technique for reasoning about lists using ellipsis (the dots in 1+2+...+10), where a polymorphic function, denoted by ✷, is used to encapsulate recursive definitions of list functions and a portrayal system using ellipsis gives an informal proof. We hig ..."
Abstract
 Add to MetaCart
Abstract. Bundy and Richardson [7] presented a technique for reasoning about lists using ellipsis (the dots in 1+2+...+10), where a polymorphic function, denoted by ✷, is used to encapsulate recursive definitions of list functions and a portrayal system using ellipsis gives an informal proof. We highlight certain limitations of this technique and address these limitations using the recently developed theory of containers which capture the idea that many important datatypes consist of templates where data is stored. We implement our ideas in Coq and demonstrate how they can be used to prove theorems that eluded Bundy and Richardson in [7]. 1
unknown title
"... the introduction rules for A may also refer to B. So we have formation rules A ∶ Set, B ∶ A → Set and typical introduction rules might take the form a ∶ A b ∶ B(a)... introA(a, b,...) ∶ A a0 ∶ A b ∶ B(a0) a1 ∶ A... ..."
Abstract
 Add to MetaCart
the introduction rules for A may also refer to B. So we have formation rules A ∶ Set, B ∶ A → Set and typical introduction rules might take the form a ∶ A b ∶ B(a)... introA(a, b,...) ∶ A a0 ∶ A b ∶ B(a0) a1 ∶ A...
Deciding Properties of Lists using Containers
 JOURNAL OF AUTOMATED REASONING
"... We exploit the ability to represent data types as container functors [2,1,3] to develop a novel approach to proving properties of lists using arithmetic decision procedures. Containers capture the idea that concrete data types can be characterised by specifying the shape values take and for every po ..."
Abstract
 Add to MetaCart
We exploit the ability to represent data types as container functors [2,1,3] to develop a novel approach to proving properties of lists using arithmetic decision procedures. Containers capture the idea that concrete data types can be characterised by specifying the shape values take and for every possible shape, explaining where positions within that shape are stored. More importantly, a representation theorem guarantees that polymorphic functions between container data types are given by container morphisms, which are characterised by mappings between shapes and positions. The key to our approach is to restrict the shape maps of container morphisms to functions that have decidable equality, but which allow for a large class of functions. We also capture the behaviour of position mappings of container morphisms as functions on the natural numbers. The shape maps which we consider are given by piecewiselinear functions, of type N n → N. Such functions are decidable, and this enables us to implement decision procedures for lists.