aboutsummaryrefslogtreecommitdiff
path: root/lib/kernel/temporal.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kernel/temporal.ml')
-rw-r--r--lib/kernel/temporal.ml26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/kernel/temporal.ml b/lib/kernel/temporal.ml
new file mode 100644
index 0000000..a34eeb0
--- /dev/null
+++ b/lib/kernel/temporal.ml
@@ -0,0 +1,26 @@
+open Sexplib0.Sexp_conv
+
+(* 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