2 ms·
Yeah I feel like rust’s avoidance of HKT, I assume in the name of them being “hard” or confusing (try explain to someone what a monad is), just in turn reinforc
by asimpletune 5y ago
Yeah I feel like rust’s avoidance of HKT, I assume in the name of them being “hard” or confusing (try explain to someone what a monad is), just in turn reinforced why they exist. So many things would be easier if there weren’t these half measures.
- kortex 5y agoHard/confusing for user programmers, or for language designers? I don't think the concept being tricky for users is what is preventing adoption of HKTs. The &|x| hints at some of the reasons why implementing HKTs in Rust is tricky (not impossible). They are naturally very abstract, and if a structure is to be compiled in Rust, it (and its lifetime) needs to be reified. That is no small feat. See also: the difficulty with callbacks/anonymous closures in Rust.
- asimpletune 5y agoYeah that’s a good point. I don’t really know the real reasons. Maybe it’s just hard to do it and to have the 0 cost abstractions? Hopefully not impossible though.