Equations
- Std.Time.Day.instOrdinalRepr = Std.Time.Internal.Bounded.instRepr
Equations
- Std.Time.Day.instOrdinalBEq = Std.Time.Internal.Bounded.instBEq
Equations
- Std.Time.Day.instOrdinalLE = Std.Time.Internal.Bounded.instLE
Equations
- Std.Time.Day.instOrdinalLT = Std.Time.Internal.Bounded.instLT
Equations
- Std.Time.Day.instOfNatOrdinal = inferInstanceAs (OfNat (Std.Time.Internal.Bounded.LE 1 (1 + ↑30)) n)
Equations
- Std.Time.Day.instDecidableLeOrdinal = inferInstanceAs (Decidable (x.val ≤ y.val))
Equations
- Std.Time.Day.instDecidableLtOrdinal = inferInstanceAs (Decidable (x.val < y.val))
Equations
- Std.Time.Day.instInhabitedOrdinal = { default := 1 }
Equations
- Std.Time.Day.instOffsetRepr = Std.Time.Internal.UnitVal.instRepr
Equations
- Std.Time.Day.instOffsetBEq = Std.Time.Internal.instBEqUnitVal
Equations
- Std.Time.Day.instOffsetInhabited = Std.Time.Internal.instInhabitedUnitVal
Equations
- Std.Time.Day.instOffsetAdd = Std.Time.Internal.UnitVal.instAdd
Equations
- Std.Time.Day.instOffsetSub = Std.Time.Internal.UnitVal.instSub
Equations
- Std.Time.Day.instOffsetNeg = Std.Time.Internal.UnitVal.instNeg
Equations
- Std.Time.Day.instOffsetLE = Std.Time.Internal.UnitVal.instLE
Equations
- Std.Time.Day.instOffsetLT = Std.Time.Internal.UnitVal.instLT
Equations
- Std.Time.Day.instOffsetToString = Std.Time.Internal.UnitVal.instToString
Equations
- Std.Time.Day.instOfNatOffset = { ofNat := Std.Time.Internal.UnitVal.ofNat n }
Equations
- Std.Time.Day.instDecidableLeOffset = inferInstanceAs (Decidable (x.val ≤ y.val))
Equations
- Std.Time.Day.instDecidableLtOffset = inferInstanceAs (Decidable (x.val < y.val))
Creates an Ordinal
from an integer, ensuring the value is within bounds.
Equations
- Std.Time.Day.Ordinal.ofInt data h = Std.Time.Internal.Bounded.LE.mk data h
Instances For
OfYear
represents the day ordinal within a year, which can be bounded between 1 and 365 or 366,
depending on whether it's a leap year.
Equations
- Std.Time.Day.Ordinal.OfYear leap = Std.Time.Internal.Bounded.LE 1 (Int.ofNat (if leap = true then 366 else 365))
Instances For
Equations
- Std.Time.Day.Ordinal.instReprOfYear = { reprPrec := fun (r : Std.Time.Day.Ordinal.OfYear leap) (p : Nat) => reprPrec r.val p }
Equations
- Std.Time.Day.Ordinal.instToStringOfYear = { toString := fun (r : Std.Time.Day.Ordinal.OfYear leap) => toString r.val }
Creates an ordinal for a specific day within the year, ensuring that the provided day (data
)
is within the valid range for the year, which can be 1 to 365 or 366 for leap years.
Equations
Instances For
Equations
- Std.Time.Day.Ordinal.instOfNatOfYear = inferInstanceAs (OfNat (Std.Time.Internal.Bounded.LE 1 (1 + ↑365)) n)
- Std.Time.Day.Ordinal.instOfNatOfYear = inferInstanceAs (OfNat (Std.Time.Internal.Bounded.LE 1 (1 + ↑364)) n)
Equations
- Std.Time.Day.Ordinal.instInhabitedOfYear = { default := ⟨1, ⋯⟩ }
Creates an ordinal from a natural number, ensuring the number is within the valid range for days of a month (1 to 31).
Equations
- Std.Time.Day.Ordinal.ofNat data h = Std.Time.Internal.Bounded.LE.ofNat' data h
Instances For
Converts an OfYear
ordinal to a Offset
.
Equations
- ofYear.toOffset = { val := ofYear.val }
Instances For
Converts an Offset
to an Ordinal
.
Equations
- off.toOrdinal h = Std.Time.Internal.Bounded.LE.mk off.val h
Instances For
Creates an Offset
from a natural number.
Equations
- Std.Time.Day.Offset.ofNat data = { val := ↑data }
Instances For
Creates an Offset
from an integer.
Equations
- Std.Time.Day.Offset.ofInt data = { val := data }
Instances For
Convert Day.Offset
into Nanosecond.Offset
.
Equations
- days.toNanoseconds = Std.Time.Internal.UnitVal.mul days 86400000000000
Instances For
Convert Nanosecond.Offset
into Day.Offset
.
Equations
- Std.Time.Day.Offset.ofNanoseconds ns = Std.Time.Internal.UnitVal.ediv ns 86400000000000
Instances For
Convert Day.Offset
into Millisecond.Offset
.
Equations
- days.toMilliseconds = Std.Time.Internal.UnitVal.mul days 86400000
Instances For
Convert Millisecond.Offset
into Day.Offset
.
Equations
- Std.Time.Day.Offset.ofMilliseconds ms = Std.Time.Internal.UnitVal.ediv ms 86400000
Instances For
Convert Day.Offset
into Second.Offset
.
Equations
- days.toSeconds = Std.Time.Internal.UnitVal.mul days 86400
Instances For
Convert Second.Offset
into Day.Offset
.
Equations
- Std.Time.Day.Offset.ofSeconds secs = Std.Time.Internal.UnitVal.ediv secs 86400
Instances For
Convert Day.Offset
into Minute.Offset
.
Equations
- days.toMinutes = Std.Time.Internal.UnitVal.mul days 1440
Instances For
Convert Minute.Offset
into Day.Offset
.
Equations
- Std.Time.Day.Offset.ofMinutes minutes = Std.Time.Internal.UnitVal.ediv minutes 1440
Instances For
Convert Day.Offset
into Hour.Offset
.
Equations
- days.toHours = Std.Time.Internal.UnitVal.mul days 24
Instances For
Convert Hour.Offset
into Day.Offset
.
Equations
- Std.Time.Day.Offset.ofHours hours = Std.Time.Internal.UnitVal.ediv hours 24