time-recurrence-0.9.0: Generate recurring dates.

Safe HaskellNone

Data.Time.Moment.Moment

Contents

Synopsis

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

Methods

epoch :: a

Provide a default moment.

addSeconds :: a -> Integer -> a

addMonths :: a -> Integer -> a

addYears :: a -> Integer -> a

addMinutes :: a -> Integer -> a

addHours :: a -> Integer -> a

addDays :: a -> Integer -> a

addWeeks :: 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)

Instances

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

Initial Moment

data InitialMoment a

The InitialMoment datatype

Constructors

InitialMoment 

Fields

period :: Period
 
interval :: Interval
 
startOfWeek :: StartOfWeek
 
moment :: a
 

Instances

Period

data Period

Period data type

Constructors

Seconds 
Minutes 
Hours 
Days 
Weeks 
Months 
Years