News for hackers. Stuff that matters.
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?
Re:Lisp and Haskell (2015) by sullyj3 on Thursday October 08, 2020 @07:48AM (#24718207)
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.
Re:Lisp and Haskell (2015) by tasuki on Thursday October 08, 2020 @09:13AM (#24718789)
If you know the list can't be empty, can't you prove that to the compiler by using a non-empty list type?
Re:Lisp and Haskell (2015) by sullyj3 on Thursday October 08, 2020 @09:52AM (#24719088)
Good point! last time I used elm i didn't know what a nonempty list was.