ocaml pattern match question
- by REALFREE
I'm trying to write a simple recursive function that look over list and return a pair of integer. This is easy to write in c/c++/java but i'm new to ocaml so somehow hard to find out the solution due to type conflict
it goes like..
let rec test l =
match l with [] - 0
| x::xs - if x 0 then (1+test, 0)
else (0, 1+test);;
I kno this is not correct one and kinda awkward.. but any help will be appreciated