From e444ae5b03a9113fc6b2fc3fa3e2fd6b71bf8d4b Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 11 Aug 2026 11:21:50 +0200 Subject: kernel: Colour and Subject shared vocabulary The six liturgical colours and the Lord/BVM/saint/temporal distinction are common to both Roman forms, so they are shared closed variants rather than rite-parametric. Subject is so named because class is an OCaml keyword. --- lib/kernel/subject.ml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lib/kernel/subject.ml (limited to 'lib/kernel/subject.ml') diff --git a/lib/kernel/subject.ml b/lib/kernel/subject.ml new file mode 100644 index 0000000..000aaff --- /dev/null +++ b/lib/kernel/subject.ml @@ -0,0 +1,13 @@ +(* Whom the celebration is of. Named [Subject] rather than [Class] because + [class] is an OCaml keyword. Used by precedence in Plan 3 (RG 91). *) +type t = Temporal | Saint | Bvm | Lord [@@deriving sexp] + +let all = [ Temporal; Saint; Bvm; Lord ] + +let to_string = function + | Temporal -> "temporal" | Saint -> "saint" | Bvm -> "bvm" | Lord -> "lord" + +let of_string = function + | "temporal" -> Some Temporal | "saint" -> Some Saint + | "bvm" -> Some Bvm | "lord" -> Some Lord + | _ -> None -- cgit v1.3