“Non-exhaustive pattern matching” warning in let matching

If f always returns two values maybe it should return a tuple instead of a list?

Then you could simply write

let a,b = f x in
1 Like