Programming Language Theory: Difference between revisions

No edit summary
No edit summary
Line 13: Line 13:
* <tt>succ ≡ λn. λf. λx. f (n f x)</tt> (β-equivalent to <tt>(plus 1)</tt> for a defined <tt>1</tt>)
* <tt>succ ≡ λn. λf. λx. f (n f x)</tt> (β-equivalent to <tt>(plus 1)</tt> for a defined <tt>1</tt>)
* <tt>mult ≡ λm. λn. λf. n (m f)</tt> (from f<sup>(m * n)</sup> = (f<sup>m</sup>)<sup>n</sup>)
* <tt>mult ≡ λm. λn. λf. n (m f)</tt> (from f<sup>(m * n)</sup> = (f<sup>m</sup>)<sup>n</sup>)
The Church booleans take two arguments, and evaluate to one of them:
* <tt>true ≡ λa. λb . a</tt>
* <tt>false ≡ λa. λb . b</tt>
Common syntactic sugar:
Common syntactic sugar:
* Left-associative application as implicit parentheses
* Left-associative application as implicit parentheses