diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-11 12:10:49 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-11 12:10:49 +0200 |
| commit | 1512df6514f0e656d734f2bf03d050355d0dd0b7 (patch) | |
| tree | b21632e1fc9d8f996a211bd31d10ea2fac22d542 | |
| parent | abade24943f2f77c058b5ff768093b8babc9a8c3 (diff) | |
| download | colitur-1512df6514f0e656d734f2bf03d050355d0dd0b7.tar.gz colitur-1512df6514f0e656d734f2bf03d050355d0dd0b7.zip | |
kernel: correct false compiler-constraint claim in Celebration comment
The comment explaining Celebration's single type parameter claimed OCaml
rejects a type variable that appears in no field. That is false: a phantom
season parameter compiles cleanly. The real reason is a design choice, not a
compiler constraint -- a celebration has no season of its own (season is
contextual to the day, and lives in Temporal.t), and a phantom parameter
would carry no information while forcing every consumer to thread a
meaningless variable.
| -rw-r--r-- | lib/kernel/celebration.ml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/kernel/celebration.ml b/lib/kernel/celebration.ml index 3f7a577..2963366 100644 --- a/lib/kernel/celebration.ml +++ b/lib/kernel/celebration.ml @@ -2,8 +2,12 @@ open Sexplib0.Sexp_conv (* A celebration as computed or as loaded from a layer. - One type parameter, not two: the record has no season field, and OCaml - rejects a type variable that appears in no field. *) + One type parameter, not two: a celebration has no season of its own -- + season is contextual to the day, and lives in Temporal.t, which pairs a + celebration with the day it falls on. A phantom 's parameter would compile, + but would carry no information while forcing every consumer (Layer, + Overlay, and later Precedence and Calendar) to thread a variable that + means nothing. *) type 'r t = { slug : Slug.t; names : Names.t; |
