let rec print fmt t = let {f=x; xs=l; ty=ty} = view t in match x, l with | Sy.Op op, [e1; e2] -> fprintf fmt "(%a %a %a)" print e1 Sy.print x print e2 | _, [] -> fprintf fmt "%a" Sy.print x | _, _ -> fprintf fmt "%a(%a)" Sy.print x print_list l and print_list fmt = function | [] -> () | [t] -> print fmt t | t::l -> Format.fprintf fmt "%a,%a" print t print_list l