Principal type inference for GHC-Style multi-parameter type classes

  • Authors:
  • Martin Sulzmann;Tom Schrijvers;Peter J. Stuckey

  • Affiliations:
  • School of Computing, National University of Singapore, Singapore;Department of Computer Science, Katholieke Universiteit Leuven, Heverlee, Belgium;NICTA Victoria Laboratory, Department of Computer Science and Software Engineering, The University of Melbourne, Australia

  • Venue:
  • APLAS'06 Proceedings of the 4th Asian conference on Programming Languages and Systems
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

We observe that the combination of multi-parameter type classes with existential types and type annotations leads to a loss of principal types and undecidability of type inference. This may be a surprising fact for users of these popular features. We conduct a concise investigation of the problem and are able to give a type inference procedure which, if successful, computes principal types under the conditions imposed by the Glasgow Haskell Compiler (GHC). Our results provide new insights on how to perform type inference for advanced type extensions.