dhilst / rlambda

Right associative application lambda calculus in python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Right associative application lambda calculus

I always wonder what implications would rigth associative applications bring. This is a simple implementation of lambda calculus with a simple parser and eval function and some tests

Grammar

  • Abstraction : VAR "=>" expr, right associative
  • Variable : VAR
  • Application expr expr, rigth associative
  • Parenthesized expression : "(" expr ")"
  • VAR : Basically a regex \w+

Right Associativity

While common lambda calculus have left associative applications, this one have right associative application.

  • Left associative f a b c = (((f a) b) c)
  • Right associative c b a f = (c (b (a f)))

Blog post

You may want to take a look on this blog post where I explain the motivations behind this.

About

Right associative application lambda calculus in python


Languages

Language:Python 100.0%