Is it generally considered a bad practice to use non-exhaustive pattern machings in functional languages like Haskell or F#, which means that the cases specified don\'t cove
This question has two aspects.
As the two aspects contradict each other, the right answer depends on the circumstances (see also kvb's answer). A solution which is 100% "correct" from any point of view would have to
Example:
/// Gets the first element of the list.
/// The list is empty.
let head list =
match list with
| [] -> invalidArg "list" "The list is empty."
| x::xs -> x