Results 1  10
of
61
A Brief Overview of Agda – A Functional Language with Dependent Types
"... Abstract. We give an overview of Agda, the latest in a series of dependently typed programming languages developed in Gothenburg. Agda is based on MartinLöf’s intuitionistic type theory but extends it with numerous programming language features. It supports a wide range of inductive data types, inc ..."
Abstract

Cited by 41 (0 self)
 Add to MetaCart
(Show Context)
Abstract. We give an overview of Agda, the latest in a series of dependently typed programming languages developed in Gothenburg. Agda is based on MartinLöf’s intuitionistic type theory but extends it with numerous programming language features. It supports a wide range of inductive data types, including inductive families and inductiverecursive types, with associated flexible patternmatching. Unlike other proof assistants, Agda is not tacticbased. Instead it has an Emacsbased interface which allows programming by gradual refinement of incomplete typecorrect terms. 1
Monads Need Not Be Endofunctors
"... Abstract. We introduce a generalisation of monads, called relative monads, allowing for underlying functors between different categories. Examples include finitedimensional vector spaces, untyped and typed λcalculus syntax and indexed containers. We show that the Kleisli and EilenbergMoore constr ..."
Abstract

Cited by 19 (5 self)
 Add to MetaCart
Abstract. We introduce a generalisation of monads, called relative monads, allowing for underlying functors between different categories. Examples include finitedimensional vector spaces, untyped and typed λcalculus syntax and indexed containers. We show that the Kleisli and EilenbergMoore constructions carry over to relative monads and are related to relative adjunctions. Under reasonable assumptions, relative monads are monoids in the functor category concerned and extend to monads, giving rise to a coreflection between monads and relative monads. Arrows are also an instance of relative monads. 1
Attribute grammars fly firstclass: how to do aspect oriented programming in Haskell
 in: Proceedings of the International Conference on Functional Programming, ACM, 2009
"... Attribute Grammars (AGs), a generalpurpose formalism for describing recursive computations over data types, avoid the tradeoff which arises when building software incrementally: should it be easy to add new data types and data type alternatives or to add new operations on existing data types? How ..."
Abstract

Cited by 11 (3 self)
 Add to MetaCart
(Show Context)
Attribute Grammars (AGs), a generalpurpose formalism for describing recursive computations over data types, avoid the tradeoff which arises when building software incrementally: should it be easy to add new data types and data type alternatives or to add new operations on existing data types? However, AGs are usually implemented as a preprocessor, leaving e.g. type checking to later processing phases and making interactive development, proper error reporting and debugging difficult. Embedding AG into Haskell as a combinator library solves these problems. Previous attempts at embedding AGs as a domainspecific language were based on extensible records and thus exploiting Haskell’s type system to check the wellformedness of the AG, but fell short in compactness and the possibility to abstract over oft occurring AG patterns. Other attempts used a very generic mapping for which the AG wellformedness could not be statically checked. We present a typed embedding of AG in Haskell satisfying all these requirements. The key lies in using HListlike typed heterogeneous collections (extensible polymorphic records) and expressing AG wellformedness conditions as typelevel predicates (i.e., typeclass constraints). By further typelevel programming we can also express common programming patterns, corresponding to the typical use cases of monads such as Reader, Writer and State. The paper presents a realistic example of typeclassbased typelevel programming in Haskell.
Outrageous but meaningful coincidences: Dependent typesafe syntax and evaluation
 In ACM SIGPLAN Workshop on Genetic Programming (WGP’10
, 2010
"... Tagless interpreters for welltyped terms in some object language are a standard example of the power and benefit of precise indexing in types, whether with dependent types, or generalized algebraic datatypes. The key is to reflect object language types as indices (however they may be constituted) f ..."
Abstract

Cited by 11 (2 self)
 Add to MetaCart
(Show Context)
Tagless interpreters for welltyped terms in some object language are a standard example of the power and benefit of precise indexing in types, whether with dependent types, or generalized algebraic datatypes. The key is to reflect object language types as indices (however they may be constituted) for the term datatype in the host language, so that host type coincidence ensures object type coincidence. Whilst this technique is widespread for simply typed object languages, dependent types have proved a tougher nut with nontrivial computation in type equality. In their typesafe representations, Danielsson [2006] and Chapman [2009] succeed in capturing the equality rules, but at the cost of representing equality derivations explicitly within terms. This article delivers a typesafe representation for a dependently typed object language, dubbed KIPLING, whose computational type equality just appropriates that of its host, Agda. The KIPLING interpreter example is not merely de rigeur— it is key to the construction. At the heart of the technique is that key component of generic programming, the universe. 1.
Guiding Parallel Array Fusion with Indexed Types
"... We present a refined approach to parallel array fusion that uses indexed types to specify the internal representation of each array. Our approach aids the client programmer in reasoning about the performance of their program in terms of the source code. It also makes the intermediate code easier to ..."
Abstract

Cited by 8 (3 self)
 Add to MetaCart
(Show Context)
We present a refined approach to parallel array fusion that uses indexed types to specify the internal representation of each array. Our approach aids the client programmer in reasoning about the performance of their program in terms of the source code. It also makes the intermediate code easier to transform at compiletime, resulting in faster compilation and more reliable runtimes. We demonstrate how our new approach improves both the clarity and performance of several enduser written programs, including a fluid flow solver and an interpolator for volumetric data. Categories and Subject Descriptors D.3.3 [Programming Languages]: Language Constructs and Features—Concurrent programming structures; Polymorphism; Abstract data types
Delta Lenses over Inductive Types
, 2012
"... Existing bidirectional languages are either statebased or operationbased, depending on whether they represent updates as mere states or as sequences of edit operations. Inbetween both worlds are deltabased frameworks, where updates are represented using alignment relationships between states. In ..."
Abstract

Cited by 7 (5 self)
 Add to MetaCart
Existing bidirectional languages are either statebased or operationbased, depending on whether they represent updates as mere states or as sequences of edit operations. Inbetween both worlds are deltabased frameworks, where updates are represented using alignment relationships between states. In this paper, we formalize delta lenses over inductive types using dependent type theory and develop a pointfree delta lens language with an explicit separation of shape and data. In contrast with the already known issue of data alignment, we identify the new problem of shape alignment and solve it by lifting standard recursion patterns such as folds and unfolds to delta lenses that use alignment to infer meaningful shape updates.
Calculating the Fundamental Group of the Circle in Homotopy Type Theory
"... Abstract—Recent work on homotopy type theory exploits an exciting new correspondence between MartinLof’s dependent type theory and the mathematical disciplines of category theory and homotopy theory. The category theory and homotopy theory suggest new principles to add to type theory, and type theo ..."
Abstract

Cited by 6 (1 self)
 Add to MetaCart
(Show Context)
Abstract—Recent work on homotopy type theory exploits an exciting new correspondence between MartinLof’s dependent type theory and the mathematical disciplines of category theory and homotopy theory. The category theory and homotopy theory suggest new principles to add to type theory, and type theory can be used in novel ways to formalize these areas of mathematics. In this paper, we formalize a basic result in algebraic topology, that the fundamental group of the circle is the integers. Though simple, this example is interesting for several reasons: it illustrates the new principles in homotopy type theory; it mixes ideas from traditional homotopytheoretic proofs of the result with typetheoretic inductive reasoning; and it provides a context for understanding an existing puzzle in type theory—that a universe (type of types) is necessary to prove that the constructors of inductive types are disjoint and injective. I.
Modularising inductive families
 In Jaakko Järvi and ShinCheng Mu, editors, Workshop on Generic Programming, WGP’11
, 2011
"... Dependently typed programmers are encouraged to use inductive families to integrate constraints with data construction. Different constraints are used in different contexts, leading to different versions of datatypes for the same data structure. For example, sequences might be constrained by length ..."
Abstract

Cited by 6 (3 self)
 Add to MetaCart
(Show Context)
Dependently typed programmers are encouraged to use inductive families to integrate constraints with data construction. Different constraints are used in different contexts, leading to different versions of datatypes for the same data structure. For example, sequences might be constrained by length or by an ordering on elements, giving rise to different datatypes “vectors ” and “sorted lists ” for the same underlying data structure of sequences. Modular implementation of common operations for these structurally similar datatypes has been a longstanding problem. We propose a datatypegeneric solution, in which we axiomatise a family of isomorphisms between datatypes and their more refined versions as datatype refinements, and show that McBride’s ornaments can be translated into such refinements. With the ornamentinduced refinements, relevant properties of the operations can be separately proven for each constraint, and after the programmer selects several constraints to impose on a basic datatype and synthesises a new datatype incorporating those constraints, the operations can be routinely upgraded to work with the synthesised datatype. 1
Monadic Combinators for “Putback” Style Bidirectional Programming
"... Bidirectional transformations, in particular lenses, are programs with a forward get transformation and a backward putback transformation that keep source and view data types synchronized. Several bidirectional programming languages exist to aid programmers in writing a (sort of) forward transforma ..."
Abstract

Cited by 6 (4 self)
 Add to MetaCart
(Show Context)
Bidirectional transformations, in particular lenses, are programs with a forward get transformation and a backward putback transformation that keep source and view data types synchronized. Several bidirectional programming languages exist to aid programmers in writing a (sort of) forward transformation, and deriving a backward transformation for free. However, the maintainability offered by such languages comes at the cost of expressiveness and (more importantly) predictability because the ambiguity of synchronization —handled by the putback transformation — is solved by default strategies over which programmers have little control. In this paper, we argue that controlling such ambiguity is essential for bidirectional transformations and propose a novel language in which programmers write a (sort of) putback transformation, and get the unique get transformation for free. Like traditional bidirectional languages, our putoriented language allows reasoning about the correctness of defined transformations from the properties of their building blocks. But it allows programmers to describe the behavior of a bidirectional transformation much more precisely, while retaining the maintainability of writing a single program. We demonstrate the practical power of the new approach through a series of examples, ranging from simple ones that illustrate traditional lenses to complex ones for which our putbackbased approach is central to specifying nontrivial update strategies.
Modular TypeSafety Proofs in Agda
"... Methods for reusing code are widespread and well researched, but methods for reusing proofs are still emerging. We consider the use of dependent types for this purpose, introducing a modular approach for composing mechanized proofs. We show that common techniques for abstracting algorithms over data ..."
Abstract

Cited by 5 (0 self)
 Add to MetaCart
(Show Context)
Methods for reusing code are widespread and well researched, but methods for reusing proofs are still emerging. We consider the use of dependent types for this purpose, introducing a modular approach for composing mechanized proofs. We show that common techniques for abstracting algorithms over data structures naturally translate to abstractions over proofs. We introduce a language composed of a series of smaller language components, each defined as functors, and tie them together by taking the fixed point of their sum [Malcom, 1990]. We then give proofs of type preservation for each language component and show how to compose these proofs into a proof for the entire language, again by taking the fixed point of a sum of functors.