|
|
|
|
|
by aidenn0
2413 days ago
|
|
What does your dynamic language do when you take the first element of an empty list? There is no obvious "correct" thing to do. Furthermore, whatever you do return is unlikely to be the same sort of thing that is returned for a non-empty list. A dynamic language will have a behavior that corresponds to some sort of type signature, and it's not possible to write behavior that corresponds with the type signatures given as examples of "impossible" in the article. A type signature is merely a statement about behavior, so it's nonsensical to make a false statement about the behavior, and Haskell catches this. |
|