From 1512df6514f0e656d734f2bf03d050355d0dd0b7 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 11 Aug 2026 12:10:49 +0200 Subject: 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. --- lib/kernel/celebration.ml | 8 ++++++-- 1 file 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; -- cgit v1.3