1 research outputs found

    Parametricity as Subtyping

    No full text
    A polymorphic function is parametric if it has uniform behavior for all type parameters. This property is useful when writing, reasoning about, and compiling functional programs. We show how to syntactically define and reason about parametricity in a language with intersection types and bounded polymorphism. Within this framework, parametricity is subtyping, and reasoning about parametricity becomes reasoning about the well-typedness of terms. This work also demonstrates the expressiveness of languages that combine intersection types and bounded polymorphism. 1 Introduction A polymorphic function is parametric if it uses the same algorithm regardless of which type parameter is instantiated. As a consequence, it has a uniform behavior over all type parameters, in the sense that for any related inputs, the function produces related outputs. Let us look at an example. Consider the polymorphic "doubling" function double = ø : f ø!ø : x ø : f (fx) : 8ø: (ø!ø )!(ø!ø ) : By passing int and..
    corecore