aboutsummaryrefslogtreecommitdiff
path: root/lib/kernel/liturgical_day.ml
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-11 19:30:34 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-11 19:30:34 +0200
commit9df1aab700ce4454c26c7d0ede5b51c0f0c96c66 (patch)
tree56938a8cc382afb5f5145bd901d44a908e41bc8d /lib/kernel/liturgical_day.ml
parent7e29712aadf2436b83de2d5e8d1f98b30d2f6d59 (diff)
downloadcolitur-9df1aab700ce4454c26c7d0ede5b51c0f0c96c66.tar.gz
colitur-9df1aab700ce4454c26c7d0ede5b51c0f0c96c66.zip
kernel: the LiturgicalDay result schema
Temporal is embedded rather than flattened, so season/week/weekday have one home and cannot disagree with themselves. transferred_in/out make transfers visible in the result -- an ordo must print 'transferred from the 25th', and the nothing-lost invariant reads these fields. citations exists and is empty until Plan 4; adding it later would widen a type every consumer matches on.
Diffstat (limited to 'lib/kernel/liturgical_day.ml')
-rw-r--r--lib/kernel/liturgical_day.ml19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/kernel/liturgical_day.ml b/lib/kernel/liturgical_day.ml
new file mode 100644
index 0000000..65e3ba5
--- /dev/null
+++ b/lib/kernel/liturgical_day.ml
@@ -0,0 +1,19 @@
+open Sexplib0.Sexp_conv
+
+(* The single stable result schema (parent spec ยง2). *)
+type ('s, 'r) t = {
+ date : Date.t;
+ rite : string;
+ temporal : ('s, 'r) Temporal.t;
+ (** embedded, not flattened: it is already a coherent unit with its own
+ invariants, and re-listing season/week/weekday here would create two
+ places for them to disagree *)
+ observed : 'r Celebration.t;
+ commemorations : ('r Celebration.t * Precedence.privilege) list;
+ transferred_in : 'r Celebration.t option;
+ (** arrived here from an impeded day *)
+ transferred_out : Date.t option;
+ (** this day's celebration went there *)
+ citations : Citation.t list; (** always empty until Plan 4 *)
+}
+[@@deriving sexp]