let rec add_lists (xs : float list) (ys : float list): float list option = match xs, ys with | [], [] -> None | x :: xs, [] -> None | [], y :: ys -> None | x :: xs, y :: ys -> (x +. y) :: add_lists xs ys
The question asks us to add the elements of two lists together, if they are different lengths return None. I tried this code, but I get an error message says "This variant expression is expected to have type float list option. There is no constructor :: within type option"Is there any ways to fix it? Thx