@[email protected] to [email protected]English • edit-23 months agoWhat are some mind blowing Rust tricks?message-square52fedilinkarrow-up167arrow-down12file-textstarcopymore-verticalflagCreate ReportslashBlock userarrow-upView VoteslockLockpinFeature in CommunitypinFeature in LocalxRemove PostbanBan from communitybanBan from sitepurgePurge userpurgePurge post
arrow-up165arrow-down1message-squareWhat are some mind blowing Rust tricks?@[email protected] to [email protected]English • edit-23 months agomessage-square52fedilinkfile-textstarcopymore-verticalflagCreate ReportslashBlock userarrow-upView VoteslockLockpinFeature in CommunitypinFeature in LocalxRemove PostbanBan from communitybanBan from sitepurgePurge userpurgePurge post
If we were to create a Rust version of this page for Haskell, what cool programming techniques would you add to it?
minus-square@[email protected]OPlinkfedilinkEnglish6•3 months agoYeah I don’t mean just terse functional idioms. Any programming technique that blew your mind the first time you came across it would qualify. arrow-up16arrow-down10file-textreply1starmore-verticalmailMessageflagCreate ReportslashBlock userarrow-upView VotesxRemove CommentbanBan from communitybanBan from sitepurgePurge userpurgePurge comment
minus-square@[email protected]linkfedilink3•3 months agoType guards, then :) very cool, much compiler power, love it arrow-up13arrow-down10file-textreply1starmore-verticalmailMessageflagCreate ReportslashBlock userarrow-upView VotesxRemove CommentbanBan from communitybanBan from sitepurgePurge userpurgePurge comment
minus-square@[email protected]OPlinkfedilinkEnglish2•3 months agoDo 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 arrow-up12arrow-down10file-textreply1starmore-verticalmailMessageflagCreate ReportslashBlock userarrow-upView VotesxRemove CommentbanBan from communitybanBan from sitepurgePurge userpurgePurge comment
minus-square@[email protected]linkfedilink6•3 months agoMaybe they’re referring to “where clauses”? arrow-up16arrow-down10file-textreply1starmore-verticalmailMessageflagCreate ReportslashBlock userarrow-upView VotesxRemove CommentbanBan from communitybanBan from sitepurgePurge userpurgePurge comment
minus-square@[email protected]linkfedilink2•3 months agoIndeed I am. Forgot the name, lol, not worked with rust for a few months 😅 arrow-up12arrow-down10file-textreply1starmore-verticalmailMessageflagCreate ReportslashBlock userarrow-upView VotesxRemove CommentbanBan from communitybanBan from sitepurgePurge userpurgePurge comment
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 😅