diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-14 16:43:00 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-14 16:43:00 +0200 |
| commit | bca1a206589bc41bbcb367a7ae9b217c02f0e892 (patch) | |
| tree | b5c7ee9972c91bab2da7b888cb64796cd47d934b /lib/kernel/lectionary.mli | |
| parent | 148729e731370f56a50c3819a7d81808c6e602ca (diff) | |
| download | colitur-bca1a206589bc41bbcb367a7ae9b217c02f0e892.tar.gz colitur-bca1a206589bc41bbcb367a7ae9b217c02f0e892.zip | |
kernel(lectionary): slug-keyed reading citations
Data only, the same shape and discipline as Layer: slug-canonical,
duplicates rejected at construction naming the offending slug, sexp
round-trips. Which slug a day falls back to is a rubric and belongs to the
rite module, so nothing here knows about ferias or Sundays.
Diffstat (limited to 'lib/kernel/lectionary.mli')
| -rw-r--r-- | lib/kernel/lectionary.mli | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/kernel/lectionary.mli b/lib/kernel/lectionary.mli new file mode 100644 index 0000000..1595377 --- /dev/null +++ b/lib/kernel/lectionary.mli @@ -0,0 +1,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 |
