Defines the enumeration for days of the week. Each variant corresponds to a day of the week.
- monday: Std.Time.Weekday
Monday.
- tuesday: Std.Time.Weekday
Tuesday.
- wednesday: Std.Time.Weekday
Wednesday.
- thursday: Std.Time.Weekday
Thursday.
- friday: Std.Time.Weekday
Friday.
- saturday: Std.Time.Weekday
Saturday.
- sunday: Std.Time.Weekday
Sunday.
Instances For
Equations
- Std.Time.instReprWeekday = { reprPrec := Std.Time.reprWeekday✝ }
Equations
- Std.Time.instBEqWeekday = { beq := Std.Time.beqWeekday✝ }
Ordinal
represents a bounded value for weekdays, which ranges between 1 and 7.
Instances For
Equations
- Std.Time.Weekday.instOfNatOrdinal = inferInstanceAs (OfNat (Std.Time.Internal.Bounded.LE 1 (1 + ↑6)) n)
Converts a Ordinal
representing a day index into a corresponding Weekday
. This function is useful
for mapping numerical representations to days of the week.
Equations
- Std.Time.Weekday.ofOrdinal ⟨Int.ofNat 1, ⋯⟩ = Std.Time.Weekday.monday
- Std.Time.Weekday.ofOrdinal ⟨Int.ofNat 2, ⋯⟩ = Std.Time.Weekday.tuesday
- Std.Time.Weekday.ofOrdinal ⟨Int.ofNat 3, ⋯⟩ = Std.Time.Weekday.wednesday
- Std.Time.Weekday.ofOrdinal ⟨Int.ofNat 4, ⋯⟩ = Std.Time.Weekday.thursday
- Std.Time.Weekday.ofOrdinal ⟨Int.ofNat 5, ⋯⟩ = Std.Time.Weekday.friday
- Std.Time.Weekday.ofOrdinal ⟨Int.ofNat 6, ⋯⟩ = Std.Time.Weekday.saturday
- Std.Time.Weekday.ofOrdinal ⟨Int.ofNat 7, ⋯⟩ = Std.Time.Weekday.sunday
Instances For
Equations
- Std.Time.Weekday.monday.toNat = 1
- Std.Time.Weekday.tuesday.toNat = 2
- Std.Time.Weekday.wednesday.toNat = 3
- Std.Time.Weekday.thursday.toNat = 4
- Std.Time.Weekday.friday.toNat = 5
- Std.Time.Weekday.saturday.toNat = 6
- Std.Time.Weekday.sunday.toNat = 7
Instances For
Converts a Nat
to an Option Weekday
.
Equations
- Std.Time.Weekday.ofNat? 1 = some Std.Time.Weekday.monday
- Std.Time.Weekday.ofNat? 2 = some Std.Time.Weekday.tuesday
- Std.Time.Weekday.ofNat? 3 = some Std.Time.Weekday.wednesday
- Std.Time.Weekday.ofNat? 4 = some Std.Time.Weekday.thursday
- Std.Time.Weekday.ofNat? 5 = some Std.Time.Weekday.friday
- Std.Time.Weekday.ofNat? 6 = some Std.Time.Weekday.saturday
- Std.Time.Weekday.ofNat? 7 = some Std.Time.Weekday.sunday
- Std.Time.Weekday.ofNat? x = none
Instances For
@[inline]
Converts a Nat
to a Weekday
. Panics if the value provided is invalid.
Equations
- Std.Time.Weekday.ofNat! n = match Std.Time.Weekday.ofNat? n with | some res => res | none => panicWithPosWithDecl "Std.Time.Date.Unit.Weekday" "Std.Time.Weekday.ofNat!" 110 12 "invalid weekday"
Instances For
Gets the next Weekday
.