little_ferris@programming.dev to Rust@programming.devEnglish · edit-212 hours agoWhat are some mind blowing Rust tricks?message-squaremessage-square31fedilinkarrow-up148arrow-down11file-text
arrow-up147arrow-down1message-squareWhat are some mind blowing Rust tricks?little_ferris@programming.dev to Rust@programming.devEnglish · edit-212 hours agomessage-square31fedilinkfile-text
If we were to create a Rust version of this page for Haskell, what cool programming techniques would you add to it?
minus-squaresolrize@lemmy.worldlinkfedilinkarrow-up4·edit-212 hours agoI’d like to see a Rust solution to Tony Morris’s tic tac toe challenge: https://blog.tmorris.net/posts/scala-exercise-with-types-and-abstraction/index.html His rant about it is here: https://blog.tmorris.net/posts/understanding-practical-api-design-static-typing-and-functional-programming/ I did a Haskell GADT solution some time back and it’s supposed to be doable in Java and in C++. Probably Rust too. I wonder about Ada.
minus-squareThinker@lemmy.worldlinkfedilinkarrow-up5·9 hours agoThis could be done almost trivially using the typestate pattern: https://zerotomastery.io/blog/rust-typestate-patterns/.
I’d like to see a Rust solution to Tony Morris’s tic tac toe challenge:
https://blog.tmorris.net/posts/scala-exercise-with-types-and-abstraction/index.html
His rant about it is here:
https://blog.tmorris.net/posts/understanding-practical-api-design-static-typing-and-functional-programming/
I did a Haskell GADT solution some time back and it’s supposed to be doable in Java and in C++. Probably Rust too. I wonder about Ada.
This could be done almost trivially using the typestate pattern: https://zerotomastery.io/blog/rust-typestate-patterns/.