Upgrade Ocamlformat version.
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user