Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # fun x -> x x;;
- - : ('a -> 'b as 'a) -> 'b = <fun>
- # (fun x -> x x) (fun x -> x x);;
- C-c C-cInterrupted.
- # fun _ -> (fun x -> x x) (fun x -> x x);;
- - : 'a -> 'b = <fun>
- # (fun x -> x x) (fun x -> x x);;
- # let x = (fun x -> x x) in x x;; (* applying the function on the left *)
- # (fun x -> x x) (fun x -> x x);; (* inlining the let-binding *)
- (* We came back to our original state, infinite loop *)
- $ echo 'let x = (fun x -> x x) (fun x -> x x)' > rectypes.ml
- $ ocamlc -i -rectypes rectypes.ml
- val x : 'a
- # let x =
- let rec f () = f () in
- f ();;
Add Comment
Please, Sign In to add comment