summaryrefslogtreecommitdiff
path: root/ocaml/lib/year2025/day02/part01/id.ml
diff options
context:
space:
mode:
authorDJ O'Leary <dijitol@proton.me>2026-06-27 00:11:43 +0200
committerDJ O'Leary <dijitol@proton.me>2026-06-27 00:11:43 +0200
commit976048a85403fbb0751c34fa42703a3c47f6e918 (patch)
tree46e321d8120c45e318ead66f60165b0b854c85a1 /ocaml/lib/year2025/day02/part01/id.ml
parent6d8fb621d1e93b83786890d6d9cb6f0d8defa8ae (diff)
refactor!: change repo directory structure for ocaml
Diffstat (limited to 'ocaml/lib/year2025/day02/part01/id.ml')
-rw-r--r--ocaml/lib/year2025/day02/part01/id.ml16
1 files changed, 16 insertions, 0 deletions
diff --git a/ocaml/lib/year2025/day02/part01/id.ml b/ocaml/lib/year2025/day02/part01/id.ml
new file mode 100644
index 0000000..b7a3bd2
--- /dev/null
+++ b/ocaml/lib/year2025/day02/part01/id.ml
@@ -0,0 +1,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