type color = | Red | Green | Blue | Black type row = color list type screen = row list (* let rec count_red_row (cs : row) : int = *) (* match cs with *) (* | [] -> 0 *) (* (\* option 1 *\) *) (* | Red::cs' -> 1 + count_red_row cs' *) (* | _::cs' -> count_red_row cs' *) (* option 2 *) (* | c::cs' -> *) (* match c with *) (* | Red -> 1 + count_red_row cs' *) (* | _ -> count_red_row cs' *) let rec count_red_screen (rs : screen) : int = let rec count_red_row (cs : row) : int = match cs with | [] -> 0 (* option 1 *) | Red::cs' -> 1 + count_red_row cs' | _::cs' -> count_red_row cs' in match rs with | [] -> 0 | r::rs' -> (count_red_row r) + (count_red_screen rs') let foo x y z = let sum_xy = x + y in sum_xy + z