Peaker
Joined 16 years ago
Joined 16 years ago
Either each element has some "handler" that does the right thing for that data type.
Or you have a set of cases that each data can be, and you handle them all.
Neither is just "any type". And static types are very suitable to describe either.
In my experience, with large projects, you get to pick 2:
Dynamic typing Development velocity Reliability
I've seen multiple large projects grind to a near halt in their development speed, and I've seen some retain development speed, but unreliably crash after various changes.
UT coverage is expensive. System tests don't catch everything. Either you fear changes, and the system rots, or you work very slowly with coverage for everything.
What can you even do given such a value?
When I write applications, I don't need a systems language, and Haskell is easier to use.
Also, Rust is a great imperative language, it's not as great as a functional language, and you can't reap the benefits of pure functional programming.
https://raw.githubusercontent.com/target/row-types/master/ex...
The people I mentored, though, could clarify any misunderstanding and get explanations from multiple viewpoints from me -- after years of experience with these abstractions. With such mentoring, you don't have to go through all the confusion phases.
import Control.Lens
data MyRecord = MyRecord { _a :: Int, _b :: MyRecord }
makeLenses ''MyRecord
Then you can use it nested like: over (b . b . a) (+5) myRecordI'm pretty sure I could get a student to write useful Haskell code in that time span with just mentoring and existing documentation material.