Source

lambda-translator / gen_javascript.ml

1
2
3
4
5
6
open Term

let rec gen = function
  | Var v -> v
  | Abs (v, t) -> "(function (" ^ v ^ ") { return (" ^ gen t ^ "); })"
  | App (t1, t2) -> gen t1 ^ "(" ^ gen t2 ^ ")"