Type-checking multi-parameter type classes

被引:0
|
作者
Duggan, Dominic [1 ]
Ophel, John [2 ]
机构
[1] Department of Computer Science, Stevens Institute of Technology, Castle Point on the Hudson, Hoboken, NJ 07030, United States
[2] Department of Computer Science and Computer Engineering, La Trobe University, Bundoora, Vic. 3083, Australia
关键词
Algorithms - Problem solving - Recursive functions - Vectors;
D O I
10.1017/s0956796801004233
中图分类号
学科分类号
摘要
Type classes are a novel combination of parametric polymorphism and constrained types. Although most implementations restrict type classes to be single-parameter, the generalization to multi-parameter type classes has gained increasing attention. A problem with multiparameter type classes is the increased possibilities they introduce for ambiguity in inferred types, impacting their usefulness in many practical situations. A new type-checking strategy, domain-driven unifying resolution, is identified as an approach to solve these problems. Domaindriven unifying resolution is simple, efficient, and practically useful. However, even with severe restrictions on instance definitions, it is not possible to guarantee that type-checking with unifying resolution terminates. This is in contrast with the naive generalization of single parameter resolution strategies. Domain-driven unifying resolution is guaranteed to terminate if the type class constraints are satisfiable; however satisfiability is undecidable even with severe restrictions on instance definitions. These results shed some light on ambiguity problems with multi-parameter type classes.
引用
收藏
页码:133 / 158
相关论文
共 50 条
  • [1] Type-checking multi-parameter type classes
    Duggan, D
    Ophel, J
    JOURNAL OF FUNCTIONAL PROGRAMMING, 2002, 12 : 133 - 158
  • [2] Type-checking smalltalk
    Drossopoulou, Sophia
    Karathanos, Stephan
    Yang, Dan
    JOOP - Journal of Object-Oriented Programming, 1996, 8 (08):
  • [3] TYPE-CHECKING SMALLTALK
    JOHNSON, RE
    SIGPLAN NOTICES, 1986, 21 (11): : 315 - 321
  • [4] Type-checking Smalltalk
    Drossopoulou, S
    Karathanos, S
    Yang, D
    JOURNAL OF OBJECT-ORIENTED PROGRAMMING, 1996, 8 (08): : 43 - &
  • [5] Principal type inference for GHC-style multi-parameter type classes
    Sulzmann, Martin
    Schrijvers, Tom
    Stuckey, Peter J.
    PROGRAMMING LANGUAGES AND SYSTEMS, PROCEEDINGS, 2006, 4279 : 26 - 43
  • [6] Incremental Type-Checking for Free
    Zwaan, Aron
    van Antwerpen, Hendrik
    Visser, Eelco
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2022, 6 (OOPSLA):
  • [7] Type-Checking CRDT Convergence
    Zakhour, George
    Weisenburger, Pascal
    Salvaneschi, Guido
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2023, 7 (PLDI):
  • [8] A SYNTHESIS OF TYPE-CHECKING AND PARSING
    MCCROSKY, C
    SAILOR, K
    COMPUTER LANGUAGES, 1993, 18 (04): : 241 - 250
  • [9] Sets, types and type-checking
    Turner, R
    JOURNAL OF LOGIC AND COMPUTATION, 1999, 9 (06) : 959 - 975
  • [10] TYPE-CHECKING IN AN UNTYPED LANGUAGE
    RAMSAY, A
    INTERNATIONAL JOURNAL OF MAN-MACHINE STUDIES, 1984, 20 (02): : 157 - 167