~$ ./fun OCaml version 4.02.3 Camlp5 parsing version 6.14 # fun x -> x+3 ;; - : int -> int = # (fun x -> x+3) 5 ;; - : int = 8 # fun x -> if x=0 then true else false ;; - : int -> bool = # (fun x -> if x=0 then true else false) 1 ;; - : bool = false # (fun x -> if x=0 then true else false) 0 ;; - : bool = true # (fun x -> (x 3)+(x 2)) (fun y -> y*2) ;; - : int = 10 # recfun f x -> if x=0 then 1 else x * f (x-1) ;; - : int -> int = # (recfun f x -> if x=0 then 1 else x * f (x-1)) 10 ;; - : int = 3628800 #