hasquant
Safe HaskellNone
LanguageHaskell2010

QuantLib.Time.Date

Synopsis

Types

data Day #

The Modified Julian Day is a standard count of days, with zero being the day 1858-11-17.

Instances

Instances details
NFData Day 
Instance details

Defined in Data.Time.Calendar.Days

Methods

rnf :: Day -> () #

Data Day 
Instance details

Defined in Data.Time.Calendar.Days

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Day -> c Day #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Day #

toConstr :: Day -> Constr #

dataTypeOf :: Day -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Day) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Day) #

gmapT :: (forall b. Data b => b -> b) -> Day -> Day #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Day -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Day -> r #

gmapQ :: (forall d. Data d => d -> u) -> Day -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Day -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Day -> m Day #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Day -> m Day #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Day -> m Day #

Enum Day 
Instance details

Defined in Data.Time.Calendar.Days

Methods

succ :: Day -> Day #

pred :: Day -> Day #

toEnum :: Int -> Day #

fromEnum :: Day -> Int #

enumFrom :: Day -> [Day] #

enumFromThen :: Day -> Day -> [Day] #

enumFromTo :: Day -> Day -> [Day] #

enumFromThenTo :: Day -> Day -> Day -> [Day] #

Ix Day 
Instance details

Defined in Data.Time.Calendar.Days

Methods

range :: (Day, Day) -> [Day] #

index :: (Day, Day) -> Day -> Int #

unsafeIndex :: (Day, Day) -> Day -> Int #

inRange :: (Day, Day) -> Day -> Bool #

rangeSize :: (Day, Day) -> Int #

unsafeRangeSize :: (Day, Day) -> Int #

Read Day 
Instance details

Defined in Data.Time.Format.Parse

Show Day 
Instance details

Defined in Data.Time.Calendar.Gregorian

Methods

showsPrec :: Int -> Day -> ShowS #

show :: Day -> String #

showList :: [Day] -> ShowS #

Eq Day 
Instance details

Defined in Data.Time.Calendar.Days

Methods

(==) :: Day -> Day -> Bool #

(/=) :: Day -> Day -> Bool #

Ord Day 
Instance details

Defined in Data.Time.Calendar.Days

Methods

compare :: Day -> Day -> Ordering #

(<) :: Day -> Day -> Bool #

(<=) :: Day -> Day -> Bool #

(>) :: Day -> Day -> Bool #

(>=) :: Day -> Day -> Bool #

max :: Day -> Day -> Day #

min :: Day -> Day -> Day #

DayPeriod Day 
Instance details

Defined in Data.Time.Calendar.Days

FormatTime Day 
Instance details

Defined in Data.Time.Format.Format.Instances

ISO8601 Day

yyyy-mm-dd (ISO 8601:2004(E) sec. 4.1.2.2 extended format)

Instance details

Defined in Data.Time.Format.ISO8601

ParseTime Day 
Instance details

Defined in Data.Time.Format.Parse.Instances

data Month Source #

returns TRUE if the given date's year is leap

Instances

Instances details
Bounded Month Source # 
Instance details

Defined in QuantLib.Time.Date

Enum Month Source # 
Instance details

Defined in QuantLib.Time.Date

Read Month Source # 
Instance details

Defined in QuantLib.Time.Date

Show Month Source # 
Instance details

Defined in QuantLib.Time.Date

Methods

showsPrec :: Int -> Month -> ShowS #

show :: Month -> String #

showList :: [Month] -> ShowS #

Eq Month Source # 
Instance details

Defined in QuantLib.Time.Date

Methods

(==) :: Month -> Month -> Bool #

(/=) :: Month -> Month -> Bool #

Ord Month Source # 
Instance details

Defined in QuantLib.Time.Date

Methods

compare :: Month -> Month -> Ordering #

(<) :: Month -> Month -> Bool #

(<=) :: Month -> Month -> Bool #

(>) :: Month -> Month -> Bool #

(>=) :: Month -> Month -> Bool #

max :: Month -> Month -> Month #

min :: Month -> Month -> Month #

data Weekday Source #

Instances

Instances details
Bounded Weekday Source # 
Instance details

Defined in QuantLib.Time.Date

Enum Weekday Source # 
Instance details

Defined in QuantLib.Time.Date

Read Weekday Source # 
Instance details

Defined in QuantLib.Time.Date

Show Weekday Source # 
Instance details

Defined in QuantLib.Time.Date

Eq Weekday Source # 
Instance details

Defined in QuantLib.Time.Date

Methods

(==) :: Weekday -> Weekday -> Bool #

(/=) :: Weekday -> Weekday -> Bool #

Ord Weekday Source # 
Instance details

Defined in QuantLib.Time.Date

data ImmMonth Source #

Constructors

F 
G 
H 
J 
K 
M 
N 
Q 
U 
V 
X 
Z 

Constructors

Bounds and current date

minDate :: Day Source #

earliest allowed date in QuantLib

maxDate :: Day Source #

latest date allowed in QuantLib

Months

january :: Int -> Int -> Day Source #

helper function that is convenient for use as an infix operator

march :: Int -> Int -> Day Source #

april :: Int -> Int -> Day Source #

may :: Int -> Int -> Day Source #

june :: Int -> Int -> Day Source #

july :: Int -> Int -> Day Source #

Mutators

addEcbDate :: Day -> IO () Source #

adds a date to the set of known ECB maintenance period start dates

removeEcbDate :: Day -> IO () Source #

removes a date from the set of known ECB maintenance period start dates

Inspectors

Date arithmetic

endOfMonth :: Day -> IO Day Source #

last day of the month to which the given date belongs

nextWeekday :: Day -> Weekday -> IO Day Source #

next given weekday following or equal to the given date E.g., the Friday following Tuesday, January 15th, 2002 was January 18th, 2002.see http://www.cpearson.com/excel/DateTimeWS.htm

nthWeekday :: Word -> Weekday -> Month -> Int -> IO Day Source #

n-th given weekday in the given month and year E.g., the 4th Thursday of March, 1998 was March 26th, 1998.see http://www.cpearson.com/excel/DateTimeWS.htm Warning It raises an exception unless the n-th falls in 1..5

addPeriod :: Day -> (Int, TimeUnit) -> IO Day Source #

the given date advanced by a period

IMM dates and codes

immCode :: Day -> IO String Source #

returns the IMM code for the given date (e.g. H3 for March 20th, 2013). Warning It raises an exception if the input date is not an IMM date

immDate :: String -> Day -> IO Day Source #

returns the IMM date for the given IMM code (e.g. March 20th, 2013 for H3). Warning It raises an exception if the input string is not an IMM code

nextImmCode Source #

Arguments

:: Day 
-> Bool

mainCycle

-> IO String 

next IMM code following the given date returns the IMM code for next contract listed in the International Money Market section of the Chicago Mercantile Exchange.

nextImmCodeFromCode Source #

Arguments

:: String 
-> Bool

mainCycle

-> Day 
-> IO String 

next IMM code following the given code returns the IMM code for next contract listed in the International Money Market section of the Chicago Mercantile Exchange.

nextImmDate Source #

Arguments

:: Day 
-> Bool

mainCycle

-> IO Day 

next IMM date following the given date returns the 1st delivery date for next contract listed in the International Money Market section of the Chicago Mercantile Exchange.

nextImmDateFromCode Source #

Arguments

:: String 
-> Bool

mainCycle

-> Day

referenceDate

-> IO Day 

next IMM date following the given IMM code returns the 1st delivery date for next contract listed in the International Money Market section of the Chicago Mercantile Exchange.

ECB maintenance dates

ecbCode :: Day -> IO String Source #

returns the ECB code for the given date (e.g. MAR10 for March xxth, 2010).Warning It raises an exception if the input date is not an ECB date

ecbDateFromCode :: String -> Maybe Day -> IO Day Source #

returns the ECB date for the given ECB code (e.g. March xxth, 2013 for MAR10).WarningIt raises an exception if the input string is not an ECB code

ecbDate :: Month -> Int -> IO Day Source #

maintenance period start date in the given month/year

nextEcbCodeFromCode :: String -> IO String Source #

next ECB code following the given code

nextEcbCode :: Maybe Day -> IO String Source #

next ECB code following the given date

nextEcbDateFromCode :: String -> Maybe Day -> IO Day Source #

next maintenance period start date following the given ECB code

nextEcbDate :: Maybe Day -> IO Day Source #

next maintenance period start date following the given date

nextEcbDatesFromCode :: String -> Maybe Day -> IO [Day] Source #

next maintenance period start dates following the given code

nextEcbDates :: Maybe Day -> IO [Day] Source #

next maintenance period start dates following the given date

Date fields

weekday :: Day -> IO Weekday Source #

the day of the week for the given date

dayOfYear :: Day -> IO Int Source #

One-based (Jan 1st = 1)

isEndOfMonth :: Day -> IO Bool Source #

whether a date is the last day of its month

IMM and ECB predicates

isImmCode Source #

Arguments

:: String

immCode

-> Bool

mainCycle

-> Bool 

returns whether or not the given string is an IMM code

isImmDate Source #

Arguments

:: Day 
-> Bool

mainCycle

-> IO Bool 

returns whether or not the given date is an IMM date

isEcbCode :: String -> IO Bool Source #

returns whether or not the given string is an ECB code

isEcbDate :: Day -> IO Bool Source #

returns whether or not the given date is a maintenance period start date

knownEcbDates :: IO [Day] Source #

the set of known ECB maintenance period start dates