little_ferris to RustEnglish · edit-22 个月前What are some mind blowing Rust tricks?message-squaremessage-square52fedilinkarrow-up168arrow-down12file-text
arrow-up166arrow-down1message-squareWhat are some mind blowing Rust tricks?little_ferris to RustEnglish · edit-22 个月前message-square52fedilinkfile-text
If we were to create a Rust version of this page for Haskell, what cool programming techniques would you add to it?
minus-squarelittle_ferrisOPlinkfedilinkEnglisharrow-up7·2 个月前Yeah I don’t mean just terse functional idioms. Any programming technique that blew your mind the first time you came across it would qualify.
minus-squaresilasmarinerlinkfedilinkarrow-up3·2 个月前Type guards, then :) very cool, much compiler power, love it
minus-squarelittle_ferrisOPlinkfedilinkEnglisharrow-up2·2 个月前Do you mean RAII guards https://rust-unofficial.github.io/patterns/patterns/behavioural/RAII.html Or match guards? https://doc.rust-lang.org/rust-by-example/flow_control/match/guard.html
minus-squaresilasmarinerlinkfedilinkarrow-up2·2 个月前Indeed I am. Forgot the name, lol, not worked with rust for a few months 😅
Yeah I don’t mean just terse functional idioms. Any programming technique that blew your mind the first time you came across it would qualify.
Type guards, then :) very cool, much compiler power, love it
Do you mean RAII guards
https://rust-unofficial.github.io/patterns/patterns/behavioural/RAII.html
Or match guards?
https://doc.rust-lang.org/rust-by-example/flow_control/match/guard.html
Maybe they’re referring to “where clauses”?
Indeed I am. Forgot the name, lol, not worked with rust for a few months 😅