let () = print_endline "hello" let read_file_into_lists filename = let in_channel = open_in filename in let rec read_lines left right = try let line = input_line in_channel in match String.split_on_char '\t' line with | [l; r] -> read_lines (int_of_string l :: left) (int_of_string r :: right) | _ -> failwith "invalid line format" with End_of_file -> close_in in_channel; (List.rev left, List.rev right) in read_lines [] [] let () = let left_nums, right_nums = read_file_into_lists "d01.input" in Print.printf "Left numbers: %s\n" (String.concat " " (List.map string_of_int left_nums)); Print.printf "Right numbers: %s\n" (String.concat " " (List.map string_of_int right_nums));;