Idris2Doc : IotaTime.Calendar

IotaTime.Calendar

(source)

Reexports

importpublic IotaTime.Calendar.Component

Definitions

dataDayOfWeek : Type
  A weekday in the standard seven-day civil week shared by all iotaTime
calendars.

Totality: total
Visibility: public export
Constructors:
Sunday : DayOfWeek
Monday : DayOfWeek
Tuesday : DayOfWeek
Wednesday : DayOfWeek
Thursday : DayOfWeek
Friday : DayOfWeek
Saturday : DayOfWeek

Hints:
EqDayOfWeek
OrdDayOfWeek
ShowDayOfWeek
weekdayNumber : DayOfWeek->Integer
  Zero-based weekday position from Sunday through Saturday.

Totality: total
Visibility: public export
daysPerWeek : Integer
  Number of days in the standard civil week modeled by iotaTime calendars.

Totality: total
Visibility: public export
weekdayFromNumber : Integer->DayOfWeek
  Convert an integer weekday position to the corresponding weekday,
wrapping values outside the standard zero-through-six range.

Totality: total
Visibility: public export
nextWeekdayOffset : Integer->DayOfWeek->DayOfWeek->Integer
  Signed day offset to the requested following weekday occurrence.

Totality: total
Visibility: export
previousWeekdayOffset : Integer->DayOfWeek->DayOfWeek->Integer
  Signed day offset to the requested preceding weekday occurrence.

Totality: total
Visibility: export
applyDatePeriodWith : (Integer->date->date) -> (Integer->date->date) -> (Integer->date->date) ->Periodtarget->date->date
  Apply calendar period components from largest to smallest, preserving a
separate shift for weeks before the final day shift.

Totality: total
Visibility: export
dataDayNth : Type
  Selects an occurrence of a weekday within a month.

Totality: total
Visibility: public export
Constructors:
FourthToLast : DayNth
ThirdToLast : DayNth
SecondToLast : DayNth
Last : DayNth
First : DayNth
Second : DayNth
Third : DayNth
Fourth : DayNth
Fifth : DayNth

Hints:
EqDayNth
ShowDayNth
nthWeekdayDayNumber : DayNth->Integer->Integer->Integer->Integer
  Compute the raw day-of-month candidate for a weekday occurrence.
Calendar implementations remain responsible for validating the candidate
against their supported year and month ranges before constructing a date.

Totality: total
Visibility: export
dataCalendarConversionError : Type
  A calendar conversion failed because the target calendar cannot represent
the source date's bridge day.

Totality: total
Visibility: public export
Constructor: 
TargetCalendarOutOfRange : String->Integer->CalendarConversionError
dataDateDifferenceUnits : Type
  Calendar units used when decomposing the difference between two dates.

Totality: total
Visibility: public export
Constructors:
DaysOnly : DateDifferenceUnits
YearsMonthsDays : DateDifferenceUnits
dataMonthArithmeticPolicy : Type
  Month arithmetic used while decomposing a calendar difference.

Totality: total
Visibility: public export
Constructor: 
ClampToMonth : MonthArithmeticPolicy
recordDateDifferencePolicy : Type
  Controls how a difference between calendar dates is decomposed.

Totality: total
Visibility: public export
Constructor: 
MkDateDifferencePolicy : DateDifferenceUnits->MonthArithmeticPolicy->DateDifferencePolicy

Projections:
.monthArithmetic : DateDifferencePolicy->MonthArithmeticPolicy
.units : DateDifferencePolicy->DateDifferenceUnits
.units : DateDifferencePolicy->DateDifferenceUnits
Totality: total
Visibility: public export
units : DateDifferencePolicy->DateDifferenceUnits
Totality: total
Visibility: public export
.monthArithmetic : DateDifferencePolicy->MonthArithmeticPolicy
Totality: total
Visibility: public export
monthArithmetic : DateDifferencePolicy->MonthArithmeticPolicy
Totality: total
Visibility: public export
nodaTimePolicy : DateDifferencePolicy
  The standard largest-first, non-overshooting calendar decomposition.

Totality: total
Visibility: public export
interfaceCalendar : Type->Type
  Capabilities and dependent representations required of a calendar.
`MonthRep` may depend on the year, allowing calendars such as Hebrew to
make leap-only months unrepresentable in common years.

Parameters: calendar
Methods:
DateRep : Type
MonthRep : Year->Type
isValidDays : Integer->Bool
fromDays : (days : Integer) -> {auto0_ : So (isValidDaysdays)} ->DateRep
toDaysFor : DateRep->Integer
0toDaysValid : (date : DateRep) ->So (isValidDays (toDaysFordate))
0toFromDays : (days : Integer) -> (0valid : So (isValidDaysdays)) ->toDaysFor (fromDaysdays) =days
0fromToDays : (date : DateRep) ->fromDays (toDaysFordate) =date
calendarName : String
year' : DateRep->Year
toYmd : (date : DateRep) -> (MonthRep (year'date), DayOfMonth)
day' : DateRep->DayOfMonth
month' : (date : DateRep) ->MonthRep (year'date)
applyCalendarPeriod' : Periodtarget->DateRep->DateRep
shiftCalendarDays' : Integer->DateRep->DateRep
dayOfWeekFor : DateRep->DayOfWeek
nextFor : Integer->DayOfWeek->DateRep->DateRep
previousFor : Integer->DayOfWeek->DateRep->DateRep
DateRep : Calendarcalendar=>Type
Totality: total
Visibility: public export
MonthRep : Calendarcalendar=>Year->Type
Totality: total
Visibility: public export
isValidDays : Calendarcalendar=>Integer->Bool
Totality: total
Visibility: public export
fromDays : {auto__con : Calendarcalendar} -> (days : Integer) -> {auto0_ : So (isValidDaysdays)} ->DateRep
Totality: total
Visibility: public export
toDaysFor : {auto__con : Calendarcalendar} ->DateRep->Integer
Totality: total
Visibility: public export
0toDaysValid : {auto__con : Calendarcalendar} -> (date : DateRep) ->So (isValidDays (toDaysFordate))
Totality: total
Visibility: public export
0toFromDays : {auto__con : Calendarcalendar} -> (days : Integer) -> (0valid : So (isValidDaysdays)) ->toDaysFor (fromDaysdays) =days
Totality: total
Visibility: public export
0fromToDays : {auto__con : Calendarcalendar} -> (date : DateRep) ->fromDays (toDaysFordate) =date
Totality: total
Visibility: public export
calendarName : Calendarcalendar=>String
Totality: total
Visibility: public export
year' : {auto__con : Calendarcalendar} ->DateRep->Year
Totality: total
Visibility: public export
toYmd : {auto__con : Calendarcalendar} -> (date : DateRep) -> (MonthRep (year'date), DayOfMonth)
Totality: total
Visibility: public export
day' : {auto__con : Calendarcalendar} ->DateRep->DayOfMonth
Totality: total
Visibility: public export
month' : {auto__con : Calendarcalendar} -> (date : DateRep) ->MonthRep (year'date)
Totality: total
Visibility: public export
applyCalendarPeriod' : {auto__con : Calendarcalendar} ->Periodtarget->DateRep->DateRep
Totality: total
Visibility: public export
shiftCalendarDays' : {auto__con : Calendarcalendar} ->Integer->DateRep->DateRep
Totality: total
Visibility: public export
dayOfWeekFor : {auto__con : Calendarcalendar} ->DateRep->DayOfWeek
Totality: total
Visibility: public export
nextFor : {auto__con : Calendarcalendar} ->Integer->DayOfWeek->DateRep->DateRep
Totality: total
Visibility: public export
previousFor : {auto__con : Calendarcalendar} ->Integer->DayOfWeek->DateRep->DateRep
Totality: total
Visibility: public export
CalendarDate : (calendar : Type) ->Calendarcalendar=>Type
  The opaque date representation selected by a calendar implementation.

Totality: total
Visibility: public export
interfaceHasCalendarBridge : Type->Type
  Internal normalization implemented by iotaTime's built-in calendars for
cross-calendar and instant conversion. Calendar-local APIs use
`Calendar.toDaysFor` instead.

Parameters: date
Methods:
toBridgeDays : date->Integer
acceptsBridgeDays : Integer->Bool
fromBridgeDays : (days : Integer) -> {auto0_ : So (acceptsBridgeDaysdays)} ->date
bridgeCalendarName : String

Implementation: 
CalendarValuedate->HasCalendarBridgedate
toBridgeDays : HasCalendarBridgedate=>date->Integer
Totality: total
Visibility: export
acceptsBridgeDays : HasCalendarBridgedate=>Integer->Bool
Totality: total
Visibility: export
fromBridgeDays : {auto__con : HasCalendarBridgedate} -> (days : Integer) -> {auto0_ : So (acceptsBridgeDaysdays)} ->date
Totality: total
Visibility: export
bridgeCalendarName : HasCalendarBridgedate=>String
Totality: total
Visibility: export
interfaceCalendarValue : Type->Type
  Calendar operations determined by a concrete date representation.
This lets value-oriented APIs infer the calendar from their first date
argument instead of requiring a repeated `{calendar = ...}` annotation.

Parameters: date
Constraints: HasCalendarBridge date
Methods:
CalendarMonth : Year->Type
calendarValueToDays : date->Integer
calendarValueYear : date->Year
calendarValueMonthDay : (value : date) -> (CalendarMonth (calendarValueYearvalue), DayOfMonth)
calendarValueDayOfWeek : date->DayOfWeek
calendarValueBetweenWith : DateDifferencePolicy->date->date->Perioddate

Implementation: 
CalendarNavigationdate->CalendarValuedate
CalendarMonth : CalendarValuedate=>Year->Type
Totality: total
Visibility: public export
calendarValueToDays : CalendarValuedate=>date->Integer
Totality: total
Visibility: public export
calendarValueYear : CalendarValuedate=>date->Year
Totality: total
Visibility: public export
calendarValueMonthDay : {auto__con : CalendarValuedate} -> (value : date) -> (CalendarMonth (calendarValueYearvalue), DayOfMonth)
Totality: total
Visibility: public export
calendarValueDayOfWeek : CalendarValuedate=>date->DayOfWeek
Totality: total
Visibility: public export
calendarValueBetweenWith : CalendarValuedate=>DateDifferencePolicy->date->date->Perioddate
Totality: total
Visibility: public export
interfaceCalendarNavigation : Type->Type
  Weekday navigation selected by the concrete date representation.

Parameters: date
Constraints: CalendarValue date
Methods:
calendarValueNext : Integer->DayOfWeek->date->date
calendarValuePrevious : Integer->DayOfWeek->date->date
calendarValueNext : CalendarNavigationdate=>Integer->DayOfWeek->date->date
Totality: total
Visibility: public export
calendarValuePrevious : CalendarNavigationdate=>Integer->DayOfWeek->date->date
Totality: total
Visibility: public export
yearFor : {autocal : Calendarcalendar} ->CalendarDatecalendar->Year
  Extract the calendar year from a date.

Totality: total
Visibility: public export
monthFor : {autocal : Calendarcalendar} -> (date : CalendarDatecalendar) ->MonthRep (yearFordate)
  Extract the year-indexed calendar month from a date.

Totality: total
Visibility: public export
dayFor : {autocal : Calendarcalendar} ->CalendarDatecalendar->DayOfMonth
  Extract the day of month from a date.

Totality: total
Visibility: public export
applyCalendarPeriod : {autocal : Calendarcalendar} ->Periodtarget->CalendarDatecalendar->CalendarDatecalendar
Totality: total
Visibility: export
shiftCalendarDays : {autocal : Calendarcalendar} ->Integer->CalendarDatecalendar->CalendarDatecalendar
Totality: total
Visibility: export
betweenDaysFor : {autocal : Calendarcalendar} ->HasCalendar (CalendarDatecalendar) =>CalendarDatecalendar->CalendarDatecalendar->Period (CalendarDatecalendar)
  Compute the exact signed day period from `start` to `end`.

Totality: total
Visibility: public export
betweenWithFor : {autocal : Calendarcalendar} ->HasCalendar (CalendarDatecalendar) =>DateDifferencePolicy->CalendarDatecalendar->CalendarDatecalendar->Period (CalendarDatecalendar)
  Decompose the signed difference from `start` to `end` according to `policy`.
Calendar units are selected largest-first without passing the endpoint.

Totality: total
Visibility: public export
betweenFor : {autocal : Calendarcalendar} ->HasCalendar (CalendarDatecalendar) =>CalendarDatecalendar->CalendarDatecalendar->Period (CalendarDatecalendar)
  Decompose the signed calendar difference using `nodaTimePolicy`.

Totality: total
Visibility: public export
yearMonthDayFor : {autocal : Calendarcalendar} ->CalendarDatecalendar-> (valueYear : Year** (MonthRepvalueYear, DayOfMonth))
  Decompose a date while preserving the dependency between its year and month.

Totality: total
Visibility: public export
betweenDays : date->CalendarValuedate=>date->Perioddate
  Compute the exact signed day period from `start` to `end`.

Totality: total
Visibility: public export
betweenWith : DateDifferencePolicy->date->CalendarValuedate=>date->Perioddate
  Decompose a difference according to `policy`, inferring the calendar from
the first date argument.

Totality: total
Visibility: public export
between : date->CalendarValuedate=>date->Perioddate
  Decompose a signed date difference using `nodaTimePolicy`.

Totality: total
Visibility: public export
yearMonthDay : date-> {autorep : CalendarValuedate} -> (valueYear : Year** (CalendarMonthvalueYear, DayOfMonth))
  Decompose a date while preserving its year-indexed month type.

Totality: total
Visibility: public export
toDays : date->CalendarValuedate=>Integer
  Return the calendar-relative day count for a concrete date value.

Totality: total
Visibility: public export
year : date->CalendarValuedate=>Year
  Extract the calendar year from a concrete date value.

Totality: total
Visibility: public export
month : (value : date) -> {autorep : CalendarValuedate} ->CalendarMonth (yearvalue)
  Extract the year-indexed calendar month from a concrete date value.

Totality: total
Visibility: public export
day : date->CalendarValuedate=>DayOfMonth
  Extract the day of month from a concrete date value.

Totality: total
Visibility: public export
calendarComponentsCoherent : (value : date) -> {autorep : CalendarValuedate} ->yearMonthDayvalue= (yearvalue** (monthvalue, dayvalue))
  Combined and projected civil-date observations are definitionally coherent.

Totality: total
Visibility: public export
dayOfWeek : date->CalendarValuedate=>DayOfWeek
  Extract the weekday from a concrete date value.

Totality: total
Visibility: public export
next : CalendarNavigationdate=>Integer->DayOfWeek->date->date
  Find a matching weekday relative to a concrete date value.

Totality: total
Visibility: public export
previous : CalendarNavigationdate=>Integer->DayOfWeek->date->date
  Find a preceding matching weekday relative to a concrete date value.

Totality: total
Visibility: public export
withCalendar : HasCalendarBridgesourceDate=>HasCalendarBridgetargetDate=>sourceDate->EitherCalendarConversionErrortargetDate
  Convert a date to another calendar through their shared bridge day.
Returns `TargetCalendarOutOfRange` when the target cannot represent it.

Totality: total
Visibility: public export