How to make ad-hoc polymorphism less ad hoc
POPL '89 Proceedings of the 16th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Type checking records and variants in a natural extension of ML
POPL '89 Proceedings of the 16th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Dynamic typing in a statically typed language
ACM Transactions on Programming Languages and Systems (TOPLAS)
A type-theoretic approach to higher-order modules with sharing
POPL '94 Proceedings of the 21st ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Type inference for records in natural extension of ML
Theoretical aspects of object-oriented programming
A syntactic approach to type soundness
Information and Computation
Compiling polymorphism using intensional type analysis
POPL '95 Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Abstract models of memory management
FPCA '95 Proceedings of the seventh international conference on Functional programming languages and computer architecture
PolyP—a polytypic programming language extension
Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Type dispatch for named hierarchical types
Proceedings of the fourth ACM SIGPLAN international conference on Functional programming
Proceedings of the fourth ACM SIGPLAN international conference on Functional programming
Deciding type equivalence in a language with singleton kinds
Proceedings of the 27th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Fully reflexive intensional type analysis
ICFP '00 Proceedings of the fifth ACM SIGPLAN international conference on Functional programming
ACM Transactions on Programming Languages and Systems (TOPLAS)
The Definition of Standard ML
A type system for higher-order modules
POPL '03 Proceedings of the 30th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Scrap your boilerplate: a practical design pattern for generic programming
Proceedings of the 2003 ACM SIGPLAN international workshop on Types in languages design and implementation
Typed compilation of recursive datatypes
Proceedings of the 2003 ACM SIGPLAN international workshop on Types in languages design and implementation
Higher-Order Intensional Type Analysis
ESOP '02 Proceedings of the 11th European Symposium on Programming Languages and Systems
Generativity and dynamic opacity for abstract types
Proceedings of the 5th ACM SIGPLAN international conference on Principles and practice of declaritive programming
Global abstraction-safe marshalling with hash types
ICFP '03 Proceedings of the eighth ACM SIGPLAN international conference on Functional programming
Dependency-style generic haskell
ICFP '03 Proceedings of the eighth ACM SIGPLAN international conference on Functional programming
Regular expression pattern matching for XML
Journal of Functional Programming
Intensional polymorphism in type-erasure semantics
Journal of Functional Programming
Journal of Functional Programming
Scrap your boilerplate with class: extensible generic functions
Proceedings of the tenth ACM SIGPLAN international conference on Functional programming
Proceedings of the 2006 ACM SIGPLAN workshop on Generic programming
Type-safe distributed programming for OCaml
Proceedings of the 2006 workshop on ML
Dynamic Translucency with Abstraction Kinds and Higher-Order Coercions
Electronic Notes in Theoretical Computer Science (ENTCS)
Proceedings of the 14th ACM SIGPLAN international conference on Functional programming
Ad-hoc polymorphism and dynamic typing in a statically typed functional language
Proceedings of the 6th ACM SIGPLAN workshop on Generic programming
Journal of Functional Programming - Dedicated to ICFP 2009
Open and efficient type switch for C++
Proceedings of the ACM international conference on Object oriented programming systems languages and applications
Hi-index | 0.00 |
Two different ways of defining ad-hoc polymorphic operations commonly occur in programming languages. With the first form polymorphic operations are defined inductively on the structure of types while with the second form polymorphic operations are defined for specific sets of types.In intensional type analysis operations are defined by induction on the structure of types. Therefore no new cases are necessary for user-defined types, because these types are eQuivalent to their underlying structure. However, intensional type analysis is "closed" to extension, as the behavior of the operations cannot be differentiated for the new types, thus destroying the distinctions that these types are designed to express.Haskell type classes on the other hand define polymorphic operations for sets of types. Operations defined by class instances are considered "open"---the programmer can add instances for new types without modifying existing code. However, the operations must be extended with specialized code for each new type, and it may be tedious or even impossible to add extensions that apply to a large universe of new types.Both approaches have their benefits, so it is important to let programmers decide which is most appropriate for their needs. In this paper, we define a language that supports both forms of ad-hoc polymorphism, using the same basic constructs.