Closed keigoi closed 7 years ago
Nope, this actually compromises linearity. A short example:
let f () =
let%lin #s = [%linval Data !!s ]
in
match%lin get s with
| _ -> return () (* here the content of s is disposed without actually using it *)
At least, we must limit the use of Data inside %linval and forbid !!s inside Data
Data should be public, while Lin is not. Make this distinction more explicit -- remove from Data and rename Lin__ to "Lin_Internal__" or something