Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Might be a bit of job deformation, knowing C++ since 1993, and I still need to get myself used to those patterns.

Maybe I should delve again into GADTs in OCaml, before having a second look.



GATs are completely unrelated to GADTs.


From my point of view they look quite similar from language type theory point of view, plus the machinery for affine types.


The 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.


Where is the type theory for Rust's GATs for us to educate ourselves?



Thanks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: