Source

lambda-translator / gen_ruby.ml

1
2
3
4
5
6
open Term

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