3 ms·
`Option` et al may have vaguely monadic interfaces, but don't you need `return` in order to satisfy the monad laws? Regardless of what we determine there, I do
by kibwen 10y ago
`Option` et al may have vaguely monadic interfaces, but don't you need `return` in order to satisfy the monad laws?
Regardless of what we determine there, I don't think that matters in the broader context of this thread, which concerns the notions that Rust has the potential to scare people away by including unfamiliar "functional stuff". But seeing an `.and_then` method doesn't scream "functional programming"; method chaining has been long popularized in Javascript, Ruby, etc. Furthermore, AFAIK there's nothing about Rust's pseudo-monadic interfaces on iterators that hasn't already been popularized by LINQ in C#.