Module
Temporal.Internal.Options
- Package
- purescript-temporal
- Repository
- philippedev101/purescript-temporal
Option types used across Temporal operations.
These ADTs represent the various option enums from the TC39 Temporal specification. They are converted to JavaScript strings before being passed to the FFI.
#RoundingMode Source
data RoundingModeRounding modes matching TC39 Temporal specification.
HalfExpand(default) — round half toward positive infinity ("normal" rounding)Ceil— round toward positive infinityFloor— round toward negative infinityTrunc— round toward zeroExpand— round away from zeroHalfCeil— round half toward positive infinityHalfFloor— round half toward negative infinityHalfTrunc— round half toward zeroHalfEven— round half to even (banker's rounding)
Constructors
Instances
#Overflow Source
data OverflowHow to handle out-of-range field values (e.g. day 31 in a 30-day month).
Constrain— clamp to the nearest valid value (e.g. day 31 → day 30)Reject— fail (returnNothing)
Most Temporal constructors default to Constrain.
Constructors
Instances
#overflowToString Source
overflowToString :: Overflow -> String#Disambiguation Source
data DisambiguationHow to resolve wall-clock times that are ambiguous or non-existent due to DST transitions.
Compatible(default) — acts likeLaterfor gaps (spring forward) andEarlierfor ambiguities (fall back). This matches the behavior of legacyDate.Earlier— pick the earlier of two possible instantsLater— pick the later of two possible instantsRejectDisambiguation— fail for ambiguous or non-existent times
Constructors
Instances
#OffsetDisambiguation Source
data OffsetDisambiguationHow to resolve conflicts between an explicit UTC offset in a string and the IANA timezone's rules for that instant.
Use— trust the offset, ignore timezone rulesIgnore— trust the timezone, recompute the offsetPrefer— use the offset if it's valid for the timezone, otherwise recompute (good forwithoperations)RejectOffset— fail if offset and timezone disagree (good for parsing untrusted input)
Constructors
Instances
#TransitionDirection Source
#dateUnitToString Source
dateUnitToString :: DateUnit -> String#timeUnitToString Source
timeUnitToString :: TimeUnit -> String