Prelude.head empty-list runtime exception in GHC base
A library author needs to extract the first element of a list without risking a runtime failure. Prelude.head is partial: applying it to an empty list raises an exception at evaluation time, and GHC does not reject the call by default. The -Wall flag warns about non-exhaustive pattern matches in user definitions, but it does not reliably flag every partial c