|
|
|
|
|
by carapace
2020 days ago
|
|
Look here mate yer over thinking it innit? In Python: S = lambda x: lambda y: lambda z: x(z)(y(z))
K = lambda x: lambda y: x
I = lambda x: x
That there is runnable code and with it you can implement numbers, math, logic, etc.That's all the SKI combinators are: those functions. You apply them to themselves in various patterns and they model numbers and arithmetic and programming languages. In [1]: S = lambda x: lambda y: lambda z: x(z)(y(z))
In [2]: K = lambda x: lambda y: x
In [3]: I = lambda x: x
In [4]: K(I)
Out[4]: <function __main__.<lambda>.<locals>.<lambda>(y)>
In [5]: _(S) is I
Out[5]: True
In [6]: K(I)(S) is I
Out[6]: True
Hope that helps. |
|
TypeError: 'int' object is not callable