5 ms·
Does any of this actually compile? Even with generalised_associated_types enabled I couldn't get the Functor definition to compile with a `trait MapFn...` edit
by leshow 8y ago
Does any of this actually compile? Even with generalised_associated_types enabled I couldn't get the Functor definition to compile with a `trait MapFn...`
edit: If the main point of the article is to show that 'monads are feasible in rust' shouldn't you not be assuming a bunch of language features exist that don't?
- deleted 8y ago[deleted]
- JeremyBanks 8y agoI think the main point of the article isn't exactly "monads are feasible in Rust", but rather, "monads are a viable motivating case for these potential developments in Rust". The author is on the Rust compiler team and has several posts from similar angles.
- leshow 8y agoPretty misleading to write "... I want to demonstrate that monads are feasible in Rust." if that's not actually the case
- estebank 8y agoFeasible as in "can be reasonably added to the language", not as in "can be mimicked with current language features".
- leshow 8y agoThere's no discussion of implementation, we have no idea how "reasonable" an implementation would or wouldn't be. My assumption from reading this is it would require a ton of non trivial additions to the type system
- JeremyBanks 8y agoYou are not the target audience.
- reificator 8y ago> Pretty misleading to write "... I want to demonstrate that monads are feasible in Rust." if that's not actually the case When not taken out of context, I don't think it's misleading at all. > You see, there’s a problem with talking about whether monads would be useful or not, and it’s this: there are a large number of design challenges to overcome to have any hope of implementing them at all — to the best of my knowledge, there currently exists no realistic (that is, practical) design for monads in Rust. In fact, there are so many obstacles that some people express doubt that it’s even possible. > In general, I don’t think it’s worth talking about the virtue of a language feature if we think there’s no way we could actually implement it. However, I think there are arguments to be made in favour of higher-level abstractions in Rust. Thus, to facilitate discussion, I want to demonstrate that monads are feasible in Rust.
- coldtea 8y ago>*edit: If the main point of the article is to show that 'monads are feasible in rust' shouldn't you not be assuming a bunch of language features exist that don't?8 Except if the main point is "monads are feasible in rust if we add these features".
- leshow 8y ago> Except if the main point is "monads are feasible in rust if we add these features". This is just showing imaginary syntax though, it doesn't speak at all to whether implementing these features is actually possible. Just because you make up some syntax doesn't mean it can actually be done (or how difficult it is etc)
- blattimwind 8y agoRust really needs to watch out to not further increase the complexity of the basic language.
- sullyj3 8y agoI think by "feasible", the author here means "the features required to support monads in rust could feasibly be added" not "it is feasible to implement monads is rust as it exists currently". That was my first reading, your reading didn't occur to me, so I don't see that the title is especially misleading.
- leshow 8y ago> feasible: possible to do easily or conveniently. > likely; probable. Support for monads in Rust is not possible to be added easily to the language, nor is it particularly probable. The features that come with the imagined syntax in the blog post are non-trivial additions to the type system.