Linearity and uniqueness
In the last post , we looked at uniqueness mode and how uniqueness may be used to optimise. As we will see, uniqueness alone is insufficient in practice, and we also need a concept of linearity for uniqueness to be useful. Capturing unique values Let’s start with an example. Recall the signature of the unique reference module. module type Unique_ref = sig type ' a t val alloc : ' a -> ' a t @ unique val free : ' a t @ unique -> unit val get : ' a t @ unique -> ' a Modes . Aliased . t * ' a t @ unique val se
评论
?
参与讨论