Principal Type Inference for GHC-Style Multi-parameter Type Classes
Author(s) -
Martin Sulzmann,
Tom Schrijvers,
Peter J. Stuckey
Publication year - 2006
Publication title -
lecture notes in computer science
Language(s) - English
Resource type - Book series
SCImago Journal Rank - 0.249
H-Index - 400
eISSN - 1611-3349
pISSN - 0302-9743
ISBN - 3-540-48937-1
DOI - 10.1007/11924661_2
Subject(s) - haskell , type inference , computer science , type (biology) , inference , compiler , principal (computer security) , programming language , artificial intelligence , theoretical computer science , functional programming , ecology , biology , operating system
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.status: publishe
Accelerating Research
Robert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom
Address
John Eccles HouseRobert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom