aboutsummaryrefslogtreecommitdiff
path: root/lib/kernel/temporal.mli
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-11 11:59:43 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-11 11:59:43 +0200
commitabade24943f2f77c058b5ff768093b8babc9a8c3 (patch)
tree33285f68860d21144bdad8388fabaf073b4771cb /lib/kernel/temporal.mli
parent8b6c0036cb6c7f0e48a9370f53be25fd2bb243f4 (diff)
downloadcolitur-abade24943f2f77c058b5ff768093b8babc9a8c3.tar.gz
colitur-abade24943f2f77c058b5ff768093b8babc9a8c3.zip
kernel: Vocab, Celebration and Temporal parametric types
Rite specificity is carried by type parameters plus a vocab record of operations rather than by functors: the same guarantee that a rite cannot name another rite's season, without threading module plumbing through every kernel module. Celebration takes only the rank parameter, since it has no season field and OCaml rejects a type variable that appears in no field.
Diffstat (limited to 'lib/kernel/temporal.mli')
-rw-r--r--lib/kernel/temporal.mli24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/kernel/temporal.mli b/lib/kernel/temporal.mli
new file mode 100644
index 0000000..055f9aa
--- /dev/null
+++ b/lib/kernel/temporal.mli
@@ -0,0 +1,24 @@
+(** The temporal identity of a date: where in the liturgical year it sits, and
+ the temporal cycle's own office for it. *)
+type ('s, 'r) t = {
+ season : 's;
+ week : int option; (** [None] for named days outside a numbered week *)
+ weekday : Date.weekday;
+ office : 'r Celebration.t;
+}
+[@@deriving sexp]
+
+module type RITE = sig
+ val id : string
+
+ type season
+ type rank
+
+ val vocab : (season, rank) Vocab.t
+
+ (** First day of the liturgical year opening in civil year [y]. *)
+ val year_start : int -> Date.t
+
+ (** Total over 1583..9999: every date yields exactly one temporal identity. *)
+ val temporal : Date.t -> (season, rank) t
+end