2 ms·
It's an example of Combinatory Logic. For another example check out SKI combinators. SKI is actually kind of close to this but using three combinators instead o
by Jtsummers 2y ago
It's an example of Combinatory Logic. For another example check out SKI combinators. SKI is actually kind of close to this but using three combinators instead of one it's a bit simpler to understand (IMO).
https://en.wikipedia.org/wiki/Combinatory_logic https://en.wikipedia.org/wiki/Combinatory_logic
https://en.wikipedia.org/wiki/SKI_combinator_calculus https://en.wikipedia.org/wiki/SKI_combinator_calculus
- chriswarbo 2y agoNote that the I combinator is redundant since `I = SK`, so all we really need is `SK`. There are alternatives like Iota with a single combinator, but they're essentially an obfuscated mix of S and K; so it's usually clearer to stick with SK. Note that the first two rules of this Tree Calculus are precisely those of K and S.
- tromp 2y ago> I = SK Wrong. I = S K M where M can be anything: I x = S K M x = K x (M x) = x K and S K represent True and False, since K x y = x and S K x y = y. > essentially an obfuscated mix of S and K Most alternatives are tuples of S and K like λz. z S K or λz. z K S K. But the arguably shortest one is indeed a proper mix: A = λx λy λz. x z (y (λ. z)) = λx λy λz. x z (y (K z))
- chriswarbo 2y agoOops, sorry; I got part way through writing I = S K K, but went off to another tab to double-check, and forgot to update that expression when I came back! You're absolutely right.