Hello @Helgard,
I will let other, more knowledgeable people illustrate the historical reasons behind partial functions in the Prelude. Meanwhile, I am sure you will be interested in this CLC ticket. It deals with adding warnings to partial function in Data.List
; there are various compelling comments on both side of the debate. The proposal was accepted.
I know no serious project which doesn’t use -Wall
. It is a default when you use cabal
to initialise a new package, and godsent in day-to-day coding.
if you look into the documentation for the functions listed in the above partial function list not all of them have a mention of their partial (unsafe) nature in the documentation.
Which one from the Prelude/standard library lacks a this-function-is-non-total warning?
However, since I’ve had the opportunity to be exposed to algebraic data types, parametric polymorphism, etc. in other languages; and more importantly - sane, logical, and safe ways to handle functions that can cause an application to crash.
If you haven’t read it already, I am sure you will like Parse, don’t validate, another great article on type-driven development.