-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | HQuantLib Time is a business calendar functions extracted from HQuantLib
--   
--   HQuantLib is intended to be a functional style port of QuantLib
--   (http://quantlib.org)
@package hquantlib-time
@version 0.0.4.1

module QuantLib.Time.Date

-- | Defines a holidays for given calendar. Corresponds to calendar class
--   in QuantLib
class Holiday m
isHoliday :: Holiday m => m -> (Integer, Int, Int) -> Bool
isBusinessDay :: Holiday m => m -> Date -> Bool
hBusinessDayBetween :: Holiday m => m -> (Date, Date) -> Int

-- | Date
type Date = Day

-- | Week days
data WeekDay
Monday :: WeekDay
Tuesday :: WeekDay
Wednesday :: WeekDay
Thursday :: WeekDay
Friday :: WeekDay
Saturday :: WeekDay
Sunday :: WeekDay

-- | Business Day conventions - These conventions specify the algorithm
--   used to adjust a date in case it is not a valid business day.
data BusinessDayConvention
Following :: BusinessDayConvention
ModifiedFollowing :: BusinessDayConvention
Preceding :: BusinessDayConvention
ModifiedPreceding :: BusinessDayConvention
Unadjusted :: BusinessDayConvention

-- | Gets a week day
getWeekDay :: Date -> WeekDay

-- | Generate a list of all dates inbetween
getDaysBetween :: (Day, Day) -> [Day]

-- | Checks if the day is a weekend, i.e. Saturday or Sunday
isWeekEnd :: Date -> Bool

-- | Gets the next working day
getNextBusinessDay :: Holiday a => a -> Date -> Date
instance GHC.Enum.Enum QuantLib.Time.Date.WeekDay
instance GHC.Classes.Eq QuantLib.Time.Date.WeekDay
instance GHC.Show.Show QuantLib.Time.Date.WeekDay
instance GHC.Enum.Enum QuantLib.Time.Date.BusinessDayConvention
instance GHC.Classes.Eq QuantLib.Time.Date.BusinessDayConvention
instance GHC.Show.Show QuantLib.Time.Date.BusinessDayConvention

module QuantLib.Time.DayCounter

-- | Thirty day counters as in QuantLib
data Thirty360
ThirtyUSA :: Thirty360
ThirtyEuropean :: Thirty360
ThirtyItalian :: Thirty360

-- | Day counter type class
class DayCounter m

-- | Name of day counter
dcName :: DayCounter m => m -> String

-- | Number of business days inbetween
dcCount :: DayCounter m => m -> Date -> Date -> Int

-- | Year fraction
dcYearFraction :: DayCounter m => m -> Date -> Date -> Double
intGregorian :: Day -> (Int, Int, Int)
instance QuantLib.Time.DayCounter.DayCounter QuantLib.Time.DayCounter.Thirty360

module QuantLib.Time
