Type-safe cast

  • Weirich S
N/ACitations
Citations of this article
10Readers
Mendeley users who have this article in their library.

Abstract

In a language with non-parametric or ad-hoc polymorphism, it is possible to determine the identity of a type variable at run-time. With this facility, we can write a function to convert a term from one abstract type to another, if the two hidden types are identical. However, the naive implementation of this function requires that the term be destructed and rebuilt. In this paper, we show how to eliminate this overhead using higher-order type abstraction. We demonstrate this solution in two frameworks for ad-hoc polymorphism: intensional type analysis and type classes.

Cite

CITATION STYLE

APA

Weirich, S. (2000). Type-safe cast. ACM SIGPLAN Notices, 35(9), 58–67. https://doi.org/10.1145/357766.351246

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free