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 @…