Re:Rust: “Explain GATs Like I'm 5 Years Old”
by pjmlp on Monday November 07, 2022 @02:07PM
(#33510689)
Where is the type theory for Rust's GATs for us to educate ourselves?
Re:Rust: “Explain GATs Like I'm 5 Years Old”
by Rusky on Monday November 07, 2022 @02:37PM
(#33511168)
The RFC might be a good place to start: https://rust-lang.github.io/rfcs/1598-generic_associated_typ...
GATs are generic type aliases which are defined inside traits.
GADTs are generic sum types with extra constraints on which variants may be used with which type arguments.
There is no reasonable way in which they are "quite similar," nor do either of them have anything at all to do with affine types.