|
|
|
|
|
by codeflo
984 days ago
|
|
> Personally, I think Haskell is approximately stuck in a local maximum, which can only be escaped by embracing dependent types To give a counter point, there seem to be lots of small wins that aren't taken, possibly in part because people seem to wait for the big ideas. Take partial functions like head: You can do what Haskell and Java do and throw an exception. Or you can have dependent types and statically prevent the function from being applied to an empty list. But the obvious and easy solution in the current language would be to return Maybe, which isn't done because there's a feeling that it's not a big enough step to be worth the effort, and dependent types will eventually solve this anyway. |
|
That's not why it's not done. listToMaybe already exists[1] and you can't change the type of head without breaking everyone's code, so head in the next version of base will come with a warning[2] and that's about as much as you can do whilst still maintaining backwards compatibility.
[1] https://www.stackage.org/haddock/lts-21.14/base-4.17.2.0/Dat...
[2] https://github.com/haskell/core-libraries-committee/issues/8...