python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k 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