Skip to content

Instantly share code, notes, and snippets.

@gsg
Created February 26, 2016 17:30
Show Gist options
  • Save gsg/bc4d994f8ca3df56ed5c to your computer and use it in GitHub Desktop.
Save gsg/bc4d994f8ca3df56ed5c to your computer and use it in GitHub Desktop.
let r : int option ref = ref None
let test = Lazy.from_fun (fun () -> match !r with
| None -> assert false
| Some x -> x)
let _ = r := Some 42
let _ = print_int (Lazy.force test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment