Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132937 views
License: OTHER
1
type Church t = (t -> t) -> t -> t
2
3
int2church :: Integer -> Church t
4
int2church 0 s z = z
5
int2church n s z = int2church (n - 1) s (s z)
6
7
church2int :: Church Integer -> Integer
8
church2int n = n (+1) 0
9