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, ..])
definition : SubdailyPattern -> { frequency : Frequency, interval : I64, calendar : Spec }

Effective declaration parameters. Construction proves interval fits I64. calendar carries filter predicates only; its period fields are placeholders.

clocks : SubdailyPattern -> ClockPattern
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.

Spec : { frequency : Frequency, interval : I64, calendar : Spec, clocks : Spec }
Period : { date : GregorianDate, start_index : U64, end_index : U64, end : LocalDateTime }