5 ms·
It is easy to understand because it is an oversimplification :)
by agluszak 4y ago
It is easy to understand because it is an oversimplification :)
- jstx1 4y agoWhich part is inaccurate/incomplete?
- GolDDranks 4y agoThe part that says `T<i32>`. GATs don't allow you to do that, not directly. GATs allow you, as said by Boats in https://news.ycombinator.com/item?id=33506540 https://news.ycombinator.com/item?id=33506540, have a generic type as an associated type, nothing less, nothing more. If you want to express `T<i32>`, GATs _enables_ you to do that as a kind of a distorted encoding, but it's not as simple as https://news.ycombinator.com/item?id=33505810 https://news.ycombinator.com/item?id=33505810 makes it seem.
- howinteresting 4y agoBring able to abstract over Rc/RefCell and Arc/Mutex with marker types seems pretty useful. It's not directly HKT but it enables use cases that would otherwise be supported by HKT.
- dllthomas 4y agoYes, but that doesn't make it somehow accurate to explain HKT and pretend you're explaining GAT...
- howinteresting 4y agoThat is definitely true.
- gpderetta 4y agoThe Associated bit of GAT I guess.