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/colour.ml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lib/kernel/colour.ml (limited to 'lib/kernel/colour.ml') diff --git a/lib/kernel/colour.ml b/lib/kernel/colour.ml new file mode 100644 index 0000000..c7f81c2 --- /dev/null +++ b/lib/kernel/colour.ml @@ -0,0 +1,14 @@ +(* Liturgical colours. Shared across Roman rites (spec ยง2.1): not + rite-parametric, because EF and OF use the same six. *) +type t = White | Red | Green | Violet | Rose | Black [@@deriving sexp] + +let all = [ White; Red; Green; Violet; Rose; Black ] + +let to_string = function + | White -> "white" | Red -> "red" | Green -> "green" + | Violet -> "violet" | Rose -> "rose" | Black -> "black" + +let of_string = function + | "white" -> Some White | "red" -> Some Red | "green" -> Some Green + | "violet" -> Some Violet | "rose" -> Some Rose | "black" -> Some Black + | _ -> None -- cgit v1.3