Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> how else would you define multiplication?

In Church arithmetic, multiplication is defined as function composition; that is, the dot operator `.` in Haskell-like languages. Addition is considerably more complex; it is defined as `lift (.)`. Exponentiation is even simpler; it is function application, so the `id` function - except that we write exponentiation backwards, so actually `flip id`.




Interesting, what about tetration then?


Good question: you can define m↑↑n as:

    \m n -> n (exp m) 1'
where `exp` is Church exponentiation, `flip id`, and `1'` is the Church numeral for 1, that is, `id`. According to pointfree.io this expands to:

    flip flip id . flip id . flip id
Which isn't particularly illuminating. Pentation isn't much worse, though:

    flip flip id . flip id . flip flip id . flip id . flip id




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: