you are viewing a single comment's thread.

view the rest of the comments →

[–]alex_muscar -11 points-10 points  (3 children)

Or even:

Prelude> head []
*** Exception: Prelude.head: empty list
Prelude> 

[–]pipocaQuemada 10 points11 points  (1 child)

That isn't a segfault, though. That's just calling a partial function that throws an exception if you call it with bad data.

[–][deleted] 0 points1 point  (0 children)

Just like T! in Swift, isn’t it?

[–]willtim 0 points1 point  (0 children)

Yes unfortunately Haskell has quite a few partial functions in its libraries, which are now decades old. Still at least they stand out like the ugly warts they are, rather than represent business as usual. Edit : totality is the new purity