Results 1  10
of
25
Type Checking with Open Type Functions
"... We report on an extension of Haskell with open typelevel functions and equality constraints that unifies earlier work on GADTs, functional dependencies, and associated types. The contribution of the paper is that we identify and characterise the key technical challenge of entailment checking; and w ..."
Abstract

Cited by 39 (21 self)
 Add to MetaCart
We report on an extension of Haskell with open typelevel functions and equality constraints that unifies earlier work on GADTs, functional dependencies, and associated types. The contribution of the paper is that we identify and characterise the key technical challenge of entailment checking; and we give a novel, decidable, sound, and complete algorithm to solve it, together with some practicallyimportant variants. Our system is implemented in GHC, and is already in active use.
Data types à la carte
"... This paper describes a technique for assembling both data types and functions from isolated individual components. We also explore how the same technology can be used to combine free monads and, as a result, structure Haskell’s monolithic IO monad. 1 ..."
Abstract

Cited by 37 (1 self)
 Add to MetaCart
This paper describes a technique for assembling both data types and functions from isolated individual components. We also explore how the same technology can be used to combine free monads and, as a result, structure Haskell’s monolithic IO monad. 1
Factorising Folds for Faster Functions
"... The worker/wrapper transformation is a general technique for improving the performance of recursive programs by changing their types. The previous formalisation (Gill & Hutton, 2009) was based upon a simple fixed point semantics of recursion. In this article we develop a more structured approach ..."
Abstract

Cited by 6 (3 self)
 Add to MetaCart
The worker/wrapper transformation is a general technique for improving the performance of recursive programs by changing their types. The previous formalisation (Gill & Hutton, 2009) was based upon a simple fixed point semantics of recursion. In this article we develop a more structured approach, based upon initial algebra semantics. In particular, we show how the worker/wrapper transformation can be applied to programs defined using the structured pattern of recursion captured by fold operators, and illustrate our new technique with a number of examples.
Relational Parametricity for Higher Kinds
"... Abstract. Reynolds ’ notion of relational parametricity has been extremely influential and well studied for polymorphic type theories such as System F. The extension of relational parametricity to higher kinded polymorphism, which allows quantification over type operators as well as types, has not b ..."
Abstract

Cited by 5 (0 self)
 Add to MetaCart
Abstract. Reynolds ’ notion of relational parametricity has been extremely influential and well studied for polymorphic type theories such as System F. The extension of relational parametricity to higher kinded polymorphism, which allows quantification over type operators as well as types, has not been as well studied. In this paper we give a model of relational parametricity for System F ω and investigate some of its consequences. 1
Extending type inference to variational programs
, 2012
"... Through the use of conditional compilation and related tools, many software projects can be used to generate a huge number of related programs. The problem of typing such variational software is difficult. The bruteforce strategy of generating all variants and typing each one individually is (1) us ..."
Abstract

Cited by 4 (0 self)
 Add to MetaCart
Through the use of conditional compilation and related tools, many software projects can be used to generate a huge number of related programs. The problem of typing such variational software is difficult. The bruteforce strategy of generating all variants and typing each one individually is (1) usually infeasible for efficiency reasons and (2) produces results that do not map well to the underlying variational program. Recent research has focused mainly on efficiency and addressed only the problem of type checking. In this work we tackle the more general problem of variational type inference and introduce variational types to represent the result of typing a variational program. We introduce the variational lambda calculus (VLC) as a formal foundation for research on typing variational programs. We define a type system for VLC in which VLC expressions are mapped to correspondingly variational types. We show that the type system is correct by proving that the typing of expressions is preserved over the process of variation elimination, which eventually results in a plain lambda calculus expression and its corresponding type. We identify a set of equivalence rules for variational types and prove that the type unification problem modulo these equivalence rules is unitary and decidable; we also present a sound and complete unification algorithm. Based on the unification algorithm, the variational type inference algorithm is an extension of algorithm W. We show that it is sound and complete and computes principal types. We also consider the extension of VLC with sum types, a necessary feature for supporting variational data types, and demonstrate that the previous theoretical results also hold under this extension. Finally, we characterize the complexity of variational type inference and demonstrate the efficiency gains over the bruteforce strategy.
Ambivalent Types for Principal Type Inference with GADTs
"... Abstract. GADTs, short for Generalized Algebraic DataTypes, which allow constructors of algebraic datatypes to be nonsurjective, have many useful applications. However, pattern matching on GADTs introduces local type equality assumptions, which are a source of ambiguities that may destroy principal ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
Abstract. GADTs, short for Generalized Algebraic DataTypes, which allow constructors of algebraic datatypes to be nonsurjective, have many useful applications. However, pattern matching on GADTs introduces local type equality assumptions, which are a source of ambiguities that may destroy principal types— and must be resolved by type annotations. We introduce ambivalent types to tighten the definition of ambiguities and better confine them, so that type inference has principal types, remains monotonic, and requires fewer type annotations. 1
Typed Tagless Final Interpreters
"... The socalled ‘typed tagless final’ approach of Carette et al. [6] has collected and polished a number of techniques for representing typed higherorder languages in a typed metalanguage, along with typepreserving interpretation, compilation and partial evaluation. The approach is an alternative to ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
The socalled ‘typed tagless final’ approach of Carette et al. [6] has collected and polished a number of techniques for representing typed higherorder languages in a typed metalanguage, along with typepreserving interpretation, compilation and partial evaluation. The approach is an alternative to the traditional, or ‘initial ’ encoding of an object language as a (generalized) algebraic data type. Both approaches permit multiple interpretations of an expression, to evaluate it, prettyprint, etc. The final encoding represents all and only typed object terms without resorting to generalized algebraic data types, dependent or other fancy types. The final encoding lets us add new language forms and interpretations without breaking the existing terms and interpreters. These lecture notes introduce the final approach slowly and in detail, highlighting extensibility, the solution to the expression problem, and the seemingly impossible patternmatching. We develop the approach further, to typesafe cast, runtimetype representation, Dynamics, and type reconstruction. We finish with telling examples of typedirected partial evaluation and encodings of typeandeffect systems and linear lambdacalculus.
A foundation for GADTs and inductive families: dependent polynomial functor approach
 In WGP’11
, 2011
"... Every Algebraic Datatype (ADT) is characterised as the initial algebra of a polynomial functor on sets. This paper extends the characterisation to the case of more advanced datatypes: Generalised Algebraic Datatypes (GADTs) and Inductive Families. Specifically, we show that GADTs and Inductive Fa ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
Every Algebraic Datatype (ADT) is characterised as the initial algebra of a polynomial functor on sets. This paper extends the characterisation to the case of more advanced datatypes: Generalised Algebraic Datatypes (GADTs) and Inductive Families. Specifically, we show that GADTs and Inductive Families are characterised as initial algebras of dependent polynomial functors. The theoretical tool we use throughout is an abstract notion of polynomial between sets together with its associated general form of polynomial functor between categories of indexed sets introduced by Gambino and Hyland. In the context of ADTs, this fundamental result is the basis for various generic functional programming techniques. To establish the usefulness of our approach for such developments in the broader context of inductively defined dependent types, we apply the theory to construct zippers for Inductive Families.
21.1 GENERALIZING SHORT CUT FUSION 21.1.1 Introducing Short Cut Fusion
"... Abstract: Fusion is the process of improving the efficiency of modularly constructed programs by transforming them into monolithic equivalents. This paper defines a generalization of the standard build combinator which expresses uniform production of functorial contexts containing data of inductive ..."
Abstract
 Add to MetaCart
Abstract: Fusion is the process of improving the efficiency of modularly constructed programs by transforming them into monolithic equivalents. This paper defines a generalization of the standard build combinator which expresses uniform production of functorial contexts containing data of inductive types. It also proves correct a fusion rule which generalizes the fold / build and fold/buildp rules from the literature, and eliminates intermediate data structures of inductive types without disturbing the contexts in which they are situated. An important special case arises when this context is monadic. When it is, a second rule for fusing combinations of producers and consumers via monad operations, rather than via composition, is also available. We give examples illustrating both rules, and consider their coalgebraic duals as well.