From abade24943f2f77c058b5ff768093b8babc9a8c3 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 11 Aug 2026 11:59:43 +0200 Subject: 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. --- lib/kernel/celebration.ml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/kernel/celebration.ml (limited to 'lib/kernel/celebration.ml') 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 } -- cgit v1.3