Project Euler 2 - Even Fibonacci Numbers - Solved with Ocaml

The second Project Euler problem - Even Fibonacci Numbers - is stated as follows - By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

let fib target =
  let rec next x y sum =
    match (y mod 2 == 0, y < target) with
    | (true, true) -> next y (x + y) (sum + y)
    | (false,true) -> next y (x + y) sum
    | _ -> sum in
  next 1 1 0

let _ = print_int (fib 4000000)