News for hackers. Stuff that matters.
Re:Idiomatic Monads in Rust by leshow on Thursday April 04, 2019 @10:10AM (#19572470)
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?

Re:Idiomatic Monads in Rust by coldtea on Thursday April 04, 2019 @10:33AM (#19572746)
>*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".

Re:Idiomatic Monads in Rust by blattimwind on Thursday April 04, 2019 @01:17PM (#19574748)
Rust really needs to watch out to not further increase the complexity of the basic language.
Re:Idiomatic Monads in Rust by leshow on Thursday April 04, 2019 @11:16AM (#19573288)
> 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)

Re:Idiomatic Monads in Rust by JeremyBanks on Thursday April 04, 2019 @10:29AM (#19572694)
I 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.
Re:Idiomatic Monads in Rust by leshow on Thursday April 04, 2019 @11:19AM (#19573323)
Pretty misleading to write "... I want to demonstrate that monads are feasible in Rust." if that's not actually the case
Re:Idiomatic Monads in Rust by reificator on Thursday April 04, 2019 @04:35PM (#19576829)
> 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.

Re:Idiomatic Monads in Rust by estebank on Thursday April 04, 2019 @11:52AM (#19573750)
Feasible as in "can be reasonably added to the language", not as in "can be mimicked with current language features".
Re:Idiomatic Monads in Rust by leshow on Friday April 05, 2019 @09:31AM (#19582282)
There'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
Re:Idiomatic Monads in Rust by JeremyBanks on Friday April 05, 2019 @09:34AM (#19582308)
You are not the target audience.
Re:Idiomatic Monads in Rust by sullyj3 on Friday April 05, 2019 @09:45AM (#19582394)
I 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.

Re:Idiomatic Monads in Rust by leshow on Tuesday April 09, 2019 @11:13AM (#19615444)
> 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.