Skip to content

Instantly share code, notes, and snippets.

@gsg
Created March 29, 2016 14:42
Show Gist options
  • Save gsg/7ad656421d83cf52d717 to your computer and use it in GitHub Desktop.
Save gsg/7ad656421d83cf52d717 to your computer and use it in GitHub Desktop.
let test n list =
let cons = ref list in
for i = 0 to n - 1 do
match !cons with
| [] -> ()
| _::xs -> cons := xs
done;
!cons
let test2 observe n list =
let cons = ref list in
for i = 0 to n - 1 do
observe cons;
match !cons with
| [] -> ()
| _::xs -> cons := xs
done;
!cons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment