3 ms·
It’s even nicer in Haskell because not only does do-notation make code look clean, await is a function, not an operator. Want prefix await? Go for it! res
by z1mm32m4n 7y ago
It’s even nicer in Haskell because not only does do-notation make code look clean, await is a function, not an operator.
Want prefix await? Go for it!
res <- await $ foo bar
Want postfix? You can have that too!
res <- foo bar & await
Being “just a function” means it composes with everything else in the language, something the Rust languages designers have held in high regard when designing this.
(But I also fully appreciate the design constraints that prevent Rust from using “just a method” or ”just a macro”)