4 ms·
Kinda surprised not to see HKTs[0] mentioned which, AFAICT, is what really sets apart Haskell's from Rust's type system. Without HKTs you can't express a Functo
by kaoD 7y ago
Kinda surprised not to see HKTs[0] mentioned which, AFAICT, is what really sets apart Haskell's from Rust's type system. Without HKTs you can't express a Functor typeclass/trait[1].
[0] https://github.com/rust-lang/rfcs/issues/324 https://github.com/rust-lang/rfcs/issues/324
[1] https://www.reddit.com/r/rust/comments/2av5tv/why_does_rust_not_have_a_functor_trait/ https://www.reddit.com/r/rust/comments/2av5tv/why_does_rust_...
- zozbot234 7y agoAren't Generic Associated Types (in the pipeline for Rust) broadly equivalent to HKT as found in Haskell?
- kaoD 7y agoI'm kinda bad at these things so I'm not sure. GATs are a form of higher-kinded polymorphism but I'm not sure if they're really equivalent to HKTs. GATs are still missing anyways. Not sure how close they're to being implemented.
- pcstl 7y agoNot particularly close. The feature seems to be progressing slowly, but very deprioritized (which is understandable - Rust has a bit of a reputation for being hard to learn and too feature-heavy, so it's natural for them to focus on stabilizing the language instead of adding new features)
- steveklabnik 7y agoThey’re needed for async fn in traits, which feels like a pretty natural extension to async fns, so there’s a really good motivating case for them.