-- GENERATED by C->Haskell Compiler, version 0.28.8 Switcheroo, 25 November 2017 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "./QuantLib/Time/Calendar.chs" #-}
-- CalendarConstructor is declared in QuantLib.Internal.CalendarEnum, but its Read instance
-- needs `calendar` (below), and CalendarEnum -> Calendar -> CalendarEnum would be a cycle if
-- the instance lived there instead -- see deriveReadPlain's comment in Internal/Syntax.hs.
-- Deliberate, not a stray orphan.
{-# OPTIONS_GHC -Wno-orphans #-}
module QuantLib.Time.Calendar
  (
    -- * Types
    Calendar
  , CalendarConstructor(..)
  , JointCalendarRule(..)
  , BusinessDayConvention(..)

    -- * Constructors
  , calendar

    -- * Mutators
  , addHoliday
  , removeHoliday

    -- * Inspectors
  , adjust
  , advance
  , businessDaysBetween
  , endOfMonth
  , isBusinessDay
  , isEndOfMonth
  , isHoliday
  , isWeekend
  , holidays
  ) where
import qualified Foreign.C.String as C2HSImp
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.ForeignPtr as C2HSImp
import qualified Foreign.Marshal.Utils as C2HSImp
import qualified Foreign.Ptr as C2HSImp


import QuantLib.Internal
import QuantLib.Internal.Type
import QuantLib.Time.Date(Weekday)
import QuantLib.Internal.Common
import QuantLib.Internal.CalendarEnum
import System.IO.Unsafe(unsafePerformIO)








{-# LINE 45 "./QuantLib/Time/Calendar.chs" #-}


-- |Constructs the calendar for the given country, with an optional market variant.
qlCalendar :: (Int) -> (Int) -> IO ((Calendar))
qlCalendar a1 a2 =
  let {a1' = fromIntegral a1} in 
  let {a2' = fromIntegral a2} in 
  preErrorCheck $ \a3' -> 
  qlCalendar'_ a1' a2' a3' >>= \res ->
  peekCalendar res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 48 "./QuantLib/Time/Calendar.chs" #-}


calendar :: CalendarConstructor -> IO Calendar
calendar (Bespoke n w) = qlBespokeCalendar n w
calendar (Joint2 c1 c2 r) = qlJointCalendar2 c1 c2 r
calendar (Joint3 c1 c2 c3 r) = qlJointCalendar3 c1 c2 c3 r
calendar (Joint4 c1 c2 c3 c4 r) = qlJointCalendar4 c1 c2 c3 c4 r
calendar x = uncurry qlCalendar $ mapCalendar x

-- |Adjusts a non-business day to the appropriate near business day with respect to the given convention
adjust :: (Calendar) -> (Day) -> (BusinessDayConvention) -> IO ((Day))
adjust :: Calendar -> Day -> BusinessDayConvention -> IO Day
adjust Calendar
a1 Day
a2 BusinessDayConvention
a3 =
  Calendar -> (Ptr CCalendar -> IO Day) -> IO Day
forall b. Calendar -> (Ptr CCalendar -> IO b) -> IO b
withCalendar Calendar
a1 ((Ptr CCalendar -> IO Day) -> IO Day)
-> (Ptr CCalendar -> IO Day) -> IO Day
forall a b. (a -> b) -> a -> b
$ \Ptr CCalendar
a1' -> 
  Day -> (CInt -> IO Day) -> IO Day
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a2 ((CInt -> IO Day) -> IO Day) -> (CInt -> IO Day) -> IO Day
forall a b. (a -> b) -> a -> b
$ \CInt
a2' -> 
  let {a3' :: CInt
a3' = BusinessDayConvention -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC BusinessDayConvention
a3} in 
  (Ptr (Ptr CChar) -> IO Day) -> IO Day
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Day) -> IO Day)
-> (Ptr (Ptr CChar) -> IO Day) -> IO Day
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a4' -> 
  Ptr CCalendar -> CInt -> CInt -> Ptr (Ptr CChar) -> IO CInt
adjust'_ Ptr CCalendar
a1' CInt
a2' CInt
a3' Ptr (Ptr CChar)
a4' IO CInt -> (CInt -> IO Day) -> IO Day
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CInt
res ->
  let {res' = CInt -> Day
toDay CInt
res} in
  Ptr (Ptr CChar) -> IO ()
errorCheck  Ptr (Ptr CChar)
a4'IO () -> IO Day -> IO Day
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  Day -> IO Day
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Day
res')

{-# LINE 58 "./QuantLib/Time/Calendar.chs" #-}


-- |Advances the given date of the given number of business days and returns the result using business day convention and the EOM flag
advance :: (Calendar) -> (Day) -> ((Int,TimeUnit)) -> (BusinessDayConvention) -> (Bool) -- ^endOfMonth
 -> IO ((Day))
advance a1 a2 a3 a4 a5 =
  withCalendar a1 $ \a1' -> 
  withDay a2 $ \a2' -> 
  let {(a3'1, a3'2) = fromEnumQuantity a3} in 
  let {a4' = fromEnumC a4} in 
  let {a5' = C2HSImp.fromBool a5} in 
  preErrorCheck $ \a6' -> 
  advance'_ a1' a2' a3'1  a3'2 a4' a5' a6' >>= \res ->
  let {res' = toDay res} in
  errorCheck  a6'>>
  return (res')

{-# LINE 62 "./QuantLib/Time/Calendar.chs" #-}


-- |Adds a date to the set of holidays for the given calendar.
addHoliday :: (Calendar) -> (Day) -> IO ()
addHoliday a1 a2 =
  withCalendar a1 $ \a1' -> 
  withDay a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  addHoliday'_ a1' a2' a3' >>
  errorCheck  a3'>>
  return ()

{-# LINE 65 "./QuantLib/Time/Calendar.chs" #-}


-- |Calculates the number of business days between two given dates and returns the result.
businessDaysBetween :: (Calendar) -> (Day) -> (Day) -> (Bool) -- ^includeFirst
 -> (Bool) -- ^includeLast
 -> IO ((Int))
businessDaysBetween a1 a2 a3 a4 a5 =
  withCalendar a1 $ \a1' -> 
  withDay a2 $ \a2' -> 
  withDay a3 $ \a3' -> 
  let {a4' = C2HSImp.fromBool a4} in 
  let {a5' = C2HSImp.fromBool a5} in 
  preErrorCheck $ \a6' -> 
  businessDaysBetween'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = fromIntegral res} in
  errorCheck  a6'>>
  return (res')

{-# LINE 71 "./QuantLib/Time/Calendar.chs" #-}


-- |last business day of the month to which the given date belongs
endOfMonth :: (Calendar) -> (Day) -> IO ((Day))
endOfMonth a1 a2 =
  withCalendar a1 $ \a1' -> 
  withDay a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  endOfMonth'_ a1' a2' a3' >>= \res ->
  let {res' = toDay res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 74 "./QuantLib/Time/Calendar.chs" #-}


-- |Returns true iff the date is a business day for the given market.
isBusinessDay :: (Calendar) -> (Day) -> IO ((Bool))
isBusinessDay a1 a2 =
  withCalendar a1 $ \a1' -> 
  withDay a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  isBusinessDay'_ a1' a2' a3' >>= \res ->
  let {res' = C2HSImp.toBool res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 77 "./QuantLib/Time/Calendar.chs" #-}


-- |Returns true iff the date is last business day for the month in given market.
isEndOfMonth :: (Calendar) -> (Day) -> IO ((Bool))
isEndOfMonth a1 a2 =
  withCalendar a1 $ \a1' -> 
  withDay a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  isEndOfMonth'_ a1' a2' a3' >>= \res ->
  let {res' = C2HSImp.toBool res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 80 "./QuantLib/Time/Calendar.chs" #-}


-- |Returns true iff the date is a holiday for the given market.
isHoliday :: (Calendar) -> (Day) -> IO ((Bool))
isHoliday a1 a2 =
  withCalendar a1 $ \a1' -> 
  withDay a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  isHoliday'_ a1' a2' a3' >>= \res ->
  let {res' = C2HSImp.toBool res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 83 "./QuantLib/Time/Calendar.chs" #-}


-- |Returns true iff the weekday is part of the weekend for the given market.
isWeekend :: (Calendar) -> (Weekday) -> IO ((Bool))
isWeekend a1 a2 =
  withCalendar a1 $ \a1' -> 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  preErrorCheck $ \a3' -> 
  isWeekend'_ a1' a2' a3' >>= \res ->
  let {res' = C2HSImp.toBool res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 86 "./QuantLib/Time/Calendar.chs" #-}


-- |Removes a date from the set of holidays for the given calendar.
removeHoliday :: (Calendar) -> (Day) -> IO ()
removeHoliday a1 a2 =
  withCalendar a1 $ \a1' -> 
  withDay a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  removeHoliday'_ a1' a2' a3' >>
  errorCheck  a3'>>
  return ()

{-# LINE 89 "./QuantLib/Time/Calendar.chs" #-}


-- |Builds a calendar with no predefined business days; the given weekdays become its weekend.
qlBespokeCalendar :: (String) -> ([Weekday]) -> IO ((Calendar))
qlBespokeCalendar a1 a2 =
  C2HSImp.withCString a1 $ \a1' -> 
  withEnumArray a2 $ \(a2'1, a2'2) -> 
  preErrorCheck $ \a3' -> 
  qlBespokeCalendar'_ a1' a2'1  a2'2 a3' >>= \res ->
  peekCalendar res >>= \res' ->
  errorCheck  a3'>>
  return (res')

{-# LINE 92 "./QuantLib/Time/Calendar.chs" #-}


-- |Combines three calendars into one whose business days are the union or intersection of theirs, per the given rule.
qlJointCalendar3 :: (Calendar) -> (Calendar) -> (Calendar) -> (JointCalendarRule) -> IO ((Calendar))
qlJointCalendar3 a1 a2 a3 a4 =
  withCalendar a1 $ \a1' -> 
  withCalendar a2 $ \a2' -> 
  withCalendar a3 $ \a3' -> 
  let {a4' = fromEnumC a4} in 
  preErrorCheck $ \a5' -> 
  qlJointCalendar3'_ a1' a2' a3' a4' a5' >>= \res ->
  peekCalendar res >>= \res' ->
  errorCheck  a5'>>
  return (res')

{-# LINE 95 "./QuantLib/Time/Calendar.chs" #-}


-- |Combines two calendars into one whose business days are the union or intersection of theirs, per the given rule.
qlJointCalendar2 :: (Calendar) -> (Calendar) -> (JointCalendarRule) -> IO ((Calendar))
qlJointCalendar2 a1 a2 a3 =
  withCalendar a1 $ \a1' -> 
  withCalendar a2 $ \a2' -> 
  let {a3' = fromEnumC a3} in 
  preErrorCheck $ \a4' -> 
  qlJointCalendar2'_ a1' a2' a3' a4' >>= \res ->
  peekCalendar res >>= \res' ->
  errorCheck  a4'>>
  return (res')

{-# LINE 98 "./QuantLib/Time/Calendar.chs" #-}


-- |Combines four calendars into one whose business days are the union or intersection of theirs, per the given rule.
qlJointCalendar4 :: (Calendar) -> (Calendar) -> (Calendar) -> (Calendar) -> (JointCalendarRule) -> IO ((Calendar))
qlJointCalendar4 a1 a2 a3 a4 a5 =
  withCalendar a1 $ \a1' -> 
  withCalendar a2 $ \a2' -> 
  withCalendar a3 $ \a3' -> 
  withCalendar a4 $ \a4' -> 
  let {a5' = fromEnumC a5} in 
  preErrorCheck $ \a6' -> 
  qlJointCalendar4'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  peekCalendar res >>= \res' ->
  errorCheck  a6'>>
  return (res')

{-# LINE 101 "./QuantLib/Time/Calendar.chs" #-}


-- |Returns the holidays between two dates.
holidays :: (Calendar) -> (Day) -- ^from
 -> (Day) -- ^to
 -> (Bool) -- ^includeWeekEnds
 -> IO (([Day]))
holidays a1 a2 a3 a4 =
  withCalendar a1 $ \a1' -> 
  withDay a2 $ \a2' -> 
  withDay a3 $ \a3' -> 
  let {a4' = C2HSImp.fromBool a4} in 
  preArray $ \(a5'1, a5'2) -> 
  preErrorCheck $ \a6' -> 
  holidays'_ a1' a2' a3' a4' a5'1  a5'2 a6' >>
  peekDayArray  a5'1  a5'2>>= \a5'' -> 
  errorCheck  a6'>>
  return (a5'')

{-# LINE 107 "./QuantLib/Time/Calendar.chs" #-}


-- The name of a QuantLib object is fixed for its lifetime, so materializing one through
-- unsafePerformIO during Read is as safe as showStandalone's own use of it above; NOINLINE
-- keeps GHC from duplicating or floating the C++ call, same reasoning as showStandalone's.
unsafeCalendar :: CalendarConstructor -> Calendar
unsafeCalendar = unsafePerformIO . calendar
{-# NOINLINE unsafeCalendar #-}

-- Hand-written, not `deriving`/TH-spliced: CalendarConstructor's Joint2/3/4 cases carry live
-- Calendar fields, which have no Read instance of their own (see
-- QuantLib.Internal.Syntax.deriveReadPlain's comment for why the generated part -- covering
-- everything except these three -- has to be spliced back in CalendarEnum.chs instead of
-- here). Each alternative below parses a nested CalendarConstructor and materializes it with
-- `calendar`, exactly what a caller passing a literal Joint2/3/4 value would already do.
instance Read CalendarConstructor where
  readsPrec :: Int -> ReadS CalendarConstructor
readsPrec Int
d String
r = Int -> ReadS CalendarConstructor
readCalendarConstructorPlain Int
d String
r
    [(CalendarConstructor, String)]
-> [(CalendarConstructor, String)]
-> [(CalendarConstructor, String)]
forall a. [a] -> [a] -> [a]
++ Bool -> ReadS CalendarConstructor -> ReadS CalendarConstructor
forall a. Bool -> ReadS a -> ReadS a
readParen (Int
d Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
10) (\String
r' ->
         [ (Calendar -> Calendar -> JointCalendarRule -> CalendarConstructor
Joint2 Calendar
c1 Calendar
c2 JointCalendarRule
rule, String
s3)
         | (String
"Joint2", String
s0) <- ReadS String
lex String
r'
         , (CalendarConstructor
p1, String
s1) <- Int -> ReadS CalendarConstructor
forall a. Read a => Int -> ReadS a
readsPrec Int
11 String
s0, let c1 :: Calendar
c1 = CalendarConstructor -> Calendar
unsafeCalendar CalendarConstructor
p1
         , (CalendarConstructor
p2, String
s2) <- Int -> ReadS CalendarConstructor
forall a. Read a => Int -> ReadS a
readsPrec Int
11 String
s1, let c2 :: Calendar
c2 = CalendarConstructor -> Calendar
unsafeCalendar CalendarConstructor
p2
         , (JointCalendarRule
rule, String
s3) <- Int -> ReadS JointCalendarRule
forall a. Read a => Int -> ReadS a
readsPrec Int
11 String
s2
         ]) String
r
    [(CalendarConstructor, String)]
-> [(CalendarConstructor, String)]
-> [(CalendarConstructor, String)]
forall a. [a] -> [a] -> [a]
++ Bool -> ReadS CalendarConstructor -> ReadS CalendarConstructor
forall a. Bool -> ReadS a -> ReadS a
readParen (Int
d Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
10) (\String
r' ->
         [ (Calendar
-> Calendar -> Calendar -> JointCalendarRule -> CalendarConstructor
Joint3 Calendar
c1 Calendar
c2 Calendar
c3 JointCalendarRule
rule, String
s4)
         | (String
"Joint3", String
s0) <- ReadS String
lex String
r'
         , (CalendarConstructor
p1, String
s1) <- Int -> ReadS CalendarConstructor
forall a. Read a => Int -> ReadS a
readsPrec Int
11 String
s0, let c1 :: Calendar
c1 = CalendarConstructor -> Calendar
unsafeCalendar CalendarConstructor
p1
         , (CalendarConstructor
p2, String
s2) <- Int -> ReadS CalendarConstructor
forall a. Read a => Int -> ReadS a
readsPrec Int
11 String
s1, let c2 :: Calendar
c2 = CalendarConstructor -> Calendar
unsafeCalendar CalendarConstructor
p2
         , (CalendarConstructor
p3, String
s3) <- Int -> ReadS CalendarConstructor
forall a. Read a => Int -> ReadS a
readsPrec Int
11 String
s2, let c3 :: Calendar
c3 = CalendarConstructor -> Calendar
unsafeCalendar CalendarConstructor
p3
         , (JointCalendarRule
rule, String
s4) <- Int -> ReadS JointCalendarRule
forall a. Read a => Int -> ReadS a
readsPrec Int
11 String
s3
         ]) String
r
    [(CalendarConstructor, String)]
-> [(CalendarConstructor, String)]
-> [(CalendarConstructor, String)]
forall a. [a] -> [a] -> [a]
++ Bool -> ReadS CalendarConstructor -> ReadS CalendarConstructor
forall a. Bool -> ReadS a -> ReadS a
readParen (Int
d Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
10) (\String
r' ->
         [ (Calendar
-> Calendar
-> Calendar
-> Calendar
-> JointCalendarRule
-> CalendarConstructor
Joint4 Calendar
c1 Calendar
c2 Calendar
c3 Calendar
c4 JointCalendarRule
rule, String
s5)
         | (String
"Joint4", String
s0) <- ReadS String
lex String
r'
         , (CalendarConstructor
p1, String
s1) <- Int -> ReadS CalendarConstructor
forall a. Read a => Int -> ReadS a
readsPrec Int
11 String
s0, let c1 :: Calendar
c1 = CalendarConstructor -> Calendar
unsafeCalendar CalendarConstructor
p1
         , (CalendarConstructor
p2, String
s2) <- Int -> ReadS CalendarConstructor
forall a. Read a => Int -> ReadS a
readsPrec Int
11 String
s1, let c2 :: Calendar
c2 = CalendarConstructor -> Calendar
unsafeCalendar CalendarConstructor
p2
         , (CalendarConstructor
p3, String
s3) <- Int -> ReadS CalendarConstructor
forall a. Read a => Int -> ReadS a
readsPrec Int
11 String
s2, let c3 :: Calendar
c3 = CalendarConstructor -> Calendar
unsafeCalendar CalendarConstructor
p3
         , (CalendarConstructor
p4, String
s4) <- Int -> ReadS CalendarConstructor
forall a. Read a => Int -> ReadS a
readsPrec Int
11 String
s3, let c4 :: Calendar
c4 = CalendarConstructor -> Calendar
unsafeCalendar CalendarConstructor
p4
         , (JointCalendarRule
rule, String
s5) <- Int -> ReadS JointCalendarRule
forall a. Read a => Int -> ReadS a
readsPrec Int
11 String
s4
         ]) String
r

-- vim: set ff=unix ts=8 sts=2 sw=2 et:

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlCalendar"
  qlCalendar'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCalendar))))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlCalendarAdjust"
  adjust'_ :: ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt)))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlCalendarAdvance"
  advance'_ :: ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt))))))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlCalendarAddHoliday"
  addHoliday'_ :: ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlCalendarBusinessDaysBetween"
  businessDaysBetween'_ :: ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt)))))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlCalendarEndOfMonth"
  endOfMonth'_ :: ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlCalendarIsBusinessDay"
  isBusinessDay'_ :: ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlCalendarIsEndOfMonth"
  isEndOfMonth'_ :: ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlCalendarIsHoliday"
  isHoliday'_ :: ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlCalendarIsWeekend"
  isWeekend'_ :: ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlCalendarRemoveHoliday"
  removeHoliday'_ :: ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlBespokeCalendar"
  qlBespokeCalendar'_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCalendar)))))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlJointCalendar3"
  qlJointCalendar3'_ :: ((C2HSImp.Ptr (CCalendar)) -> ((C2HSImp.Ptr (CCalendar)) -> ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCalendar))))))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlJointCalendar2"
  qlJointCalendar2'_ :: ((C2HSImp.Ptr (CCalendar)) -> ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCalendar)))))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlJointCalendar4"
  qlJointCalendar4'_ :: ((C2HSImp.Ptr (CCalendar)) -> ((C2HSImp.Ptr (CCalendar)) -> ((C2HSImp.Ptr (CCalendar)) -> ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCalendar)))))))))

foreign import ccall safe "QuantLib/Time/Calendar.chs.h qlCalendarHolidayList"
  holidays'_ :: ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))))))