How to make ad-hoc polymorphism less ad hoc
POPL '89 Proceedings of the 16th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
A calculus for overloaded functions with subtyping
Information and Computation
Type checking higher-order polymorphic multi-methods
Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Contraint-based polymorphism in Cecil: towards a practical and static type system
Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley))
Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley))
A language for generic programming
A language for generic programming
MultiJava: Design rationale, compiler implementation, and applications
ACM Transactions on Programming Languages and Systems (TOPLAS)
A constraint-based approach to guarded algebraic data types
ACM Transactions on Programming Languages and Systems (TOPLAS)
Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Modular multiple dispatch with multiple inheritance
Proceedings of the 2007 ACM symposium on Applied computing
Java type inference is broken: can we fix it?
Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications
Parameterized modules for classes and extensible functions
ECOOP'06 Proceedings of the 20th European conference on Object-Oriented Programming
JavaGI: generalized interfaces for java
ECOOP'07 Proceedings of the 21st European conference on Object-Oriented Programming
COQ mechanization of featherweight fortress with multiple dispatch and multiple inheritance
CPP'11 Proceedings of the First international conference on Certified Programs and Proofs
Implementing federated object systems
ECOOP'13 Proceedings of the 27th European conference on Object-Oriented Programming
Journal of Computer Security - Foundational Aspects of Security
Hi-index | 0.00 |
In previous work, we presented rules for defining overloaded functions that ensure type safety under symmetric multiple dispatch in an object-oriented language with multiple inheritance, and we showed how to check these rules without requiring the entire type hierarchy to be known, thus supporting modularity and extensibility. In this work, we extend these rules to a language that supports parametric polymorphism on both classes and functions. In a multiple-inheritance language in which any type may be extended by types in other modules, some overloaded functions that might seem valid are correctly rejected by our rules. We explain how these functions can be permitted in a language that additionally supports an exclusion relation among types, allowing programmers to declare "nominal exclusions" and also implicitly imposing exclusion among different instances of each polymorphic type. We give rules for computing the exclusion relation, deriving many type exclusions from declared and implicit ones. We also show how to check our rules for ensuring the safety of overloaded functions. In particular, we reduce the problem of handling parametric polymorphism to one of determining subtyping relationships among universal and existential types. Our system has been implemented as part of the open-source Fortress compiler.