summaryrefslogtreecommitdiff
path: root/lib/kernel/names.mli
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-11 11:37:32 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-11 11:37:32 +0200
commit57322e766a0ece579dafcddcfe2572676a98fca8 (patch)
tree0e6ca11d29000b956a2c4bb65e436b0eb9251809 /lib/kernel/names.mli
parent270be2561ae440cea814566b74712750352e56e4 (diff)
downloadcolitur-57322e766a0ece579dafcddcfe2572676a98fca8.tar.gz
colitur-57322e766a0ece579dafcddcfe2572676a98fca8.zip
kernel: Names, Citation and Date_spec
Names is an open language-keyed assoc kept in canonical order so equal name sets serialise identically. Citation carries references only, never text. Date_spec ships the one form the EF sanctoral needs; 29 February is constructible and resolves to None in common years.
Diffstat (limited to 'lib/kernel/names.mli')
-rw-r--r--lib/kernel/names.mli20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/kernel/names.mli b/lib/kernel/names.mli
new file mode 100644
index 0000000..567ce2e
--- /dev/null
+++ b/lib/kernel/names.mli
@@ -0,0 +1,20 @@
+(** Celebration names keyed by language. The language set is open; entries are
+ kept sorted by language code, so equal name sets have equal sexp forms. *)
+type t = (Lang.t * string) list [@@deriving sexp]
+
+val sexp_of_t : t -> Sexplib0.Sexp.t
+val t_of_sexp : Sexplib0.Sexp.t -> t
+
+val empty : t
+
+(** Canonicalises; on duplicate languages the last entry wins. *)
+val of_list : (Lang.t * string) list -> t
+
+val set : t -> Lang.t -> string -> t
+val remove : t -> Lang.t -> t
+val find : t -> Lang.t -> string option
+
+(** [find_first t langs] returns the name for the first language present. *)
+val find_first : t -> Lang.t list -> string option
+
+val to_list : t -> (Lang.t * string) list