Also reminds me of this: <https://aphyr.com/posts/...
# getting-started
g
k
Haha I tried to read that once but I can't stand the writing style.
b
Every time I see Church Numerals, I die a little inside 😂
😂 1
h
Are church numerals when values are aligned vertically, leading sometimes to the values for a single member more than ten spaces away from its declaration?
k
I believe they're the formal definitions of the numbers in these higher order type systems.
So for the linked article basically this part:
Copy code
data Z
data S n

type N0 = Z
type N1 = S N0
type N2 = S N1
type N3 = S N2
type N4 = S N3
type N5 = S N4
type N6 = S N5
type N7 = S N6
type N8 = S N7
g
That's it for the numerals indeed, but the Church concept from lambda calculus is basically the core of the article
b
Church numerals are where:
Copy code
0 = x
1 = f(x)
2 = f(f(x))
3 = f(f(f(x)))
4 = f(f(f(f(x))))
etc. For short, they are also written
Copy code
0 = f⁰(x)
1 = f¹(x)
2 = f²(x)
3 = f³(x)
4 = f⁴(x)
etc. https://en.wikipedia.org/wiki/Church_encoding#Church_numerals