>

Examples

Grammar

// Input of prompt
<input>
    := <assignment>
    | <lambda-expr>

<assignment>
    := let <alias-identifier> = <lambda-expr>

<lambda-expr>
    := <abstraction>
    | <applications>

<applications>
    := <identifier>
    | <number>
    | <alias-identifier>
    | ( <applications> )
    | ( <abstraction> )
    | <applications> <applications>

<number> := 0 | 1 | ...

// You can also use "\" instead of "λ"
<abstraction>
    := λ <abstraction'>

<abstraction'>
    := <identifier> <abstraction-bindings>
    | <identifier> . <lambda-expr>

// <alias-identifier> must start with an uppercase char
Source code on github