I mean instead of using a list, it would allow an auto growing array if it detects there is only one owner of the datastructure, using a “modifying” function passes the ownership to the returned value (another way to look at it: it would consider functions such as add or append consume the value and it should not be used afterwards).
Yeah, janestreet’s compiler extensions allow for tracking of uniqueness among other things
Described in this blog post:
Also take a look at youtube, Janestreet have some recent videos about the system.
They should allow for what you’re asking for.
1 Like