Current Rust has not HKT (a.k.a Higher Kinded type) support.
With HKT being implemented in the future, we can write something like fn produce_ref<'a,R,T>(a: &'a SomeType) -> R<T>
, where R
can be Rc
or Box
or Arc
etc, but R
cannot be an &
because we cant represent &
borrow in the R<T>
form.
So, what about change &
borrow to Borrow<T>
and &mut
to BorrowMut<T>
, and make &
/&mut
syntax be a syntax surgar of Borrow<T>
/BorrowMut<T>
? It is more symmetric and HTK friendly.