diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-11 11:21:50 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-11 11:21:50 +0200 |
| commit | e444ae5b03a9113fc6b2fc3fa3e2fd6b71bf8d4b (patch) | |
| tree | a1a415e0a2330cf865cfea484ad45fa338ed90e6 /lib/kernel/subject.ml | |
| parent | d532c3b2cf941d2fe0c3c84f2c4090f14e869ef0 (diff) | |
| download | colitur-e444ae5b03a9113fc6b2fc3fa3e2fd6b71bf8d4b.tar.gz colitur-e444ae5b03a9113fc6b2fc3fa3e2fd6b71bf8d4b.zip | |
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.
Diffstat (limited to 'lib/kernel/subject.ml')
| -rw-r--r-- | lib/kernel/subject.ml | 13 |
1 files changed, 13 insertions, 0 deletions
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 |
