News for hackers. Stuff that matters.
Re:Announcing Rust 1.13 by jzelinskie on Thursday November 10, 2016 @10:17PM (#12927308)
I recently started checking out Rust and was quickly disappointed that it's near impossible to chain anything unless their signatures match perfectly. Subsequently, I found the `mdo` crate[0] to be rather useful, although I'm not sure how idiomatic it is. It's essentially a macro that implements Haskell's do-notation. Here's a snippet from the README:

     let l = mdo! {
             z =<< 1i32..11;
             x =<< 1..z;
             y =<< x..z;
             when x * x + y * y == z * z;
             ret ret((x, y, z))
         }.collect::<Vec<_>>();
[0]: https://crates.io/crates/mdo

There are no comments on this comment yet.