python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How would the factorial using y-combinator simplify after repeated substitutions?
I am playing around with understanding how the Y-combinator works in functional programming. I have a basic factorial function which I have translated to:
console.log((f => n => (n===0) ? 1 ...
David542
Votes: 0
Answers: 0
How to encode two distinct Unit types using church encoding
I was studying Haskell and happened to know the church encoding of algebraic data types. For example, the unit type in Haskell can be encoded as a polymorphic function type. But one can also define a ...
Yuxiang Wei
Votes: 0
Answers: 0
Defining lambda addition without using the successor function
I am familiar with defining the ADD function on top of the SUCC function, such as in the following:
const ONE = f => a => f(a);
const SUCC = n => f => a => f(n(f)(a)); // ...
David542
Votes: 0
Answers: 1
beta-reduction in lambda-calculus
I am extremely confused about this one.
Given the following rule ("Type and Programming Languages", Benjamin Pierce, page 72):
(λx.t)v2 -> [x -> v2]t (* E-AppAbs*)
Later in the same...
dgan
Votes: 0
Answers: 0