summaryrefslogtreecommitdiff
path: root/ocaml/lib/year2025/day02/part01/id.ml
blob: b7a3bd25206d1f2a3e9a6708b11a53e9b6300c86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module ID = struct
  (** *)
  type t = int

  let create num = num

  let validate rules id = List.fold_left (fun acc r -> acc && r id) true rules

  let incr = ( + ) 1

  let to_int id = id

  let to_string = string_of_int

  let pp id = "ID=" ^ string_of_int id
end