Results 1  10
of
13
Scrap Your Boilerplate: A Practical Design Pattern for Generic Programming
 Proc. of the ACM SIGPLAN Workshop on Types in Language Design and Implementation (TLDI 2003
, 2003
"... We describe a design pattern for writing programs that traverse data structures built from rich mutuallyrecursive data types. Such programs often have a great deal of "boilerplate" code that simply walks the structure, hiding a small amount of "real" code that constitutes the reason for the travers ..."
Abstract

Cited by 137 (12 self)
 Add to MetaCart
We describe a design pattern for writing programs that traverse data structures built from rich mutuallyrecursive data types. Such programs often have a great deal of "boilerplate" code that simply walks the structure, hiding a small amount of "real" code that constitutes the reason for the traversal. Our technique allows most...
What Are Principal Typings and What Are They Good For?
, 1995
"... We demonstrate the pragmatic value of the principal typing property, a property more general than ML's principal type property, by studying a type system with principal typings. The type system is based on rank 2 intersection types and is closely related to ML. Its principal typing property prov ..."
Abstract

Cited by 94 (0 self)
 Add to MetaCart
We demonstrate the pragmatic value of the principal typing property, a property more general than ML's principal type property, by studying a type system with principal typings. The type system is based on rank 2 intersection types and is closely related to ML. Its principal typing property provides elegant support for separate compilation, including "smartest recompilation" and incremental type inference, and for accurate type error messages. Moreover, it motivates a novel rule for typing recursive definitions that can type many examples of polymorphic recursion.
Practical type inference for arbitraryrank types
 Journal of Functional Programming
, 2005
"... Note: This document accompanies the paper “Practical type inference for arbitraryrank types ” [6]. Prior reading of the main paper is required. 1 Contents ..."
Abstract

Cited by 91 (23 self)
 Add to MetaCart
Note: This document accompanies the paper “Practical type inference for arbitraryrank types ” [6]. Prior reading of the main paper is required. 1 Contents
The complexity of type inference for higherorder typed lambda calculi
 In. Proc. 18th ACM Symposium on the Principles of Programming Languages
, 1991
"... We analyse the computational complexity of type inference for untyped X,terms in the secondorder polymorphic typed Xcalculus (F2) invented by Girard and Reynolds, as well as higherorder extensions F3,F4,...,/ ^ proposed by Girard. We prove that recognising the i^typable terms requires exponential ..."
Abstract

Cited by 28 (11 self)
 Add to MetaCart
We analyse the computational complexity of type inference for untyped X,terms in the secondorder polymorphic typed Xcalculus (F2) invented by Girard and Reynolds, as well as higherorder extensions F3,F4,...,/ ^ proposed by Girard. We prove that recognising the i^typable terms requires exponential time, and for Fa the problem is nonelementary. We show as well a sequence of lower bounds on recognising the i^typable terms, where the bound for Fk+1 is exponentially larger than that for Fk. The lower bounds are based on generic simulation of Turing Machines, where computation is simulated at the expression and type level simultaneously. Nonaccepting computations are mapped to nonnormalising reduction sequences, and hence nontypable terms. The accepting computations are mapped to typable terms, where higherorder types encode reduction sequences, and firstorder types encode the entire computation as a circuit, based on a unification simulation of Boolean logic. A primary technical tool in this reduction is the composition of polymorphic functions having different domains and ranges. These results are the first nontrivial lower bounds on type inference for the Girard/Reynolds
Rank 2 Type Systems and Recursive Definitions
, 1995
"... We demonstrate an equivalence between the rank 2 fragments of the polymorphic lambda calculus (System F) and the intersection type discipline: exactly the same terms are typable in each system. An immediate consequence is that typability in the rank 2 intersection system is DEXPTIMEcomplete. We int ..."
Abstract

Cited by 26 (1 self)
 Add to MetaCart
We demonstrate an equivalence between the rank 2 fragments of the polymorphic lambda calculus (System F) and the intersection type discipline: exactly the same terms are typable in each system. An immediate consequence is that typability in the rank 2 intersection system is DEXPTIMEcomplete. We introduce a rank 2 system combining intersections and polymorphism, and prove that it types exactly the same terms as the other rank 2 systems. The combined system suggests a new rule for typing recursive definitions. The result is a rank 2 type system with decidable type inference that can type some interesting examples of polymorphic recursion. Finally,we discuss some applications of the type system in data representation optimizations such as unboxing and overloading.
Type Checking Meta Programs
 In Workshop on Logical Frameworks and MetaLanguages
, 1999
"... We report on preliminary experiments with inferring types for meta programs: programs that manipulate programs. For this purpose we provide a twolevel type system in a fragment of a higherorder system of dependent types. The system is formulated with automatic type inference in mind. In particular ..."
Abstract

Cited by 7 (0 self)
 Add to MetaCart
We report on preliminary experiments with inferring types for meta programs: programs that manipulate programs. For this purpose we provide a twolevel type system in a fragment of a higherorder system of dependent types. The system is formulated with automatic type inference in mind. In particular, we give a type system for dependent types and a constraint generation procedure which generates semiunification constraints from untyped terms that have a solution if and only if the terms have a type annotation in the type system. More interestingly, typability is preserved under reflection, i.e. when object level programs are reflected to the metalevel. 1 Introduction We would like to have a way to infer that the operations meta programs perform on their objects preserve typability of the objects. Here, we develop type rules and constraint solving techniques for inferring types of such programs. On the surface this may seem as an innocent exercise in extending for instance the Hindley...
Type Inference and Reconstruction for First Order Dependent Types
, 1995
"... x 1 Introduction 1 1.1 Dependent Types : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 1.2 Dependent Type Inference and Reconstruction : : : : : : : : : : : : : : : : 8 2 Primitive Recursive Functionals with Dependent Types 17 2.1 A Dependent Type System for T : : : : : : : : : ..."
Abstract

Cited by 3 (1 self)
 Add to MetaCart
x 1 Introduction 1 1.1 Dependent Types : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 1.2 Dependent Type Inference and Reconstruction : : : : : : : : : : : : : : : : 8 2 Primitive Recursive Functionals with Dependent Types 17 2.1 A Dependent Type System for T : : : : : : : : : : : : : : : : : : : : : : : 17 2.1.1 Terms : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 17 2.1.2 Types : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 19 2.1.3 Typing Rules : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 24 2.1.4 Strong Normalization of T Terms : : : : : : : : : : : : : : : : : : : 28 2.2 Dependent Typing Examples : : : : : : : : : : : : : : : : : : : : : : : : : : 29 2.3 A Term Model Semantics for T : : : : : : : : : : : : : : : : : : : : : : : : 34 3 Principal Types and Dependent Type Reconstruction 58 3.1 Type Subsumption and Unification : : : : : : : : : : : : : : : : : : : : : : : 58 3.2 Matching : : : : : :...
Type Inference for Recursive Definitions
 In Proc. 14th Ann. IEEE Symp. Logic in Comput. Sci
, 2000
"... We consider type systems that combine universal types, recursive types, and object types. We study type inference in these systems under a rank restriction, following Leivant's notion of rank. To motivate our work, we present several examples showing how our systems can be used to type programs enco ..."
Abstract

Cited by 2 (1 self)
 Add to MetaCart
We consider type systems that combine universal types, recursive types, and object types. We study type inference in these systems under a rank restriction, following Leivant's notion of rank. To motivate our work, we present several examples showing how our systems can be used to type programs encountered in practice. We show that type inference in the rankk system is decidable for k # 2 and undecidable for k # 3. (Similar results based on different techniques are known to hold for System F, without recursive types and object types.) Our undecidability result is obtained by a reduction from a particular adaptation (which we call "regular") of the semiunification problem and whose undecidability is, interestingly, obtained by methods totally different from those used in the case of standard (or finite) semiunification. Keywords: type systems, type inference, lambda calculus, unification, software specification. 1 Introduction 1.1 Background and Motivation Type inference, the ...
Refinement Types for Logical Frameworks
, 2010
"... The logical framework LF and its metalogic Twelf can be used to encode and reason about a wide variety of logics, languages, and other deductive systems in a formal, machinecheckable way. Recent studies have shown that MLlike languages can profitably be extended with a notion of subtyping called r ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
The logical framework LF and its metalogic Twelf can be used to encode and reason about a wide variety of logics, languages, and other deductive systems in a formal, machinecheckable way. Recent studies have shown that MLlike languages can profitably be extended with a notion of subtyping called refinement types. A refinement type discipline uses an extra layer of term classification above the usual type system to more accurately capture certain properties of terms. I propose that adding refinement types to LF is both useful and practical. To support the claim, I exhibit an extension of LF with refinement types called LFR, work out important details of its metatheory, delineate a practical algorithm for refinement type reconstruction, and present several case studies that highlight the utility of refinement types for formalized mathematics. In the end I find that refinement types and LF are a match made in heaven: refinements enable many rich new modes of expression, and the simplicity of
Jones.Scrap your boilerplate: a practical design pattern for generic programming.In Types
 In Languages Design And Implementation
, 2003
"... CWI is a founding member of ERCIM, the European Research Consortium for Informatics and Mathematics. CWI's research has a themeoriented structure and is grouped into four clusters. Listed below are the names of the clusters and in parentheses their acronyms. ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
CWI is a founding member of ERCIM, the European Research Consortium for Informatics and Mathematics. CWI's research has a themeoriented structure and is grouped into four clusters. Listed below are the names of the clusters and in parentheses their acronyms.