Posted:

**Apr 21, 2016 7:59 pm**I've got a library in a couple of programming languages where, given an enumeration of data, you can apply a binary operation to generate an enumeration of all binary applications of that data. This can be defined in a nice way that makes it an example of a very common structure that occurs in algebra, and there it diverges slightly from what Cantor was doing, but it does allow you to enumerate the rationals by saying:

where (%) takes a numerator and denominator and gives you the fraction, and nats is the enumeration of naturals.

- Code: Select all
`liftA2 (%) nats nats`

where (%) takes a numerator and denominator and gives you the fraction, and nats is the enumeration of naturals.