3 ms·
First off, I appreciate the edit. python is strong dynamic typing, for example. Second, it’s a shame that the author doesn’t really speak to Haskell at all. Kn
by vonwoodson 3y ago
First off, I appreciate the edit. python is strong dynamic typing, for example.
Second, it’s a shame that the author doesn’t really speak to Haskell at all. Knowing that a variable is a `u16` is rarely useful alone, relying on the meta of a variable name, for example, to prevent me from adding `user_age` and `number_of_legs`; they both are unsigned 16-bit `int`s, so the compiler is cool with it. A better type system allows types to hold semantic information beyond the bit-width or archaic and usually unhelpful information for the computer and not the developer. Relics of a past where 8k or RAM was all you could use for your program.
Ironically, the advanced Haskell type system looks more like dynamic typing specifically because the type inference is so good. You can rely on the compiler (or interpreter) to tell you what the type should be, often times allowing for much more flexible types than you’d think possible.
Also, being able to derive classes like Show and Read is amazing.
So, +1 for loving types!
- tubthumper8 3y agoI'm sure the author is aware of these - many of the code examples are in Rust which has newtypes and automatic deriving of traits (ex. Display which is the equivalent of Haskell Show)