summaryrefslogtreecommitdiff
path: root/lib/kernel/lectionary.mli
blob: 159537759cb52bf8c518045c67e92e584211e7eb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(** Reading citations keyed by liturgical slug (parent spec §2: "keyed by
    liturgical slug + cycle -> citation set"). Data only: which slug a given
    day falls back to is a rubric, and lives in the rite module.

    Same discipline as {!Layer}: slug-canonical, validated at construction,
    sexp round-trips. *)
type t [@@deriving sexp]

val empty : t

(** Canonically sorts by slug. [Error] on a duplicate slug, naming it --
    a lectionary with two answers for one day is not a lectionary. *)
val of_entries : (Slug.t * Citation.t list) list -> (t, string) result

val find : t -> Slug.t -> Citation.t list option
val mem : t -> Slug.t -> bool
val entries : t -> (Slug.t * Citation.t list) list

(** Loads from a sexp file. Parse and validation failures come back as
    [Error], never as an exception. *)
val load : string -> (t, string) result