Created
March 29, 2016 14:42
-
-
Save gsg/7ad656421d83cf52d717 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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