OCaml beginner needs help: What is wrong?
- by Junz
Code:
let rec get_val (x, n) = match x with
[] -> -1
| if (n=0) then (h::_) -> h
else (_::t) -> get_val(t, n-1)
;;
Error message:
Characters 55-57:
| if (n=0) then (h::_) - h
^^
Error: Syntax error