Hacker News new | ask | show | jobs
by paulkoer 4736 days ago
Re 2: Well, sometimes you need them, but they do throw exceptions on empty lists, so if you don't know for sure that the list is non-empty it is definitely a bad idea to use them. I just thought a warning would be in order when presenting them. This is a point where Haskell's type safety (can't know at compile time if a list is empty or not) falls short and I think a lot of Haskellers try to avoid such functions for this reason. For example the Xmonad code uses zippers in a few places instead of lists which always have one element.

There's a few more points that I can't go into in detail due to lack of time (reason for use of recursion instead of loops, if / case statements, purity) and I do appreciate the effort and can imagine that it will prove useful but I felt obliged to point out these things. If I can see them it's not a good sign ;)