Conversation

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)
1
26
(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).
1
23
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.
4
118
At this point I think it’s too late to add an effect system to Rust, but algebraic effects could work—that’s the approach I’m taking in my eager runtimeless language. They’re useful for tagging effects even if you don’t have fully general “handlers” (requiring continuations).
1
2
Agreed—I guess what I was getting at was that it’s invasive & compatibility-breaking to retrofit a language & standard library with effects everywhere. It’s the kind of thing that ideally ought to be done from the beginning, paying the cost incrementally rather than all at once.
1
2