Safe Haskell | None |
---|
- class Moment a where
- iterateMoments :: Moment a => (a -> a) -> a -> [a]
- withYearDay :: (CalendarTimeConvertible a, Moment a) => a -> Int -> Maybe a
- withWeekNumber :: (CalendarTimeConvertible a, Moment a) => StartOfWeek -> a -> Int -> Maybe a
- withSecond :: (CalendarTimeConvertible a, Moment a) => a -> Int -> Maybe a
- withMinute :: (CalendarTimeConvertible a, Moment a) => a -> Int -> Maybe a
- withHour :: (CalendarTimeConvertible a, Moment a) => a -> Int -> Maybe a
- withDay :: (CalendarTimeConvertible a, Moment a) => a -> Int -> Maybe a
- withMonth :: (CalendarTimeConvertible a, Moment a) => a -> Month -> Maybe a
- withYear :: (CalendarTimeConvertible a, Moment a) => a -> Integer -> Maybe a
- advanceToWeekDay :: (CalendarTimeConvertible a, Moment a) => a -> WeekDay -> a
- data InitialMoment a = InitialMoment {
- period :: Period
- interval :: Interval
- startOfWeek :: StartOfWeek
- moment :: a
- data Period
Moment
class Moment a where
The Moment
class is for representing a instance in time.
Instances of Moment
can be derived for any user-defined
datatype for which can satisfy the minimal complete definition.
Minimal complete definition: epoch
, addSeconds
, addMonths
, addYears
epoch :: a
Provide a default moment.
addSeconds :: a -> Integer -> a
addMonths :: a -> Integer -> a
addMinutes :: a -> Integer -> a
next :: Interval -> Period -> a -> a
Produce a new Moment
in the future ocurring at (interval * freq)
prev :: Interval -> Period -> a -> a
Produce a new Moment
in the past ocurring at (-interval * freq)
Moment UTCTime |
iterateMoments :: Moment a => (a -> a) -> a -> [a]
Produce an infinite list from an initial Moment
and a step function.
withYearDay :: (CalendarTimeConvertible a, Moment a) => a -> Int -> Maybe a
Possibly produce a Moment
with the given day of the year
withWeekNumber :: (CalendarTimeConvertible a, Moment a) => StartOfWeek -> a -> Int -> Maybe a
Possibly produce a Moment
with the given week number
withSecond :: (CalendarTimeConvertible a, Moment a) => a -> Int -> Maybe a
Possibly produce a Moment
with the given second
withMinute :: (CalendarTimeConvertible a, Moment a) => a -> Int -> Maybe a
Possibly produce a Moment
with the given minute
withHour :: (CalendarTimeConvertible a, Moment a) => a -> Int -> Maybe a
Possibly produce a Moment
with the given hour
withDay :: (CalendarTimeConvertible a, Moment a) => a -> Int -> Maybe a
Possibly produce a Moment
with the given month day
withMonth :: (CalendarTimeConvertible a, Moment a) => a -> Month -> Maybe a
Possibly produce a Moment
with the given month
withYear :: (CalendarTimeConvertible a, Moment a) => a -> Integer -> Maybe a
Possibly produce a Moment
with the given year
advanceToWeekDay :: (CalendarTimeConvertible a, Moment a) => a -> WeekDay -> a
Initial Moment
data InitialMoment a
The InitialMoment
datatype
InitialMoment | |
|
Show a => Show (InitialMoment a) |