# What is the name of λx.λf.fx (like reverse apply) in lambda calculus? Does the corresponding function have a standard name in programming?

What is the name of λx.λf.fx in lambda calculus?

Does the corresponding function have a standard name in functional programming languages, like Haskell?

In object oriented programming, is there a usual name for a method `foo` which takes a function as an argument, such that `x.foo(f)` returns `f(x)`?

-
You need to buy a dictionary. –  Robert Harvey May 17 at 23:19
Which one? Where? How much? –  Alexey May 17 at 23:21
I do not understand the downvotes. It seems a perfectly reasonable question to me. –  Giorgio May 18 at 8:15
I have posted an answer below but I realised that the OP was asking what is the name of this lambda expression so I deleted =D –  TemporaryNickName May 18 at 8:52
The concept you refer to is known as a combinator, have a read here if you're not familiar en.wikipedia.org/wiki/SKI_combinator_calculus though I'm not familiar with a known combinator of the nature you refer to though, C from BCKW is close (it's flip) but not the same en.wikipedia.org/wiki/B,C,K,W_system why not have some fun and come up with the combination of those combinators that results in your function :) –  Jimmy Hoffa May 18 at 13:50

In Haskell, `\x.\f.f x` is `flip (\$)` which as `\$` is read as apply, I would read as reverse apply.

-
This wrong... flip is `\f.\x.\y.f y x` flip is C here en.wikipedia.org/wiki/B,C,K,W_system –  Jimmy Hoffa May 18 at 13:46
also adding `\$` to flip like this is expecting a partially applied function that takes over 2 arguments where you're going to only flip the last 2 so you partially apply all but those 2 –  Jimmy Hoffa May 18 at 13:52
So you doubt that `(\f.\x.\y.f y x) (\f.\x.f x)` reduces to `(\x.\f.f x)` modulo renaming? Which it does. –  Dan D. May 19 at 0:02

Using the standard combinators you can express this function as

``````C I
``````

where

``````C f x y = (f y) x
``````

``````flip id
``````

Here `id`'s type is specialized to `(a -> b) -> a -> b` and `flip` swaps `a -> b` and `a`.

You can also express it in the SKI calculus:

``````S (K (S I)) K
``````
-
+1 for deducing the combinators for this. I really don't suspect it's a much known thing, though if as he identified it's something related to church numerals, I'm inclined to wonder if CI is documented anywhere as relevant in anyones church numeral studies –  Jimmy Hoffa May 19 at 7:17