News for hackers. Stuff that matters.
Re:A Pythonista's Review of Haskell by giornogiovanna on Friday January 31, 2020 @08:06PM (#22207744)
Well, Haskell calls the empty list the "null" list (see List.null), so I could say that List.head crashes when it encounters a null. :P

Anyway, the real lesson is that even if your language has sane defaults that force you to check that your list isn't empty, or that your pointers aren't null, a bad library function like List.head can hide that check away from you and crash anyway, bringing you back to square one in terms of the type system preventing unexpected crashes.

Re:A Pythonista's Review of Haskell by crimsonalucard on Saturday February 01, 2020 @01:42AM (#22209118)
The null works with cons. So it's not a proper null. A proper null should throw an exception if you try to do any operation on it.