Move IntPair and PosSet into Aoc library.

These are obviously generic enough and useful for the future that they
can be moved to a shared library.
This commit is contained in:
2024-12-06 17:15:37 +00:00
parent 38d0781c7e
commit 831bbf4f63
3 changed files with 75 additions and 19 deletions

View File

@@ -23,3 +23,12 @@ let main prep parts =
with e ->
Printf.printf "An error occured: %s\n" (Printexc.to_string e);
exit 1
module IntPair = struct
type t = int * int
let compare (x, y) (x', y') =
match compare y y' with 0 -> compare x x' | c -> c
end
module IntPairSet = Set.Make (IntPair)