Results 1  10
of
15
A constraintbased approach to guarded algebraic data types
 ACM Trans. Prog. Languages Systems
, 2007
"... We study HMG(X), an extension of the constraintbased type system HM(X) with deep pattern matching, polymorphic recursion, and guarded algebraic data types. Guarded algebraic data types subsume the concepts known in the literature as indexed types, guarded recursive datatype constructors, (firstcla ..."
Abstract

Cited by 26 (0 self)
 Add to MetaCart
We study HMG(X), an extension of the constraintbased type system HM(X) with deep pattern matching, polymorphic recursion, and guarded algebraic data types. Guarded algebraic data types subsume the concepts known in the literature as indexed types, guarded recursive datatype constructors, (firstclass) phantom types, and equality qualified types, and are closely related to inductive types. Their characteristic property is to allow every branch of a case construct to be typechecked under different assumptions about the type variables in scope. We prove that HMG(X) is sound and that, provided recursive definitions carry a type annotation, type inference can be reduced to constraint solving. Constraint solving is decidable, at least for some instances of X, but prohibitively expensive. Effective type inference for guarded algebraic data types is left as an issue for future research.
Foundations for structured programming with GADTs
 Conference record of the ACM SIGPLANSIGACT Symposium on Principles of Programming Languages
, 2008
"... GADTs are at the cutting edge of functional programming and become more widely used every day. Nevertheless, the semantic foundations underlying GADTs are not well understood. In this paper we solve this problem by showing that the standard theory of data types as carriers of initial algebras of fun ..."
Abstract

Cited by 25 (4 self)
 Add to MetaCart
GADTs are at the cutting edge of functional programming and become more widely used every day. Nevertheless, the semantic foundations underlying GADTs are not well understood. In this paper we solve this problem by showing that the standard theory of data types as carriers of initial algebras of functors can be extended from algebraic and nested data types to GADTs. We then use this observation to derive an initial algebra semantics for GADTs, thus ensuring that all of the accumulated knowledge about initial algebras can be brought to bear on them. Next, we use our initial algebra semantics for GADTs to derive expressive and principled tools — analogous to the wellknown and widelyused ones for algebraic and nested data types — for reasoning about, programming with, and improving the performance of programs involving, GADTs; we christen such a collection of tools for a GADT an initial algebra package. Along the way, we give a constructive demonstration that every GADT can be reduced to one which uses only the equality GADT and existential quantification. Although other such reductions exist in the literature, ours is entirely local, is independent of any particular syntactic presentation of GADTs, and can be implemented in the host language, rather than existing solely as a metatheoretical artifact. The main technical ideas underlying our approach are (i) to modify the notion of a higherorder functor so that GADTs can be seen as carriers of initial algebras of higherorder functors, and (ii) to use left Kan extensions to trade arbitrary GADTs for simplerbutequivalent ones for which initial algebra semantics can be derived.
A framework for extended algebraic data types
 In Proc. of FLOPS’06, volume 3945 of LNCS
, 2006
"... Abstract. There are a number of extended forms of algebraic data types such as type classes with existential types and generalized algebraic data types. Such extensions are highly useful but their interaction has not been studied formally so far. Here, we present a unifying framework for these exten ..."
Abstract

Cited by 23 (10 self)
 Add to MetaCart
Abstract. There are a number of extended forms of algebraic data types such as type classes with existential types and generalized algebraic data types. Such extensions are highly useful but their interaction has not been studied formally so far. Here, we present a unifying framework for these extensions. We show that the combination of type classes and generalized algebraic data types allows us to express a number of interesting properties which are desired by programmers. We support type checking based on a novel constraint solver. Our results show that our system is practical and greatly extends the expressive power of languages such as Haskell and ML. 1
Programming with proofs and explicit contexts
 In Symposium on Principles and Practice of Declarative Programming, 2008. François Pottier and Nadji
"... This paper explores a new point in the design space of functional programming: functional programming with dependentlytyped higherorder data structures described in the logical framework LF. This allows us to program with proofs as higherorder data. We present a decidable bidirectional type syste ..."
Abstract

Cited by 23 (8 self)
 Add to MetaCart
(Show Context)
This paper explores a new point in the design space of functional programming: functional programming with dependentlytyped higherorder data structures described in the logical framework LF. This allows us to program with proofs as higherorder data. We present a decidable bidirectional type system that distinguishes between dependentlytyped data and computations. To support reasoning about open data, our foundation makes contexts explicit. This provides us with a concise characterization of open data, which is crucial to elegantly describe proofs. In addition, we present an operational semantics for this language based on higherorder pattern matching for dependently typed objects. Based on this development, we prove progress and preservation.
Type inference for guarded recursive data types
, 2005
"... Abstract. We consider type inference for guarded recursive data types (GRDTs) – a recent generalization of algebraic data types. We reduce type inference for GRDTs to unification under a mixed prefix. Thus, we obtain efficient type inference. Inference is incomplete because the set of type constrai ..."
Abstract

Cited by 16 (0 self)
 Add to MetaCart
Abstract. We consider type inference for guarded recursive data types (GRDTs) – a recent generalization of algebraic data types. We reduce type inference for GRDTs to unification under a mixed prefix. Thus, we obtain efficient type inference. Inference is incomplete because the set of type constraints allowed to appear in the type system is only a subset of those type constraints generated by type inference. Hence, inference only succeeds if the program is sufficiently type annotated. We present refined procedures to infer types incrementally and to assist the user in identifying which pieces of type information are missing. Additionally, we introduce procedures to test if a type is not principal and to find a principal type if one exists. 1
Erasure and Polymorphism in Pure Type Systems
"... Abstract. We introduce Erasure Pure Type Systems, anextensionto Pure Type Systems with an erasure semantics centered around a type constructor ∀ indicating parametric polymorphism. The erasure phase is guided by lightweight program annotations. The typing rules guarantee that welltyped programs obe ..."
Abstract

Cited by 14 (0 self)
 Add to MetaCart
(Show Context)
Abstract. We introduce Erasure Pure Type Systems, anextensionto Pure Type Systems with an erasure semantics centered around a type constructor ∀ indicating parametric polymorphism. The erasure phase is guided by lightweight program annotations. The typing rules guarantee that welltyped programs obey a phase distinction between erasable (compiletime) and nonerasable (runtime) terms. The erasability of an expression depends only on how its value is used in the rest of the program. Despite this simple observation, most languages treat erasability as an intrinsic property of expressions, leading to code duplication problems. Our approach overcomes this deficiency by treating erasability extrinsically. Because the execution model of EPTS generalizes the familiar notions of type erasure and parametric polymorphism, we believe functional programmers will find it quite natural to program in such a setting. 1
Linear Regions Are All You Need
 In Proc. ESOP’06
, 2006
"... The typeande#ects system of the TofteTalpin region calculus makes it possible to safely reclaim objects without a garbage collector. ..."
Abstract

Cited by 8 (1 self)
 Add to MetaCart
(Show Context)
The typeande#ects system of the TofteTalpin region calculus makes it possible to safely reclaim objects without a garbage collector.
Modelyze: a Gradually Typed Host Language for Embedding EquationBased Modeling Languages
, 2012
"... ..."
Type processing by constraint reasoning
 Pages 1–25 of: Proc. of APLAS’06. LNCS
, 2006
"... Abstract. Herbrand constraint solving or unification has long been understood as an efficient mechanism for type checking and inference for programs using Hindley/Milner types. If we step back from the particular solving mechanisms used for Hindley/Milner types, and understand type operations in ter ..."
Abstract

Cited by 4 (1 self)
 Add to MetaCart
Abstract. Herbrand constraint solving or unification has long been understood as an efficient mechanism for type checking and inference for programs using Hindley/Milner types. If we step back from the particular solving mechanisms used for Hindley/Milner types, and understand type operations in terms of constraints we not only give a basis for handling Hindley/Milner extensions, but also gain insight into type reasoning even on pure Hindley/Milner types, particularly for type errors. In this paper we consider typing problems as constraint problems and show which constraint algorithms are required to support various typing questions. We use a light weight constraint reasoning formalism, Constraint Handling Rules, to generate suitable algorithms for many popular extensions to Hindley/Milner types. The algorithms we discuss are all implemented as part of the freely available Chameleon system. 1
Typesafe cast does no harm: Syntactic parametricity for Fω and beyond
"... Generic functions can specialize their behavior depending on the types of their arguments, and can even recurse over the structure of the types of their arguments. Such functions can be programmed using type representations. Generic functions programmed this way possess certain parametricity propert ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
(Show Context)
Generic functions can specialize their behavior depending on the types of their arguments, and can even recurse over the structure of the types of their arguments. Such functions can be programmed using type representations. Generic functions programmed this way possess certain parametricity properties, which become interesting in the presence of higherorder polymorphism. In this paper, we give a rigorous road map through the proof of parametricity for a calculus with higherorder polymorphism and type representations. We then use parametricity to derive the correctness of typesafe cast. 1