Shared subtypes

Ki Yung Ahn, Tim Sheard · 2008

A newtype declaration in Haskell introduces a new type renaming an existing type. The two types are viewed by the programmer as semantically different, but share the same runtime representation. When operations on the two semantic views coincide, the run-time cost of conversion between the two types is reduced to zero (in both directions) because of this common representation.

Read the paper · More papers on PaperTik