Questions tagged [s-combinator]

Use s-combinator for questions related to creating a function which does generic partial function application

When the s-combinator S is applied to a set of combinators x y z, it yields a combinator that applies x to y after first substituting z into each of them. For example:

S x y z = x(z)(y(z))

References


Related tags
k-combinator

10 questions
17
votes
3 answers

S combinator in Haskell

Can an analog of the S combinator be expressed in Haskell using only standard functions (without defining it by equation) and without using lambda (anonymous function)? I expect it to by of type (a -> b -> c) -> (a -> b) -> a -> c. For example, an…
Alexey
  • 3,843
  • 6
  • 30
  • 44
6
votes
1 answer

S combinator in Erlang

I'm starting to learn lambda calculus and I need to implement I, S, K combinators in Erlang. Of course, S, K, I stands for: S = λxyz.xz(yz) K = λxy.x I = λx.x I have no problem understanding I=SKK transformation on paper (like presented here: To…
Krodak
  • 1,493
  • 14
  • 21
6
votes
4 answers

Conversion from lambda term to combinatorial term

Suppose there are some data types to express lambda and combinatorial terms: data Lam α = Var α -- v | Abs α (Lam α) -- λv . e1 | App (Lam α) (Lam α) -- e1 e2 deriving (Eq,…
3
votes
2 answers

To prove SKK and II are beta equivalent, lambda calculus

I am new to lambda calculus and struggling to prove the following. SKK and II are beta equivalent. where S = lambda xyz.xz(yz) K = lambda xy.x I = lambda x.x I tried to beta reduce SKK by opening it up, but got nowhere, it becomes to messy. Dont…
3
votes
1 answer

convert flip lambda into SKI terms

I'm having trouble converting the lambda for flip into the SKI combinators (I hope that makes sense). Here is my conversion: /fxy.fyx /f./x./y.fyx /f./x.S (/y.fy) (/y.x) /f./x.S f (/y.x) /f./x.S f (K x) /f.S (/x.S f) (/x.K x) /f.S (/x.S f) K /f.S (S…
Brad
  • 705
  • 7
  • 17
2
votes
1 answer

How to type the simply typed lambda calculus term (S K K)

I am attempting to implement a simply typed lambda calculus type checker. When running sanity tests I tried typing (S K K) and my type checker throws this error: TypeMismatch {firstType = t -> t, secondType = t -> t -> t} The offending term is…
2
votes
1 answer

How get Y combinator through S combinator or others?

I have the equation Y = FY (fixed point equation). How to get of it the equation for F through other combinator (in particular S- combinator with first fixed parameter)?
kvendingoldo
  • 311
  • 2
  • 4
  • 7
1
vote
1 answer

Does SKS equal SKK?

Context I started teaching myself lambda calculus last night and I am trying to determine if what I understand so far is correct. Understanding SKK is equivalent to the Identity combinator, I. Where L stands for lambda: S = LxLyLz((xz)(yz)) K =…
1
vote
1 answer

Lambda reductions prove S K = K I

Hello I am having trouble proving these combinators S K = K I The steps with the brackets [] are just telling you the step i am doing. For example [λxy.x / x] in λyz.x z(y z) means I am about to substitute (λxy.x) for every x in the expression…
0
votes
2 answers

Evaluating SKI-combinators with not enough arguments

I was tasked with showing that S(KK)I = K Now since S takes three arguments, I was simply stuck at the beginning not knowing how to tackle this. I see two arguments, namely (KK) and I but there is no third one I can "spot". What happens in this…