keigoi / linocaml

Monad-based linear types in OCaml, with a few syntax extensions
Apache License 2.0
37 stars 4 forks source link

More liberal expression in [%linval ... ] #4

Open keigoi opened 7 years ago

keigoi commented 7 years ago

Currently, only function application is allowed in non-linear context. Loose this restriction.

[%linval Cons(let x = (...no linear variable here ..) in (.. data constructor with linvar ..), !!s)]
[%linval object method f = !!s end]
keigoi commented 7 years ago

It is also nice to allow as-pattern for non-linear subpattern

match%lin exp with | C(V(x,y) as z, #s) -> ...