Abstract types have existential type
ACM Transactions on Programming Languages and Systems (TOPLAS)
How to make ad-hoc polymorphism less ad hoc
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)
Compiling polymorphism using intensional type analysis
POPL '95 Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Putting type annotations to work
POPL '96 Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
POPL '96 Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
The Java Language Specification
The Java Language Specification
Proceedings of the seventh ACM SIGPLAN international conference on Functional programming
A lightweight implementation of generics and dynamics
Proceedings of the 2002 ACM SIGPLAN workshop on Haskell
ESOP '92 Proceedings of the 4th European Symposium on Programming
Proceedings of the 5th ACM Conference on Functional Programming Languages and Computer Architecture
Journal of Functional Programming
RepLib: a library for derivable type classes
Proceedings of the 2006 ACM SIGPLAN workshop on Haskell
Proceedings of the 14th ACM SIGPLAN international conference on Functional programming
Unembedding domain-specific languages
Proceedings of the 2nd ACM SIGPLAN symposium on Haskell
SSDGP'06 Proceedings of the 2006 international conference on Datatype-generic programming
Parametricity, type equality, and higher-order polymorphism
Journal of Functional Programming
Journal of Functional Programming - Dedicated to ICFP 2009
Proceedings of the 8th ACM SIGPLAN workshop on Generic programming
Hi-index | 0.00 |
Comparing two types for equality is an essential ingredient for an implementation of dynamic types. Once equality has been established, it is safe to cast a value from one type to another. In a language with run-time type analysis, implementing such a procedure is fairly straightforward. Unfortunately, this naive implementation destructs and rebuilds the argument while iterating over its type structure. However, by using higher-order polymorphism, a casting function can treat its argument parametrically. We demonstrate this solution in two frameworks for ad-hoc polymorphism: intensional type analysis and Haskell type classes.