summaryrefslogtreecommitdiff
path: root/lib/kernel/celebration.ml
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/celebration.ml
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/celebration.ml')
-rw-r--r--lib/kernel/celebration.ml20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/kernel/celebration.ml b/lib/kernel/celebration.ml
new file mode 100644
index 0000000..3f7a577
--- /dev/null
+++ b/lib/kernel/celebration.ml
@@ -0,0 +1,20 @@
+open Sexplib0.Sexp_conv
+
+(* A celebration as computed or as loaded from a layer.
+
+ One type parameter, not two: the record has no season field, and OCaml
+ rejects a type variable that appears in no field. *)
+type 'r t = {
+ slug : Slug.t;
+ names : Names.t;
+ rank : 'r;
+ colour : Colour.t;
+ subject : Subject.t;
+ citations : Citation.t list;
+ layer : string; (** provenance: "temporal", a layer id, or an overlay id *)
+}
+[@@deriving sexp]
+
+let make ~slug ?(names = Names.empty) ~rank ~colour ?(subject = Subject.Temporal)
+ ?(citations = []) ~layer () =
+ { slug; names; rank; colour; subject; citations; layer }