4 ms·
GATs are completely unrelated to GADTs.
by Rusky 4y ago
GATs are completely unrelated to GADTs.
- pjmlp 4y agoFrom my point of view they look quite similar from language type theory point of view, plus the machinery for affine types.
- Rusky 4y agoThe only thing similar about them is the acronym: 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.