News for hackers. Stuff that matters.
Re:Porting a Haskell graphics framework to Rust by steveklabnik on Saturday April 30, 2016 @07:44PM (#11604162)
There's an RFC being actively worked on that will make it easier to pass around unboxed closures.
Re:Porting a Haskell graphics framework to Rust by vvanders on Sunday May 01, 2016 @12:06AM (#11604821)
That sounds nice, I spent a good chunk of today hacking on a FRP implementation similar to Elm and the ability to not clone + a few other things around closures kept painting me into a corner each time. I even went as far to drop down to std::mem::transmute_copy, but when I hit a Box<Fn(A) -> B> the type has already been erased and I can't recover it.

It seems like if you have no references in your closure you should be able to pass them around as a value-type(with generics, of course). From what I can tell without that there's a whole range of FP patterns that just aren't representable in Rust because of it.