MONADS AND RUST A THREAD - or - why async/await instead of do notation
-
-
In order to add higher kinded polymorphism, we'd have to restrict the sorts of types you could use in a way that would feel very arbitrary to users.
Prikaži ovu nit -
In contrast, generic associated types don't have this problem, and directly solve the expressiveness problems we do have, like Iterable (abstracting over everything with a `.iter(&self)` method)
Prikaži ovu nit -
(Don't get me wrong, you can write something to abstract over some monads like Option and Result using generic associated types. But its much less ergonomic than Monad in Haskell, even for those).
Prikaži ovu nit -
IN CONCLUSION: a design that works in a pure FP which lazily evaluates and boxes everything by default doesn't necessarily work in an eager imperative language with no runtime.
Prikaži ovu nit -
This comes up a lot, please link this thread liberally.
Prikaži ovu nit
Kraj razgovora
Novi razgovor -
-
-
Does that actually matter? Trait inhabitation is already undecidable in Rust, which is a more serious theoretical problem, and supporting global type inference is nongoal anyway IIRC.
-
I mean trivially, it becomes easy to produce situations in which the compiler cannot complete type inference or even know it can’t make further progress
- Još 10 drugih odgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.