Results 1  10
of
40
Simple unificationbased type inference for GADTs
, 2006
"... Generalized algebraic data types (GADTs), sometimes known as “guarded recursive data types ” or “firstclass phantom types”, are a simple but powerful generalization of the data types of Haskell and ML. Recent works have given compelling examples of the utility of GADTs, although type inference is k ..."
Abstract

Cited by 157 (35 self)
 Add to MetaCart
Generalized algebraic data types (GADTs), sometimes known as “guarded recursive data types ” or “firstclass phantom types”, are a simple but powerful generalization of the data types of Haskell and ML. Recent works have given compelling examples of the utility of GADTs, although type inference is known to be difficult. Our contribution is to show how to exploit programmersupplied type annotations to make the type inference task almost embarrassingly easy. Our main technical innovation is wobbly types, which express in a declarative way the uncertainty caused by the incremental nature of typical typeinference algorithms.
Combining programming with theorem proving
 In ICFP ’05: Proceedings of the tenth ACM SIGPLAN international conference on Functional programming
, 2005
"... 1. Introduction The notion of type equality plays a pivotal r^ole in type systemdesign. However, the importance of this role is often less evident in commonly studied type systems. For instance, in the simplytyped ..."
Abstract

Cited by 85 (7 self)
 Add to MetaCart
1. Introduction The notion of type equality plays a pivotal r^ole in type systemdesign. However, the importance of this role is often less evident in commonly studied type systems. For instance, in the simplytyped
System F with type equality coercions
, 2007
"... We introduce System FC, which extends System F with support for nonsyntactic type equality. There are two main extensions: (i) explicit witnesses for type equalities, and (ii) open, nonparametric type functions, given meaning by toplevel equality axioms. Unlike System F, FC is expressive enough to ..."
Abstract

Cited by 73 (25 self)
 Add to MetaCart
We introduce System FC, which extends System F with support for nonsyntactic type equality. There are two main extensions: (i) explicit witnesses for type equalities, and (ii) open, nonparametric type functions, given meaning by toplevel equality axioms. Unlike System F, FC is expressive enough to serve as a target for several different sourcelanguage features, including Haskell’s newtype, generalised algebraic data types, associated types, functional dependencies, and perhaps more besides.
Wobbly types: type inference for generalised algebraic data types
, 2004
"... Generalised algebraic data types (GADTs), sometimes known as “guarded recursive data types ” or “firstclass phantom types”, are a simple but powerful generalisation of the data types of Haskell and ML. Recent works have given compelling examples of the utility of GADTs, although type inference is k ..."
Abstract

Cited by 48 (2 self)
 Add to MetaCart
Generalised algebraic data types (GADTs), sometimes known as “guarded recursive data types ” or “firstclass phantom types”, are a simple but powerful generalisation of the data types of Haskell and ML. Recent works have given compelling examples of the utility of GADTs, although type inference is known to be difficult. It is time to pluck the fruit. Can GADTs be added to Haskell, without losing type inference, or requiring unacceptably heavy type annotations? Can this be done without completely rewriting the alreadycomplex Haskell typeinference engine, and without complex interactions with (say) type classes? We answer these questions in the affirmative, giving a type system that explains just what type annotations are required, and a prototype implementation that implements it. Our main technical innovation is wobbly types, which express in a declarative way the uncertainty caused by the incremental nature of typical typeinference algorithms. 1
Static Contract Checking for Haskell
 In Proceedings of the 36 th Annual ACM Symposium on the Principles of Programming Languages
, 2009
"... Program errors are hard to detect and are costly both to programmers who spend significant efforts in debugging, and for systems that are guarded by runtime checks. Static verification techniques have been applied to imperative and objectoriented languages, like Java and C#, but few have been appli ..."
Abstract

Cited by 26 (3 self)
 Add to MetaCart
Program errors are hard to detect and are costly both to programmers who spend significant efforts in debugging, and for systems that are guarded by runtime checks. Static verification techniques have been applied to imperative and objectoriented languages, like Java and C#, but few have been applied to a higherorder lazy functional language, like Haskell. In this paper, we describe a sound and automatic static verification framework for Haskell, that is based on contracts and symbolic execution. Our approach is modular and gives precise blame assignments at compiletime in the presence of higherorder functions and laziness. D.3 [Software]: Program
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 24 (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.
Ur: StaticallyTyped Metaprogramming with TypeLevel Record Computation
"... Dependent types provide a strong foundation for specifying and verifying rich properties of programs through typechecking. The earliest implementations combined dependency, which allows types to mention program variables; with typelevel computation, which facilitates expressive specifications that ..."
Abstract

Cited by 22 (1 self)
 Add to MetaCart
Dependent types provide a strong foundation for specifying and verifying rich properties of programs through typechecking. The earliest implementations combined dependency, which allows types to mention program variables; with typelevel computation, which facilitates expressive specifications that compute with recursive functions over types. While many recent applications of dependent types omit the latter facility, we argue in this paper that it deserves more attention, even when implemented without dependency. In particular, the ability to use functional programs as specifications enables staticallytyped metaprogramming: programs write programs, and static typechecking guarantees that the generating process never produces invalid code. Since our focus is on generic validity properties rather than full correctness verification, it is possible to engineer type inference systems that are very effective in narrow domains. As a demonstration, we present Ur, a programming language designed to facilitate metaprogramming with firstclass records and names. On top of Ur, we implement Ur/Web, a special standard library that enables the development of modern Web applications. Adhoc code generation is already in wide use in the popular Web application frameworks, and we show how that generation may be tamed using types, without forcing metaprogram authors to write proofs or forcing metaprogram users to write any fancy types.
Polymorphic embedding of DSLs
 In GPCE’08. ACM
, 2008
"... The influential pure embedding methodology of embedding domainspecific languages (DSLs) as libraries into a generalpurpose host language forces the DSL designer to commit to a single semantics. This precludes the subsequent addition of compilation, optimization or domainspecific analyses. We propo ..."
Abstract

Cited by 18 (3 self)
 Add to MetaCart
The influential pure embedding methodology of embedding domainspecific languages (DSLs) as libraries into a generalpurpose host language forces the DSL designer to commit to a single semantics. This precludes the subsequent addition of compilation, optimization or domainspecific analyses. We propose polymorphic embedding of DSLs, where many different interpretations of a DSL can be provided as reusable components, and show how polymorphic embedding can be realized in the programming language Scala. With polymorphic embedding, the static typesafety, modularity, composability and rapid prototyping of pure embedding are reconciled with the flexibility attainable by external toolchains. Categories and Subject Descriptors D.3.2 [Programming Languages]: Language Classifications—Extensible languages, Specialized
Towards efficient, typed LR parsers
 In ACM SIGPLAN Workshop on ML, Electronic Notes in Theoretical Computer Science
, 2005
"... Abstract The LR parser generators that are bundled with many functional programming language implementations produce code that is untyped, needlessly inefficient, or both. We show that, using generalized algebraic data types, it is possible to produce parsers that are welltyped (so they cannot unex ..."
Abstract

Cited by 16 (8 self)
 Add to MetaCart
Abstract The LR parser generators that are bundled with many functional programming language implementations produce code that is untyped, needlessly inefficient, or both. We show that, using generalized algebraic data types, it is possible to produce parsers that are welltyped (so they cannot unexpectedly crash or fail) and nevertheless efficient. This is a pleasing result as well as an illustration of the new expressiveness offered by generalized algebraic data types.
Extended static checking for Haskell
 In Proc. of the 36th ACM SIGPLAN Workshop on Haskell (Haskell 2006
, 2006
"... Program errors are hard to detect and are costly both to programmers who spend significant efforts in debugging, and to systems that are guarded by runtime checks. Extended static checking can reduce these costs by helping to detect bugs at compiletime, where possible. Extended static checking has ..."
Abstract

Cited by 16 (2 self)
 Add to MetaCart
Program errors are hard to detect and are costly both to programmers who spend significant efforts in debugging, and to systems that are guarded by runtime checks. Extended static checking can reduce these costs by helping to detect bugs at compiletime, where possible. Extended static checking has been applied to objectoriented languages, like Java and C#, but it has not been applied to a lazy functional language, like Haskell. In this paper, we describe an extended static checking tool for Haskell, named ESC/Haskell, that is based on symbolic computation and assisted by a few novel strategies. One novelty is our use of Haskell as the specification language itself for pre/post conditions. Any Haskell function (including recursive and higher order functions) can be used in our specification which allows sophisticated properties to be expressed. To perform automatic verification, we rely on a novel technique based on symbolic computation that is augmented by counterexample guided unrolling. This technique can automate our verification process and be efficiently implemented.