SubdailyPattern

SubdailyPattern :: # (opaque)

Anchored local clock periods. Higher fields restrict the moving period; lower fields expand it, inheriting omitted values from the original clock. Period arithmetic uses nominal civil seconds, never resolved elapsed time.

new : { date : GregorianDate, clock : ClockTime }, Spec -> Try(SubdailyPattern, [InvalidInterval, TooManySelectors, InvalidSelector(Str), InvalidCombination(Str), InvalidHour, InvalidMinute, InvalidSecond, UnsupportedLeapSecond, ..])

Construct hourly, minutely or secondly periods with checked calendar filters and clock selectors. Reject nonpositive intervals and invalid selector fields before enumeration.

definition : SubdailyPattern -> { frequency : Frequency, interval : I64, calendar : Spec }

Read frequency, interval and calendar predicates for this checked pattern. Only the filter fields of calendar describe this pattern; its calendar-period defaults do not replace the returned subdaily frequency and interval.

clocks : SubdailyPattern -> ClockPattern

Return the effective checked clock selectors used within each period, including defaults derived from frequency and anchor.

matches_date : SubdailyPattern, GregorianDate -> Try(Bool, [OutOfRange, ..])

Test a date against this pattern’s calendar filters; this does not test clock membership or period alignment.

period : SubdailyPattern, U64 -> Try(Period, [OutOfRange, ..])

Constant arithmetic plus O(log 86400) clock seeks; no intervening periods are visited. Both boundaries must fit the Gregorian provider.

starts_before : SubdailyPattern, U64, LocalDateTime -> Bool

Compare the next whole-period start without requiring that far-future date to fit the provider. A finite query can finish before a huge step.

to_inspect : SubdailyPattern -> Str

Return a bounded diagnostic summary without advancing cursors or enumerating occurrences. Use typed accessors for application logic; this text is not a storage format.

Frequency : [Hourly, Minutely, Secondly]

Whole local hour, minute or second periods. These are civil recurrence periods, not fixed elapsed intervals through a zone transition.

Spec : { frequency : Frequency, interval : I64, calendar : Spec, clocks : Spec }

Subdaily frequency/interval, calendar predicates and clock selectors. Higher omitted clock fields expand over their full range; lower omitted fields inherit the anchor.

Period : { date : GregorianDate, start_index : U64, end_index : U64, end : LocalDateTime }

One local period’s date, exclusive end and half-open indices into its effective clock pattern. An empty index range means no clock candidate in that period.