日本語 · English

split — variable division of a parent window (dependent windows)

Translated from the canonical Japanese page reference/split.md. The source_sha above records the source revision; a consistency check flags this page when the Japanese original changes.

Category: window-generating word (premise layer) / Signature: split(g) by: u : Stream(windowed) -> Stream(partitioned) / name settled (spec §5.4)

Meaning

Divides a parent window into consecutive subwindows by the width list returned by g = y => [widths…] (top-down division). y is the parent’s running window-sequence ordinal (the F60 coordinate); by: u is the unit of the widths (mandatory). Two per-instance checks run (ADR-48): boundary alignment (both ends of each parent window must sit on u’s window boundaries — misaligned pairs like calendar-year × week are rejected here) and the I5 sum (the widths must sum to the number of u windows inside the parent; a mismatch is an explicit error).

Both the parent and by: accept, in addition to partition windows, effective partitions built from rule markers (segmentBy-built window sequences without coverage annotations — the standard week, isoWeek, isoYear). Window sequences from data-borne (covering-carrying) markers, empties: drop sequences, and cycles are not accepted — editing the coverage would silently move the ordinals that g draws on (a guided static error; the segmentBy form is canonical there. ADR-48 · F109).

Where span (bottom-up) builds the basic bundling, split builds dependent windows — use it for windows that should follow the parent automatically when it changes. Gregorian’s quarter is the representative:

quarter = year split (_ => [3, 3, 3, 3]) by: month

Under a fiscal calendar (year recomposed via with), this inherited definition follows the new year automatically and becomes fiscal quarters (Mechanism A; with).

Examples

Split the year into first and second halves:

# eval: 2026-01-01..2027-01-01
premise H = Gregorian with { half = year split (_ => [6, 6]) by: month }
premise JPH { calendar-system: H; tz: "Asia/Tokyo"; wkst: Mon }
@JPH
everyDay |> within(half) |> first
#=> 2026-01-01 2026-07-01

First day of each quarter (the standard quarter):

# eval: 2026-01-01..2027-01-01
@JP
everyDay |> within(quarter) |> first
#=> 2026-01-01 2026-04-01 2026-07-01 2026-10-01

Weekday part and weekend part of the week (a segmentBy-built standard week as the parent; ADR-48):

# eval: 2026-01-05..2026-01-19
premise W5 = Gregorian with { weekPart = week split (_ => [5, 2]) by: day }
premise JPW { calendar-system: W5; tz: "Asia/Tokyo"; wkst: Mon }
@JPW
everyDay |> within(weekPart) |> first
#=> 2026-01-05 2026-01-10 2026-01-12 2026-01-17

label: (ADR-34)

split … by: u label: (p => expr) attaches a label to each subwindow (p = the window’s first point; lazily evaluated at projection time. Details in the same section of span and ADR-34).

Pitfalls

span · grid · segmentBy (the source of effective partitions) · with (automatic following in action) · I5 · ADR-48.