[Haskell-cafe] Trouble with record syntax and classes

ajb at spamcop.net ajb at spamcop.net
Mon Feb 26 21:33:19 EST 2007

G'day all.

Oh, one more thing.

Quoting Aaron McDaid <aaron at aaronmcdaid.com>:

> Somebody more knowledgeable can describe the etymology of the terms,

You can think of a type as a set of values.  For example, Bool is the
set { False, True }.  A "class", then, is a set of types.

The distinction between "set" and "class" comes from the various set
theories (Goedel-Bernays-von Neumann set theory being the most common)
which try to avoid Russell's Paradox.

For those who are don't know about Russell's Paradox, take a look at the
Wikipedia entry before going on:


The idea behind GBN set theory is to distinguish between "sets", which
are always well-behaved, and "classes", which are not necessarily so
well-behaved.  Russell's Paradox is resolved by setting up your axioms
such that the paradoxical "set of all sets with property X" is not,
itself, a set, but a class.

By analogy, we call a set of types, or a "set of sets", a "class".

Andrew Bromage

More information about the Haskell-Cafe mailing list