121 points · by mbrubeck · 12y ago · 25 comments
I love that you get all of this safety with zero runtime cost.
This is a perfect example of why just statically type checking your code does not make it correct.
Rust is awesome because it's bringing powerful ideas like this to a systems language.
I've heard from people that learned Haskell independently or went through my guide alike that benefited greatly from having learned Haskell despite not using it at work.
Types are a more compact and faithful representation of code semantics than what most non-Haskell programmers are working with internally. Haskell also teaches you, beyond thinking in terms of types (heh), how to identify patterns & abstractions that most languages wouldn't allow you to credibly leverage.
I teach Haskell to experienced programmers and people that have never written code before. I know nothing about math, I dropped out of uni after one quarter, I have not studied math since that time. Most of my students didn't know any math and weren't any worse for it.
https://github.com/bitemyapp/learnhaskell
If you start going through the guide and get stuck, I will help you.
Only fear can stop you, be brave!
What I think the OP was expressing is that the various articles written on people writing great code in Rust inspires people to work with it. Admittedly phantom types are not a distinguishing feature of Rust, but it still makes a nice read that people are elegantly solving real problems in the language.
Lusting over a language that borrows its syntax from the Algol we all love and doesn't require a degree in Type Theory?
Oh, and without laziness, and with speed and no-GC guarantees...
Here's the documentation for the proposed units module. I believe it has the same principles as Boost units:
Let me know if you'd like to know more.