Sometimes it’s nice to write
let [a; b] = f x in
let a,b = match f x with [a;b] -> a,b in
But both triggers warning 8 (non-exhaustive pattern matching). It prevents me from using let matching as I don’t like having warnings in a finished code, so I go for a
match ... with ... | _ -> assert false.
The warning seems irrelevant to me in the first case, since I tend to use let matching when I am certain it won’t go wrong. And in practice, since let matching can contain only one pattern, it is impossible to make let matching exhaustive.
I know that in Haskell there is no warning on incomplete let matching. Why not do the same in OCaml? Unless there are difficulties I’m not seeing.