Hacker News new | ask | show | jobs
by ZoltanAK2 1688 days ago
Cantor space is just the space formed by infinite binary sequences, that is sequences which assumes only the values 0 or 1.

Considered as a topological space, Cantor space happens to have the same structure as the Cantor set, a highly disconnected subset of the real numbers that has some at-first-unintuitive properties.

But you don't have to understand, or even worry about this correspondence to grasp what's going on with seemingly impossible functional programs. Thinking about Cantor space as "the type of infinite binary sequences" is good enough.

1 comments

> Considered as a topological space, Cantor space happens to have the same structure as the Cantor set […]

And this is, intuitively, because every element of the (standard) Cantor set can be expressed as a trinary number in the range [0, 1) where every digit is either 0 or 2 (because at every level the middle third is excluded in the construction of the set). That is, a string of exactly two symbols – that is, a bitstring.

(Late edit: [0, 1] of course rather than [0, 1) since famously 0.222…_3 = 1!)