WashNGo-2.12.0.1: WASH is a family of EDSLs for programming Web applications in Haskell.

Safe HaskellNone

WASH.Utility.ISO8601

Synopsis

Documentation

secondsToString :: Integer -> [Char]Source

applyToCalT :: (CalendarTime -> a) -> IO aSource

class ToSeconds iso whereSource

Methods

toSeconds :: iso -> CalendarTime -> IntegerSource

returns number of seconds since reference point

toRawSeconds :: iso -> CalendarTime -> IntegerSource

leapSecondCorrection :: Num a => ISOTime -> aSource

problem: 19720630T235960 and 19720701T000000 are both mapped to the same number, 78796800, and then addLeapSeconds adds one yielding 78796801. While this is correct for 19720701T000000, 19720630T235960 must be 78796800. Implemented solution: if the current second specification is 0 and the time to convert is the leap second, then add 1.

isoDaysOfYearToSeconds :: Int -> ISODayOfYearSpec -> CalendarTime -> IntegerSource

isoMonthSpecToMonth :: ISOMonthSpec -> CalendarTime -> IntSource

daysUptoMonth :: (Integral a, Num a1) => a -> Int -> a1Source

isoYearSpecToYear :: ISOYearSpec -> CalendarTime -> IntSource

leapDays :: (Integral a, Num a1) => a -> a1Source

leapYear :: Integral a => a -> BoolSource

yearsToDays :: Int -> IntSource

yearsToWeekDay :: Int -> IntSource

compute weekday of Jan 1

leapSeconds :: [Integer]Source

in seconds from epoch; needs to be updated when time leaps again

data LeapSeconds Source

Constructors

LeapSecond Integer 
NotLeapSecond Integer 

Instances

addLeapSeconds :: [Integer] -> Integer -> LeapSecondsSource

secondsToClockTime :: Integral a => a -> ClockTimeSource

epochClkT :: ClockTimeSource

epoch :: CalendarTimeSource

data ISODateAndTime Source

data type for representing ISO time

data ISODate Source

Instances

Read ISODate 
Show ISODate 
ToSeconds ISODate 
Reason ISODate

Date and time in ISO8601 format

data ISOYearSpec Source

Constructors

ImplicitYear 
ImplicitCentury Int 
Century Int 
ImplicitDecade Int 
Year Int 

Instances

data ISOMonthSpec Source

Constructors

ImplicitMonth 
Month Int 

Instances

data ISODayOfMonthSpec Source

Constructors

NoDayOfMonth 
DayOfMonth Int 

Instances

data ISOWeekSpec Source

Constructors

ImplicitWeek 
AnyWeek 
Week Int 

Instances

data ISODayOfWeekSpec Source

Constructors

NoDayOfWeek 
DayOfWeek Int 

Instances

data ISOHourSpec Source

Constructors

ImplicitHour 
Hour Int 

digitval :: Char -> IntSource

skipColon :: Parser [Char] ()Source

skipMinus :: Parser [Char] ()Source

skipPlus :: Parser [Char] ()Source

skipP :: Parser [Char] ()Source

skipT :: Parser [Char] ()Source

skipW :: Parser [Char] ()Source

skipZ :: Parser [Char] ()Source

parseDate :: Parser [Char] ISODateSource

external entry point

parseBasicOrExtended :: (Bool -> Parser a b) -> Parser a bSource

parseDateInternal :: Bool -> Parser [Char] ISODateSource

argument determines whether extended format is parsed

parseTimeInternal :: Bool -> Parser [Char] ISOTimeSource

time parsers

checkSeconds :: (Monad m, Num a, Ord a) => a -> m ()Source

checkMinutes :: (Monad m, Num a, Ord a) => a -> m ()Source

checkHours :: (Monad m, Num a, Ord a) => a -> m ()Source

checkDays :: (Monad m, Num a, Ord a) => a -> m ()Source

checkWeeks :: (Monad m, Num a, Ord a) => a -> m ()Source