| dup : [a] Share a. a -> { p1 : a, p2 : a }#; | |
| dup x = { p1 = x, p2 = x }; | |
| fun : [x]. x! -> Unit; | |
| fun x = Unit; | |
| test : [x]. x -> x; | |
| test x = let! (x) a = | |
| let y = dup x | |
| in Unit | |
| end | |
| in x | |
| end; | |
| badEscape : [x]. x -> x; | |
| badEscape x = let! (x) a = | |
| let y = dup x | |
| in y.p1 | |
| end | |
| in x | |
| end; | |
| test2 : [a]. a -> a; | |
| test2 x = let! (x) a = fun[a] x | |
| in x | |
| end; |