日本語 · English

| & \ — combinators (union, intersection, difference) and the cascade

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

Category: combinator (body-layer core) / Signature: Stream × Stream -> Stream / symbols settled (ADR-22 · spec §5.4)

Meaning

Symbol Meaning
\| Union (merger)
& Intersection (the points contained in both)
\ Difference (removes the right side’s points from the left). Backslash U+005C — even when a Japanese font shows the yen glyph ¥, the code point is U+005C (¥ = U+00A5 is a different character)

All share a single precedence level, left-associative. Mixtures involving & change meaning with order, so parenthesize explicitly (spec §4.5).

Prioritized overriding (the cascade) has no dedicated symbol — it is expressed by left-associative, in-order application of union and difference. Declaration order (the later term) wins = last-wins, as in CSS layers. Holiday “addition” decomposes into union, “exceptions and inversion” into difference (ADR-01).

Examples

Citizens’ holidays — the intersection of “the day after a holiday” and “the day before a holiday”, minus the holidays (September 2026: 9/22, sandwiched between Respect for the Aged Day 9/21 and Autumnal Equinox Day 9/23):

# eval: 2026-09-01..2026-10-01
@JP
statutory  = [2026-09-21, 2026-09-23] covering: 2026..2026
sandwiched = ((statutory |> shift(+1, unit: day)) & (statutory |> shift(-1, unit: day))) \ statutory
statutory | sandwiched
#=> 2026-09-21 2026-09-22 2026-09-23

Difference: “excluding weekends”:

# eval: 2026-01-01..2026-01-06
@JP
everyDay \ satSun
#=> 2026-01-01 2026-01-02 2026-01-05

Pitfalls

filter · roll (deriving substitutes) · snapTo (explicit alignment conformance) · coincides (window-membership composition) · rebase (cross-tz date correspondence) · ADR-01/04/22/36 · representative example §7.5.