Results 1  10
of
27
Formal Parametric Polymorphism
 THEORETICAL COMPUTER SCIENCE
, 1993
"... A polymorphic function is parametric if its behavior does not depend on the type at which it is instantiated. Starting with Reynolds's work, the study of parametricity is typically semantic. In this paper, we develop a syntactic approach to parametricity, and a formal system that embodies this ..."
Abstract

Cited by 125 (6 self)
 Add to MetaCart
A polymorphic function is parametric if its behavior does not depend on the type at which it is instantiated. Starting with Reynolds's work, the study of parametricity is typically semantic. In this paper, we develop a syntactic approach to parametricity, and a formal system that embodies this approach, called system R . Girard's system F deals with terms and types; R is an extension of F that deals also with relations between types. In R , it is possible to derive theorems about functions from their types, or "theorems for free", as Wadler calls them. An easy "theorem for free" asserts that the type "(X)XBool contains only constant functions; this is not provable in F. There are many harder and more substantial examples. Various metatheorems can also be obtained, such as a syntactic version of Reynolds's abstraction theorem.
Dynamics in ML
, 1993
"... Objects with dynamic types allow the integration of operations that essentially require runtime typechecking into staticallytyped languages. This article presents two extensions of the ML language with dynamics, based on our work on the CAML implementation of ML, and discusses their usefulness. ..."
Abstract

Cited by 56 (0 self)
 Add to MetaCart
Objects with dynamic types allow the integration of operations that essentially require runtime typechecking into staticallytyped languages. This article presents two extensions of the ML language with dynamics, based on our work on the CAML implementation of ML, and discusses their usefulness. The main novelty of this work is the combination of dynamics with polymorphism.
Functional unparsing
 Journal of Functional Programming
, 1998
"... A stringformatting function such as printf in C seemingly requires dependent types, because its control string determines the rest of its arguments. Examples: printf ("Hello world.\n"); printf ("The %s is %d.\n", "answer", 42); We show how changing the representation o ..."
Abstract

Cited by 45 (1 self)
 Add to MetaCart
A stringformatting function such as printf in C seemingly requires dependent types, because its control string determines the rest of its arguments. Examples: printf ("Hello world.\n"); printf ("The %s is %d.\n", "answer", 42); We show how changing the representation of the control string makes it possible to program printf in ML (which does not allow dependent types). The result is well typed and perceptibly more efficient than the corresponding library functions in Standard ML of New Jersey and in Caml. 1 The problem In ML, expressing a printflike function is not as trivial as in C. For example, we would like that evaluating the expression format "%i is %s%n " 3 "x" yields the string "3 is x\n", as specified by the pattern "%i is %s%n", which tells format to issue an integer, followed by the constant string " is ", itself followed by a string and ended by the newline character. What is the type of format? In this example, it is string> int> string> string but we would like our printflike function to handle any kind of pattern. For example, we would like format "%i/%i " 10 20 to yield "10/20". In that example, format is used with the type string> int> int> string However, we cannot do that in ML: format can only have one type. 622 O. Danvy 2
Notes on Sconing and Relators
, 1993
"... This paper describes a semantics of typed lambda calculi based on relations. The main mathematical tool is a categorytheoretic method of sconing, also called glueing or Freyd covers. Its correspondence to logical relations is also examined. 1 Introduction Many modern programming languages feature ..."
Abstract

Cited by 24 (0 self)
 Add to MetaCart
This paper describes a semantics of typed lambda calculi based on relations. The main mathematical tool is a categorytheoretic method of sconing, also called glueing or Freyd covers. Its correspondence to logical relations is also examined. 1 Introduction Many modern programming languages feature rather sophisticated typing mechanisms. In particular, languages such as ML include polymorphic data types, which allow considerable programming flexibility. Several notions of polymorphism were introduced into computer science by Strachey [Str67], among them the important notion of parametric polymorphism. Strachey's intuitive definition is that a polymorphic function is parametric if it has a uniformly given algorithm in all types, that is, if the function's behavior is independent of the type at which the function is instantiated. Reynolds [Rey83] proposed a mathematical definition of parametric polymorphic functions by means of invariance with respect to certain relations induced by typ...
TTClosed Relations and Admissibility
"... This paper reformulates and studies Pitts's operational concept of ..."
Abstract

Cited by 20 (0 self)
 Add to MetaCart
This paper reformulates and studies Pitts's operational concept of
Erasure and Polymorphism in Pure Type Systems
"... Abstract. We introduce Erasure Pure Type Systems, anextensionto Pure Type Systems with an erasure semantics centered around a type constructor ∀ indicating parametric polymorphism. The erasure phase is guided by lightweight program annotations. The typing rules guarantee that welltyped programs obe ..."
Abstract

Cited by 14 (0 self)
 Add to MetaCart
Abstract. We introduce Erasure Pure Type Systems, anextensionto Pure Type Systems with an erasure semantics centered around a type constructor ∀ indicating parametric polymorphism. The erasure phase is guided by lightweight program annotations. The typing rules guarantee that welltyped programs obey a phase distinction between erasable (compiletime) and nonerasable (runtime) terms. The erasability of an expression depends only on how its value is used in the rest of the program. Despite this simple observation, most languages treat erasability as an intrinsic property of expressions, leading to code duplication problems. Our approach overcomes this deficiency by treating erasability extrinsically. Because the execution model of EPTS generalizes the familiar notions of type erasure and parametric polymorphism, we believe functional programmers will find it quite natural to program in such a setting. 1
Parametricity as a Notion of Uniformity in Reflexive Graphs
, 2002
"... data types embody uniformity in the form of information hiding. Information hiding enforces the uniform treatment of those entities that dier only on hidden information. ..."
Abstract

Cited by 11 (3 self)
 Add to MetaCart
data types embody uniformity in the form of information hiding. Information hiding enforces the uniform treatment of those entities that dier only on hidden information.
Parametric and TypeDependent Polymorphism
, 1995
"... Data Types, though, as Reynolds stresses, is not perfectly suited for higher type or higher order systems and, thus, he proposes a "relational" treatment of invariance: computations do not depend on types in the sense that they are "invariant" w.r.t. arbitrary relations on types ..."
Abstract

Cited by 10 (5 self)
 Add to MetaCart
Data Types, though, as Reynolds stresses, is not perfectly suited for higher type or higher order systems and, thus, he proposes a "relational" treatment of invariance: computations do not depend on types in the sense that they are "invariant" w.r.t. arbitrary relations on types and between types. Reynolds's approach set the basis for most of the current work on parametricity, as we will review below (.3). Some twelve years earlier, Girard had given just a simple hint towards another understanding of the properties of "computing with types". In [Gir71], it is shown, as a side remark, that, given a type A, if one defines a term J A such that, for any type B, J A B reduces to 1, if A = B, and reduces to 0, if A ¹ B, then F + J A does not normalize. In particular, then, J A is not definable in F. This remark on how terms may depend on types is inspired by a view of types which is quite different from Reynolds's. System F was born as the theory of proofs of second order intuitionis...
Types, potency, and idempotency: why nonlinearity and amnesia make a type system work
 In ICFP ’04: Proceedings of the ninth ACM SIGPLAN international conference on Functional programming, 138–149, ACM
, 2004
"... Useful type inference must be faster than normalization. Otherwise, you could check safety conditions by running the program. We analyze the relationship between bounds on normalization and type inference. We show how the success of type inference is fundamentally related to the amnesia of the type ..."
Abstract

Cited by 8 (1 self)
 Add to MetaCart
Useful type inference must be faster than normalization. Otherwise, you could check safety conditions by running the program. We analyze the relationship between bounds on normalization and type inference. We show how the success of type inference is fundamentally related to the amnesia of the type system: the nonlinearity by which all instances of a variable are constrained to have the same type. Recent work on intersection types has advocated their usefulness for static analysis and modular compilation. We analyze SystemI (and some instances of its descendant, System E), an intersection type system with a type inference algorithm. Because SystemI lacks idempotency, each occurrence of a variable requires a distinct type. Consequently, type inference is equivalent to normalization in every single case, and time bounds on type inference and normalization are identical. Similar relationships hold for other intersection type systems without idempotency. The analysis is founded on an investigation of the relationship between linear logic and intersection types. We show a lockstep correspondence between normalization and type inference. The latter shows the promise of intersection types to facilitate static analyses of varied granularity, but also belies an immense challenge: to add amnesia to such analysis without losing all of its benefits.