Re:Lisp and Haskell (2015)
by tasuki on Thursday October 08, 2020 @06:29AM
(#24717783)
What complications would it have produced? Eg Elm has `List.head : List a -> Maybe a` and it's just fine I think?
[ Parent
| on HN ]
In practice I've found that it leads to writing code that you know is unreachable, but you can't prove it to the compiler.
If you know the list can't be empty, can't you prove that to the compiler by using a non-empty list type?