Lambda calculus implementation in Scala