let with_file_in fn ~f = let iz = open_in fn in let r = try `Ok (f iz) with e -> `Error e in close_in iz ; match r with | `Ok y -> y | `Error exn -> raise exn