I have an OCaml function that returns the value of a specified cell in a table. The function works correctly but I still get a warning stating:
Warning 8: this pattern-matching is not exhaustive. Here is an example of a value that is not matched: ([],_)
even though I have in fact accounted for that value in my implementation here:
let cell_value([i;j],table) = match ([i;j],table) with
([],_) -> []
| (_,[]) -> []
| (_::_,_::_) -> List.nth (List.nth table (j-1)) (i-1);;
Like I said, the function returns the correct value, I'm just trying to get rid of the error. I'm still fairly new to OCaml, so any help would be greatly appreciated!
let cell_value((i,j),table) = ...
– ghilesZ