Theorems for Free!

June 1989Theorems for Free!Theorems for Free!

This function introduces what we now refer to as “free theorems”:

Write down the definition of a polymorphic function on a piece of paper. Tell me its type, but be careful not to let me see the function’s definition. I will tell you a theorem that the function satisfies.

The purpose of this paper is to explain the trick.

Author: Philip Wadler

Join Type Classes for courses and projects to get you started and make you an expert in FP with Haskell.