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.
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.