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.
@inproceedings{padl2014,
author = {Thomas Winant and
Dominique Devriese and
Frank Piessens and
Tom Schrijvers},
title = {Partial Type Signatures for Haskell},
pages = {17-32},
editor = {Matthew Flatt and
Hai-Feng Guo},
booktitle = {Practical Aspects of Declarative Languages (PADL)},
publisher = {Springer},
series = {Lecture Notes in Computer Science},
volume = {8324},
year = {2014},
isbn = {978-3-319-04131-5},
url = {/Research/papers/padl2014.pdf},
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.
},
}