Re:Algebraic Data Types: Things I wish someone had explained...
by uryga on Tuesday November 19, 2019 @11:41AM
(#21574946)
i had no idea rust supported laziness! how does that work?
[ Parent
| on HN ]
Re:Algebraic Data Types: Things I wish someone had explained...
by cies on Tuesday November 19, 2019 @05:11PM
(#21578854)
I think he refers to async recently landing in Rust.
Here the Rust book mentions it:
> async bodies and other futures are lazy: they do nothing until they are run.
https://rust-lang.github.io/async-book/03_async_await/01_cha...
I just read it, and thought it was odd. I don't understand how Rust's async relates to a laziness as in Haskell's laziness.
Re:Algebraic Data Types: Things I wish someone had explained...
by steveklabnik on Tuesday November 19, 2019 @06:34PM
(#21579562)
Iterators are also lazy.
All of these things build up some form of computation that doesn’t execute until later. Until then, they’re represented by some kind of data structure.