Results 11  20
of
55
Making Implicit Parameters Explicit
, 2005
"... In almost all languages all arguments to functions are to be given explicitly. The Haskell class system however is an exception: functions can have class predicates as part of their type signature, and dictionaries are implicitly constructed and implicitly passed for such predicates, thus relieving ..."
Abstract

Cited by 5 (0 self)
 Add to MetaCart
In almost all languages all arguments to functions are to be given explicitly. The Haskell class system however is an exception: functions can have class predicates as part of their type signature, and dictionaries are implicitly constructed and implicitly passed for such predicates, thus relieving the programmer from a lot of clerical work and removing clutter from the program text. Unfortunately Haskell maintains a very strict boundary between the implicit and the explicit world; if the implicit mechanisms fail to construct the hidden dictionaries there is no way the programmer can provide help, nor is he able to override the choices made by the implicit mechanisms. In this paper we describe, in the context of Haskell, a mechanism that allows the programmer to explicitly construct implicit arguments. This extension blends well with existing resolution mechanisms, since it only overrides the default behavior. We include a description of the use of partial type signatures, which liberates the programmer from having to choose between specifying a complete type signature or no type signature at all. Finally we show how the system can easily be extended to deal with higherorder predicates, thus enabling the elegant formulation of some forms of generic programming.
Equality proofs and deferred type errors: a compiler pearl
 In ICFP
, 2012
"... The Glasgow Haskell Compiler is an optimizing compiler that expresses and manipulates firstclass equality proofs in its intermediate language. We describe a simple, elegant technique that exploits these equality proofs to support deferred type errors. The technique requires us to treat equality pro ..."
Abstract

Cited by 5 (0 self)
 Add to MetaCart
The Glasgow Haskell Compiler is an optimizing compiler that expresses and manipulates firstclass equality proofs in its intermediate language. We describe a simple, elegant technique that exploits these equality proofs to support deferred type errors. The technique requires us to treat equality proofs as possiblydivergent terms; we show how to do so without losing either soundness or the zerooverhead cost model that the programmer expects.
Uniqueness Typing Simplified
"... Abstract. We present a uniqueness type system that is simpler than both Clean’s uniqueness system and a system we proposed previously. The new type system is straightforward to implement and add to existing compilers, and can easily be extended with advanced features such as higher rank types and im ..."
Abstract

Cited by 5 (1 self)
 Add to MetaCart
Abstract. We present a uniqueness type system that is simpler than both Clean’s uniqueness system and a system we proposed previously. The new type system is straightforward to implement and add to existing compilers, and can easily be extended with advanced features such as higher rank types and impredicativity. We describe our implementation in Morrow, an experimental functional language with both these features. Finally, we prove soundness of the core type system with respect to the callbyneed lambda calculus. 1 Introduction to Uniqueness Typing An important property of pure functional programming languages is referential transparency: the same expression used twice must have the same value twice. This makes equational reasoning possible and aids program analysis, but most languages do not have this property. For example, in the following C fragment,
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 4 (0 self)
 Add to MetaCart
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
Type Structure
"... Haskell’s multiparameter type classes, together with functional dependencies, allow the specification of complex typelevel operations, and the recent introduction of open type families in GHC makes such typelevel programming even more accessible and flexible. But typelevel code is special in tha ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
Haskell’s multiparameter type classes, together with functional dependencies, allow the specification of complex typelevel operations, and the recent introduction of open type families in GHC makes such typelevel programming even more accessible and flexible. But typelevel code is special in that its correctness is crucial to the safety of the program; so except in those cases simple enough for the type checker to see trivially that the code is correct (or harmless), typelevel programs need to come with their specification and correctness proof. In this article, we propose an extension to Haskell that allows the specification of invariants for type classes and open type families, together with accompanying evidence that those invariants hold. To accommodate the open nature of type classes and type families, the evidence itself needs to be open and every subcase of the proof can be provided independently from the others.
Functional programming with structured graphs
 In Proceedings of the 17th ACM SIGPLAN international conference on Functional programming, ICFP ’12
, 2012
"... This paper presents a new functional programming model for graph structures called structured graphs. Structured graphs extend conventional algebraic datatypes with explicit definition and manipulation of cycles and/or sharing, and offer a practical and convenient way to program graphs in functional ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
This paper presents a new functional programming model for graph structures called structured graphs. Structured graphs extend conventional algebraic datatypes with explicit definition and manipulation of cycles and/or sharing, and offer a practical and convenient way to program graphs in functional programming languages like Haskell. The representation of sharing and cycles (edges) employs recursive binders and uses an encoding inspired by parametric higherorder abstract syntax. Unlike traditional approaches based on mutable references or node/edge lists, wellformedness of the graph structure is ensured statically and reasoning can be done with standard functional programming techniques. Since the binding structure is generic, we can define many useful generic combinators for manipulating structured graphs. We give applications and show how to reason about structured graphs.
Concoqtion: Mixing dependent types and HindleyMilner type inference (extended version
, 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

Cited by 2 (0 self)
 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. 1
ContextParametric Polykinded Types
 WGP'06
, 2006
"... Generic Haskell is a language extension of Haskell for polytypic programming. Constrained types are parametric algebraic types with at least one argument constrained by typeclass membership.We explain Generic Haskell, discuss the relevance of constrained types, and show that they are not supported ..."
Abstract

Cited by 2 (1 self)
 Add to MetaCart
Generic Haskell is a language extension of Haskell for polytypic programming. Constrained types are parametric algebraic types with at least one argument constrained by typeclass membership.We explain Generic Haskell, discuss the relevance of constrained types, and show that they are not supported by Generic Haskell. We propose contextparametric polykinded types as a solution, thereby making polytypic functions generic on a larger class of types. Our proposal entails an extension to the Generic Haskell compiler, not the language, and is therefore transparent to the generic programmer.