Download PDF

International Symposium on Practical Aspects of Declarative Languages, Date: 2014/01/20 - 2014/01/21, Location: San Diego, CA, USA

Publication date: 2014-02-07
Volume: 8324 Pages: 17 - 32
ISSN: 978-3-319-04131-5
Publisher: Springer International Publishing

Practical Aspects of Declarative Languages

Author:

Winant, Thomas
Devriese, Dominique ; Piessens, Frank ; Schrijvers, Tom ; Flatt, Matthew ; Guo, Hai-Feng

Keywords:

iMinds, Haskell, Hindley-Milner type inference, (partial) type signatures, wildcards

Abstract:

Strong type systems can be used to increase the reliability and performance of programs. In combination with type inference the overhead for the programmer can be kept small. Nevertheless, explicit type signatures often remain needed or useful. In languages with standard Hindley-Milner-based type systems, programmers have a binary choice between omitting the type signature (and rely on type inference) or explicitly providing the type entirely; there are no intermediate options. Proposals for partial type signatures exist, but none support features like local constraints and GHC's non-generalisation of local bindings. Therefore we propose and motivate a practical form of partial type signatures for present-day Haskell. We formally describe our proposal as an extension of the OutsideIn(X) system and prove some of its properties. We have developed a (not yet complete) implementation for the GHC Haskell compiler. Our design fits naturally in both the OutsideIn(X) formalism and the compiler. © 2014 Springer International Publishing.