# Change &'a T to Borrow\<'a,T\> and &'a mut T to BorrowMut\<'a,T\>

**URL:** https://internals.rust-lang.org/t/change-a-t-to-borrow-a-t-and-a-mut-t-to-borrowmut-a-t/1055
**Category:** ideas (deprecated)
**Created:** [December 20, 2014, 5:43pm UTC](https://internals.rust-lang.org/t/change-a-t-to-borrow-a-t-and-a-mut-t-to-borrowmut-a-t/1055 "2014-12-20T17:43:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![wooya](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/wooya/32/175_2.png) [@wooya](https://internals.rust-lang.org/u/wooya)
#### Post date: [December 20, 2014, 5:43pm UTC](https://internals.rust-lang.org/t/change-a-t-to-borrow-a-t-and-a-mut-t-to-borrowmut-a-t/1055/1 "2014-12-20T17:43:39Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![arielb1](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/arielb1/32/3044_2.png) [@arielb1](https://internals.rust-lang.org/u/arielb1)
#### Post date: [December 21, 2014, 10:56am UTC](https://internals.rust-lang.org/t/change-a-t-to-borrow-a-t-and-a-mut-t-to-borrowmut-a-t/1055/2 "2014-12-21T10:56:45Z")

</div>

This would be rather ugly. Also, there are other interesting types that you can’t put into a simple `A<T>` form, for example `Rc<RefCell<Vec<T>>>` – when we implement HKT, we should probably allow using `type`-aliases as HKT-s, so you could simple have `type Borrow<'a, T> = &'a T;`.

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)
#### Post date: [March 25, 2019, 8:23am UTC](https://internals.rust-lang.org/t/change-a-t-to-borrow-a-t-and-a-mut-t-to-borrowmut-a-t/1055/3 "2019-03-25T08:23:23Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
