3 ms·
Type annotations can be helpful in writing maximally polymorphic code and in self documentation, independent of type inference. When I write Haskell, I still an
by leshow 8y ago
Type annotations can be helpful in writing maximally polymorphic code and in self documentation, independent of type inference. When I write Haskell, I still annotate my code.
- always_good 8y agoAlso, throwing out all type annotations makes code pretty hard to read, especially outside your IDE like in a Github repo. Taken to an extreme, it feels like reading a dynamically-typed language where you have to keep the various variable types in your head when debugging. There's a middle ground.