summaryrefslogtreecommitdiff
path: root/lib/kernel/preface.ml
blob: 08d00b40120a20e269d83889fc826030b2a14b2a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
(* RG 482-499 -- see the .mli for the rubric quoted in full and the
   placement rationale. Argument-less variants only, so no
   [Sexplib0.Sexp_conv] open is needed -- see CLAUDE.md's own gotcha note. *)
type t =
  | Nativity
  | Epiphany
  | Lent
  | Holy_cross
  | Easter
  | Ascension
  | Sacred_heart
  | Christ_the_king
  | Holy_spirit
  | Trinity
  | Bvm
  | St_joseph
  | Apostles
  | Common
  | Requiem
[@@deriving sexp]

let all =
  [ Nativity; Epiphany; Lent; Holy_cross; Easter; Ascension; Sacred_heart; Christ_the_king;
    Holy_spirit; Trinity; Bvm; St_joseph; Apostles; Common; Requiem ]

let to_string = function
  | Nativity -> "nativity"
  | Epiphany -> "epiphany"
  | Lent -> "lent"
  | Holy_cross -> "holy-cross"
  | Easter -> "easter"
  | Ascension -> "ascension"
  | Sacred_heart -> "sacred-heart"
  | Christ_the_king -> "christ-the-king"
  | Holy_spirit -> "holy-spirit"
  | Trinity -> "trinity"
  | Bvm -> "bvm"
  | St_joseph -> "st-joseph"
  | Apostles -> "apostles"
  | Common -> "common"
  | Requiem -> "requiem"

let of_string = function
  | "nativity" -> Some Nativity
  | "epiphany" -> Some Epiphany
  | "lent" -> Some Lent
  | "holy-cross" -> Some Holy_cross
  | "easter" -> Some Easter
  | "ascension" -> Some Ascension
  | "sacred-heart" -> Some Sacred_heart
  | "christ-the-king" -> Some Christ_the_king
  | "holy-spirit" -> Some Holy_spirit
  | "trinity" -> Some Trinity
  | "bvm" -> Some Bvm
  | "st-joseph" -> Some St_joseph
  | "apostles" -> Some Apostles
  | "common" -> Some Common
  | "requiem" -> Some Requiem
  | _ -> None