diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-11 11:37:32 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-11 11:37:32 +0200 |
| commit | 57322e766a0ece579dafcddcfe2572676a98fca8 (patch) | |
| tree | 0e6ca11d29000b956a2c4bb65e436b0eb9251809 /lib/kernel/date_spec.mli | |
| parent | 270be2561ae440cea814566b74712750352e56e4 (diff) | |
| download | colitur-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/date_spec.mli')
| -rw-r--r-- | lib/kernel/date_spec.mli | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/kernel/date_spec.mli b/lib/kernel/date_spec.mli new file mode 100644 index 0000000..600f1eb --- /dev/null +++ b/lib/kernel/date_spec.mli @@ -0,0 +1,12 @@ +(** A sanctoral entry's date expression. *) +type t = Fixed of { month : int; day : int } [@@deriving sexp] + +val sexp_of_t : t -> Sexplib0.Sexp.t +val t_of_sexp : Sexplib0.Sexp.t -> t + +(** Validates against the leap-year maximum, so 29 February is constructible. *) +val fixed : month:int -> day:int -> (t, string) result + +(** [None] when the spec does not occur in that year (29 February in a common + year) or falls outside the supported domain. *) +val resolve : t -> year:int -> Date.t option |
