Re:Fexl - a Function Expression Language
by fexl on Friday July 01, 2011 @03:04PM
(#2719703)
Now on another topic which I find interesting, consider how the abstraction algorithm (conversion to combinators) can be simplified with the use of two helper functions L and R:
\L = (\x\y\z (x z) y) # send z to left side only
\R = (\x\y\z x (y z)) # send z to right side only
Of course these can be defined in terms of S and C but I just implement them directly in the interpreter for efficiency.
Now let's abstract the Q definition using L and R in addition to S and C where possible:
\Q = (\x\y x (y y))
\Q = (\x R x (\y y y))
\Q = (\x R x (S I I))
\Q = (L (\x R x) (S I I))
\Q = (L R (S I I))
That's much more compact than just using S and C alone.
Now let's abstract the Q definition using L and R in addition to S and C where possible:
That's much more compact than just using S and C alone.