I haven't posted here in awhile. It has been brought to my attention that there are only 35 Google search results for "iota combinator". This needs to be corrected
( Read more... )
Re: historycalcnerd256November 29 2008, 17:48:26 UTC
A linguist by the name of Chris Barker found that one can simplify the SKI combinator from two symbols (S and K) to just one: a function that takes a parameter, passes S to it, and then passes K to the result of that.
functional groupcalcnerd256November 29 2008, 17:52:26 UTC
ι ι = I = λ x . x ι I = Church's 0 = Church's false = λ f x . x ι 0 = K = Church's true = λ x y . x ι K = S = λ f g x . f x (g x) ι S = λ x y . x y x ι (ι S) = I
//Javascript: function iota(x){ return x( function S(f){ return function(g){ return function(y){ return f(y)(g(y)) }; }; } )( function K(y){ return function(){return y;}; } ); } //could be better: those closures are a nightmare to debug
Comments 82
Reply
Reply
Reply
Reply
ι I = Church's 0 = Church's false = λ f x . x
ι 0 = K = Church's true = λ x y . x
ι K = S = λ f g x . f x (g x)
ι S = λ x y . x y x
ι (ι S) = I
Reply
I, 0, K, S, ιS
Reply
Reply
Scheme:
Haskell:
Ruby:
Python:
:D
Reply
function iota(x){
return x(
function S(f){
return function(g){
return function(y){
return f(y)(g(y))
};
};
}
)(
function K(y){
return function(){return y;};
}
);
}
//could be better: those closures are a nightmare to debug
Reply
Leave a comment