Upgrade Ocamlformat version.

This commit is contained in:
2024-12-06 15:42:18 +00:00
parent 7b51696740
commit 590637e0de
4 changed files with 19 additions and 20 deletions

View File

@@ -1,12 +1,12 @@
(** [pair_nums_from_string s] takes a string of two numbers separated by
(** [pair_nums_from_string s] takes a string of two numbers separated by
whitespace and returns the pair of the numbers *)
let pair_ints_of_string s =
match Aoc.ints_of_string s with
match Aoc.ints_of_string ~sep:" " s with
| [ h; h' ] -> (h, h')
| _ -> raise (Invalid_argument "pair_nums_from_string")
(** [rev_split lst] takes a list of pairs and returns a pair of lists. Is
equivalent to List.split (List.rev lst) but more efficient (and tail
(** [rev_split lst] takes a list of pairs and returns a pair of lists. Is
equivalent to List.split (List.rev lst) but more efficient (and tail
recursive). *)
let rev_split lst =
let rec impl acc acc' = function
@@ -16,7 +16,7 @@ let rev_split lst =
impl [] [] lst
(** [count lst n] counts the number of times [n] appears as an element in [lst].
*)
*)
let count lst n =
List.fold_left (fun acc x -> if x = n then acc + 1 else acc) 0 lst