1

What is the difference between combinator and supercombinator? Both of them do not contain any free variables. That is the one thing, that I know.

asked Feb 20, 2019 at 12:52
1

1 Answer 1

3

A supercombinator is either a constant, or a combinator which contains only supercombinators as subexpressions.

Or more completely,

Any lambda expression is of the form \x1 x2 .. xn -> E, where E is not a lambda abstraction and n≥0. (Note that if the expression is not a lambda abstraction, n=0.) This is a supercombinator if and only if:

  • the only free variables in E are x1..xn, and
  • every lambda abstraction in E is a supercombinator.

A combinator does not contain any free variable, but might have a subexpression that does. For example, from Haskell Wiki: Super combinator

\f g -> f (\x -> g x 2)

the outer lambda function is indeed a combinator because it has no free variables, however its subexpression \x -> g x 2 has a free variable (g), so it is not a combinator. It follows that \f g -> f (\x -> g x 2) cannot be a supercombinator

answered Feb 20, 2019 at 20:39
Sign up to request clarification or add additional context in comments.

2 Comments

To be fair, that definition at the top is written in such a way that the only possible super combinator is a constant. For example, \x -> x cannot be a super combinator, because (1) it is not a constant, and (2) it contains a subexpression x, which is not a super combinator.
@FyodorSoikin The definition is from the Haskell Wiki and I only took the simple bit because I thought it was obvious what it meant, but I'll update it now

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.