Results 1  10
of
16
Essential language support for generic programming
 In PLDI ’05
, 2005
"... “Concepts ” are an essential language feature needed to support generic programming in the large. Concepts allow for succinct expression of bounds on type parameters of generic algorithms, enable systematic organization of problem domain abstractions, and make generic algorithms easier to use. In th ..."
Abstract

Cited by 29 (4 self)
 Add to MetaCart
(Show Context)
“Concepts ” are an essential language feature needed to support generic programming in the large. Concepts allow for succinct expression of bounds on type parameters of generic algorithms, enable systematic organization of problem domain abstractions, and make generic algorithms easier to use. In this paper we formalize the design of a type system and semantics for concepts that is suitable for nontypeinferencing languages. Our design shares much in common with the type classes of Haskell, though our primary influence is from best practices in the C ++ community, where concepts are used to document type requirements for templates in generic libraries. The technical development in this paper defines an extension to System F and a typedirected translation from the extension back to System F. The translation is proved sound; the proof is written in the human readable but machine checkable Isar language and has been automatically verified by the Isabelle proof assistant. This document was generated directly from the Isar theory files using Isabelle’s support for literate proofs.
HMF: Simple type inference for firstclass polymorphism
, 2008
"... HMF is a conservative extension of HindleyMilner type inference with firstclass polymorphism. In contrast to other proposals, HML uses regular System F types and has a simple type inference algorithm that is just a small extension of the usual DamasMilner algorithm W. Given the relative simplicit ..."
Abstract

Cited by 23 (1 self)
 Add to MetaCart
(Show Context)
HMF is a conservative extension of HindleyMilner type inference with firstclass polymorphism. In contrast to other proposals, HML uses regular System F types and has a simple type inference algorithm that is just a small extension of the usual DamasMilner algorithm W. Given the relative simplicity and expressive power, we feel that HMF can be an attractive type system in practice. There is a reference implementation of the type system available online together with
Extensible records with scoped labels
 In: Proceedings of the 2005 Symposium on Trends in Functional Programming
, 2005
"... Records provide a safe and flexible way to construct data structures. We describe a natural approach to typing polymorphic and extensible records that is simple, easy to use in practice, and straightforward to implement. A novel aspect of this work is that records can contain duplicate labels, effec ..."
Abstract

Cited by 9 (2 self)
 Add to MetaCart
(Show Context)
Records provide a safe and flexible way to construct data structures. We describe a natural approach to typing polymorphic and extensible records that is simple, easy to use in practice, and straightforward to implement. A novel aspect of this work is that records can contain duplicate labels, effectively introducing a form of scoping over the labels. Furthermore, it is a fully orthogonal extension to existing type systems and programming languages. In particular, we show how it can be used conveniently with standard HindleyMilner, qualified types, and MLF. 1
ABSTRACT Statically Typed Linear Algebra in Haskell
"... Many numerical algorithms are specified in terms of operations on vectors and matrices. Matrix operations can be executed extremely efficiently using specialized linear algebra kernels in libraries such as ATLAS or LAPACK. The resulting programs can be orders of magnitude faster than naive implement ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
Many numerical algorithms are specified in terms of operations on vectors and matrices. Matrix operations can be executed extremely efficiently using specialized linear algebra kernels in libraries such as ATLAS or LAPACK. The resulting programs can be orders of magnitude faster than naive implementations in C, and this is one reason why matrix computation interpreters such at Matlab and Octave are popular in scientific computing. However, the process of expressing an algorithm in terms of matrices can be errorprone. Typical matrix languages are weaklytyped. If we could expose certain properties of operands to a type system, so that their consistency could be statically verified by a type checker, then we would be able to catch many common errors at compile time. We call this idea “strongly typed linear algebra ” and describe a prototype implementation in which dimensions are exposed to the type system, which is based on Alberto Ruiz’s GSLHaskell [Ruiz(2005)] and uses techniques from Kiselyov and Shan’s “Implicit Configurations” [Kiselyov and Shan(2004)]. A great advantage of Matlab is the ability it offers scientists to manipulate and inspect numerical objects interactively. We show how to make our library useful for interactive use, using Template Haskell. Next, we implement a mediumsized machine learning algorithm using our library, and compare it to a similar implementation in Octave. Drawing from this experience, we suggest Haskell language features which might improve the library’s usability. Perhaps surprisingly, we conclude that performance is not a problem area for Haskell. The Haskell version of the program, which takes several minutes to run, is almost twice as fast as the Octave version, and probably comparable to the speed of Matlab. A basic understanding of Haskell is assumed.
A ChurchStyle Intermediate Language for MLF
"... MLFis a type system that seamlessly merges MLstyle implicit but secondclass polymorphism with SystemF explicit firstclass polymorphism. We present xMLF, a Churchstyle version of MLF with full type information that can easily be maintained during reduction. All parameters of functions are explic ..."
Abstract
 Add to MetaCart
MLFis a type system that seamlessly merges MLstyle implicit but secondclass polymorphism with SystemF explicit firstclass polymorphism. We present xMLF, a Churchstyle version of MLF with full type information that can easily be maintained during reduction. All parameters of functions are explicitly typed and both type abstraction and type instantiation are explicit. However, type instantiation in xMLF is more general than type application in System F. We equip xMLF with a smallstep reduction semantics that allows reduction in any context, and show that this relation is confluent and type preserving. We also show that both subject reduction and progress hold for weakreduction strategies, including callbyvalue with the valuerestriction. We exhibit a type preserving encoding of MLF into xMLF, which shows that xMLF can be used as the internal language for MLF after type inference, and also ensures type soundness for the most expressive variant of MLF.
unknown title
"... Firstclass polymorphism with existential types Abstract datatypes can be typed conveniently using existential types. Even though it is a powerful abstraction mechanism, current type inference systems based on HindleyMilner do not allow existential types as firstclass citizens – every existential ..."
Abstract
 Add to MetaCart
Firstclass polymorphism with existential types Abstract datatypes can be typed conveniently using existential types. Even though it is a powerful abstraction mechanism, current type inference systems based on HindleyMilner do not allow existential types as firstclass citizens – every existential type must be explicitly declared, packed, and unpacked using a data constructor. We present an extension of the MLF type system with firstclass existential types. Existential types are simply introduced by an annotation, and eliminated automatically in applications without the need for a special open construct. The system is fully implemented in the experimental Morrow interpreter. 1.
Concoqtion: Mixing Indexed Types and HindleyMilner Type Inference
, 2006
"... This paper addresses the question of how to extend OCaml’s HindleyMilner type system with types indexed by logical propositions and proofs of the Coq theorem prover, thereby providing an expressive and extensible mechanism for ensuring finegrained program invariants. We propose adopting the approa ..."
Abstract
 Add to MetaCart
This paper addresses the question of how to extend OCaml’s HindleyMilner type system with types indexed by logical propositions and proofs of the Coq theorem prover, thereby providing an expressive and extensible mechanism for ensuring finegrained program invariants. We propose adopting the approached used by Shao et al. for certified binaries. This approach maintains a phase distinction between the computational and logical languages, thereby limiting effects and nontermination to the computational language, and maintaining the decidability of the type system. The extension subsumes language features such as impredicative firstclass (higherrank) polymorphism and type operators, that are notoriously difficult to integrate with the HindleyMilner style of type inference that is used in OCaml. We make the observation that these features can be more easily integrated with type inference if the inference algorithm is free to adapt the order in which it solves typing constraints to each program. To this end we define a novel “orderfree” type inference algorithm. The key enabling technology is a graph representation of constraints and a constraint solver that performs HindleyMilner inference with just three graph rewrite rules.
unknown title
"... Extensible records with scoped labels Records provide a safe and flexible way to construct data structures. We describe a natural approach to typing polymorphic and extensible records that is simple, easy to use in practice, and straightforward to implement. A novel aspect of this work is that recor ..."
Abstract
 Add to MetaCart
(Show Context)
Extensible records with scoped labels Records provide a safe and flexible way to construct data structures. We describe a natural approach to typing polymorphic and extensible records that is simple, easy to use in practice, and straightforward to implement. A novel aspect of this work is that records can contain duplicate labels, effectively introducing a form of scoping over the labels. Furthermore, it is a fully orthogonal extension to existing type systems and programming languages. In particular, we show how it can be used conveniently with standard HindleyMilner, qualified types, and MLF. 1.