# Theorems for free!

@inproceedings{Wadler1989TheoremsFF, title={Theorems for free!}, author={Philip Wadler}, booktitle={FPCA}, year={1989} }

From the type of a polymorphic function we can derive a theorem that it satisfies. Every function of the same type satisfies the same theorem. This provides a free source of useful theorems, courtesy of Reynolds’ abstraction theorem for the polymorphic lambda calculus.

#### 755 Citations

An Extension of System F with Subtyping

- Mathematics
- 1991

System F is a well-known typed λ-calculus with polymorphic types, which provides a basis for polymorphic programming languages. We study an extension of F, called F<:, that combines parametric… Expand

Free Theorems Involving Type Constructor Classes

- Mathematics
- 2008

Free theorems are a charm, allowing the derivation of useful statements about programs from their (polymorphic) types alone. We show how to reap such theorems not only from polymorphism over ordinary… Expand

A Complete Characterization of Observational Equivalence in Polymorphic lambda-Calculus with General References

- Mathematics, Computer Science
- CSL
- 2009

We give the first sound and complete proof method for observational equivalence in full polymorphic λ-calculus with existential types and first-class, higher-order references. Our method is syntactic… Expand

A Complete Characterization of Observational Equivalence in Polymorphic λ-Calculus with General References

- 2009

We give the first sound and complete proof method for observational equivalence in full polymorphic λ-calculus with existential types and first-class, higher-order references. Our method is syntactic… Expand

Breaking through the normalization barrier: a self-interpreter for f-omega

- Computer Science
- 2016

According to conventional wisdom, a self-interpreter for a strongly normalizing lambda-calculus is impossible. We call this the normalization barrier. The normalization barrier stems from a theorem...

Free theorems involving type constructor classes: functional pearl

- Computer Science
- ICFP 2009
- 2009

The prime application area is that of monads, which form the probably most popular type constructor class of Haskell, and this work deals with a transparent way of introducing difference lists into a program, endowed with a neat and general correctness proof. Expand

Parametric limits

- Computer Science
- Proceedings of the 19th Annual IEEE Symposium on Logic in Computer Science, 2004.
- 2004

A categorical model of polymorphic lambda calculi is developed using the notion of parametric limits, which extend the idea of limits in categories to reflexive graphs of categories and axiomatize the structure of Reflexive graphs needed for modelling parametric polymorphism. Expand

Parametric limits

- Mathematics
- LICS 2004
- 2004

We develop a categorical model of polymorphic lambda calculi using the notion of parametric limits, which extend the notion of limits in categories to reflexive graphs of categories. We show that a… Expand

A Logic for Parametric Polymorphism with Effects

- Computer Science
- TYPES
- 2007

A logic for reasoning about parametric polymorphism in combination with arbitrary computational effects (nondeterminism, exceptions, continuations, side-effects etc.) and how to verify correctness of polymorphic type encodings in the presence of effects is presented. Expand

A Characterization of lambda Definability in Categorical Models of Implicit Polymorphism

- Computer Science, Mathematics
- Theor. Comput. Sci.
- 1995

A category-theoretic framework known as glueing or sconing is used to extend the Jung-Tiuryn (1993) characterization of lambda definability first to ccc models, and then to categorical models of the calculus with type variables. Expand

#### References

SHOWING 1-10 OF 46 REFERENCES

Polymorphism is not Set-Theoretic

- Mathematics, Computer Science
- Semantics of Data Types
- 1984

It is proved that the standard set-theoretic model of the ordinary typed lambda calculus cannot be extended to model this language extension in which polymorphic functions can be defined. Expand

Semantic parametricity in polymorphic lambda calculus

- Mathematics, Computer Science
- [1988] Proceedings. Third Annual Information Symposium on Logic in Computer Science
- 1988

A larger setting is presented that does not use retract pairs and keeps intact a basic feature of a certain function-type constructor that is essential for the parametricity of polymorphic functions. Expand

Relating models of polymorphism

- Computer Science
- POPL '89
- 1989

A new general notion of model for the polymorphic lambda calculus based on the simple idea of a universe, which can be used to unify and relate many different notions of model that have been proposed in the literature, including those that extend the basic calculus with additional features such as fixpoints or with a type of all types. Expand

Three Approaches to Type Structure

- Mathematics, Computer Science
- TAPSOFT, Vol.1
- 1985

We examine three disparate views of the type structure of programming languages: Milner's type deduction system and polymorphic let construct, the theory of subtypes and generic operators, and the… Expand

Proofs and types

- Mathematics
- 1989

Sense, denotation and semantics natural deduction the Curry-Howard isomorphism the normalisation theorem Godel's system T coherence spaces denotational semantics of T sums in natural deduction system… Expand

Introduction to functional programming

- Computer Science
- Prentice Hall International series in computer science
- 1988

This is a thorough introduction to the fundamental concepts of functional programming that includes a simple, yet coherent treatment of the Haskell class; a calculus of time complexity; and new coverage of monadic input-output. Expand

A Theory of Type Polymorphism in Programming

- Computer Science
- J. Comput. Syst. Sci.
- 1978

This work presents a formal type discipline for polymorphic procedures in the context of a simple programming language, and a compile time type-checking algorithm w which enforces the discipline. Expand

Second-Order Logical Relations (Extended Abstract)

- Mathematics, Computer Science
- Logic of Programs
- 1985

This work defines logical relations for second-order typed lambda calculus and uses these relations to give a semantic characterization of second- order lambda definability and to state and prove a general representation independence theorem. Expand

Miranda: A Non-Strict Functional language with Polymorphic Types

- Computer Science
- FPCA
- 1985

data types Many of the data types which in other languages would have to be expressed as abstract data types can be represented in Miranda as algebraic data types with associated laws. Nevertheless… Expand

Extensional Models for Polymorphism

- Computer Science
- TAPSOFT, Vol.2
- 1987

We present a general method for constructing extensional models for the Girard-Reynolds polymorphic lambda calculus the polymorphic extensional collapse. The method yields models that satisfy… Expand