λx.

From Esolang
Jump to navigation Jump to search

λx. is a esolang version of lambda calculus created by User:Yayimhere. it's a 4 instruction esolang

how it works

λx. works like lambda calculus(written a little differently) but the only thing you can do is the λx. hence the name. its written like this:

λx. (A)

this creates a function A which can be used in other functions. now the only thing you can add is more λx.'s inside. so this is a valid expression:

λx. (λx. ) (A)

this is not:

λx. x (A)

other than that it evaluates normally. to reference a function A with input x:

λx(A)

there is a 3 extra rule for reduction:

  1. two functions nested(so for example λx.λy. with nothing in the body will move together(so the example provided before becomes λxy.λ.)
  2. a empty function with no arguments nor a body will simplify to nothing
  3. a function with no body but a argument will just leave the argument(so λxy. becomes xy)

and a 2 changes:

if something encased by brackets and does not hold a function the bracket will no be lifted
beta reduction applies to the function inputs

also is replaced with user input and will output the following expression. else than these changes nothing id diffrent from normal lambda calculus

a simple example

heres a simple example:

λx. (λy. (λx.λy.) (A) ) (B)
λλworld(A)hello(B)

this simplifies to:

(hello world.)

so that function reverses the input

examples

Cat program:

λinput. λinput. (cat)
ẋ λẎ(cat)

identity function:

λx. λx. (identity)