{-# LINE 1 "./QuantLib/CashFlow.chs" #-}
{-# LANGUAGE TemplateHaskell, FlexibleInstances #-}
module QuantLib.CashFlow
(
GenCashFlow
, CashFlow
, GenCoupon
, Coupon
, GenFloatingRateCoupon
, FloatingRateCoupon
, GenDigitalCoupon
, DigitalCoupon
, GenIndexedCashFlow
, IndexedCashFlow
, FixedRateCoupon
, IborCoupon
, AverageBMACoupon
, StrippedCappedFlooredCoupon
, CmsCoupon
, DigitalCmsCoupon
, DigitalCmsSpreadCoupon
, MultipleResetsCoupon
, OvernightIndexedCoupon
, RangeAccrualFloatersCoupon
, CPICoupon
, YoYInflationCoupon
, ZeroInflationCashFlow
, CPICashFlow
, EquityCashFlow
, Dividend
, GenLeg
, Leg
, CouponLeg
, GenFloatingRateCouponPricer
, FloatingRateCouponPricer
, CmsCouponPricer
, CPICouponPricer
, YoYInflationCouponPricer
, EquityCashFlowPricer
, DurationType(..)
, RateAveragingType(..)
, TimingAdjustment(..)
, PositionType(..)
, CPIInterpolationType(..)
, YieldCurveModel(..)
, Discounting(..)
, BpsDiscounting(..)
, ReplicationType(..)
, DigitalReplication
, LinearTsrPricerStrategy(..)
, LinearTsrPricerSettings(..)
, IborLegOpts(..)
, defaultIborLegOpts
, CmsLegOpts(..)
, defaultCmsLegOpts
, DigitalIborLegOpts(..)
, defaultDigitalIborLegOpts
, DigitalCmsLegOpts(..)
, defaultDigitalCmsLegOpts
, DigitalCmsSpreadLegOpts(..)
, defaultDigitalCmsSpreadLegOpts
, MultipleResetsLegOpts(..)
, defaultMultipleResetsLegOpts
, asLeg
, asCashFlow
, asCoupon
, asFloatingRateCoupon
, asFloatingRateCouponPricer
, toCouponLeg
, leg
, cashFlowLeg
, simpleCashFlow
, indexedCashFlow
, redemption
, amortizingPayment
, fixedRateCoupon
, floatingRateCoupon
, iborCoupon
, averageBmaCoupon
, cappedFlooredCoupon
, strippedCappedFlooredCoupon
, cappedFlooredIborCoupon
, digitalIborCoupon
, digitalCoupon
, multipleResetsCoupon
, rangeAccrualFloatersCoupon
, overnightIndexedCoupon
, cappedFlooredOvernightIndexedCoupon
, cpiCoupon
, cpiCouponFromBaseDate
, cpiCouponWithBaseDate
, yoyInflationCoupon
, zeroInflationCashFlow
, cpiCashFlow
, equityCashFlow
, cmsCoupon
, cappedFlooredCmsCoupon
, cmsSpreadCoupon
, cappedFlooredCmsSpreadCoupon
, digitalReplication
, digitalCmsCoupon
, digitalCmsSpreadCoupon
, fixedDividend
, fractionalDividendWithNominal
, fractionalDividend
, fixedRateLeg
, averageBmaLeg
, iborLeg
, iborLegWithOptions
, digitalIborLeg
, cmsLeg
, cmsLegWithOptions
, cmsSpreadLeg
, digitalCmsLeg
, digitalCmsSpreadLeg
, multipleResetsLeg
, overnightLeg
, rangeAccrualLeg
, cpiLeg
, yoyInflationLeg
, blackIborCouponPricer
, blackIborQuantoCouponPricer
, analyticHaganPricer
, numericHaganPricer
, linearTsrPricer
, lognormalCmsSpreadPricer
, rangeAccrualPricerByBgm
, averagingMultipleResetsPricer
, compoundingMultipleResetsPricer
, compoundingOvernightIndexedCouponPricer
, arithmeticAveragedOvernightIndexedCouponPricer
, blackCompoundingOvernightIndexedCouponPricer
, blackAveragingOvernightIndexedCouponPricer
, cpiCouponPricer
, cpiCouponPricerWithVol
, blackYoyInflationCouponPricer
, unitDisplacedBlackYoyInflationCouponPricer
, bachelierYoyInflationCouponPricer
, equityQuantoCashFlowPricer
, setCpiCouponPricer
, setFloatingRateCouponPricer
, setYoyInflationCouponPricer
, setEquityCashFlowPricer
, setCouponPricer
, setCouponPricers
, setEquityLegPricer
, HasFixingDates(..)
, fixingDependencies
, HasIndexFixings(..)
, baseFixing
, indexFixing
, adjustedFixing
, amount
, date
, duration
, accrualDays
, accrualEndDate
, accrualPeriod
, accrualStartDate
, accruedAmount
, accruedDays
, accruedPeriod
, atmRate
, basisPointValue
, bps
, convexity
, isExpired
, maturityDate
, startDate
, cashFlows
, nextCashFlows
, nextCashFlowAmount
, nextCashFlowDate
, nextCouponRate
, previousCashFlows
, previousCashFlowAmount
, previousCashFlowDate
, previousCouponRate
, nominal
, npv
, npvBps
, referencePeriodEnd
, referencePeriodStart
, yield
, yieldValueBasisPoint
, zSpread
, coupons
, couponAccrualStartDates
, couponAccruedAmount
, rate
, price
, interestRate
, indexRatio
, convexityAdjustment
, swapletRate
, swapletPrice
, capletPrice
, capletRate
, floorletPrice
, floorletRate
, replicationType
, gap
, capRate
, floorRate
, effectiveCap
, effectiveFloor
, isCap
, isFloor
, isCollar
, callOptionRate
, putOptionRate
, priceWithoutOptionality
) where
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 qualified System.IO.Unsafe as C2HSImp
import QuantLib.Internal
import QuantLib.InterestRate(Compounding, VolatilityType)
import QuantLib.Time.Schedule(Frequency)
import QuantLib.Time.Calendar(calendar, CalendarConstructor(..))
import QuantLib.Internal.Type
import QuantLib.Internal.Common
import QuantLib.Internal.Syntax(deriveOptionsRecord)
import Data.Maybe(fromMaybe)
import Data.List.NonEmpty(NonEmpty(..), toList)
{-# LINE 261 "./QuantLib/CashFlow.chs" #-}
{-# LINE 262 "./QuantLib/CashFlow.chs" #-}
{-# LINE 263 "./QuantLib/CashFlow.chs" #-}
{-# LINE 264 "./QuantLib/CashFlow.chs" #-}
{-# LINE 265 "./QuantLib/CashFlow.chs" #-}
{-# LINE 266 "./QuantLib/CashFlow.chs" #-}
{-# LINE 267 "./QuantLib/CashFlow.chs" #-}
{-# LINE 268 "./QuantLib/CashFlow.chs" #-}
{-# LINE 269 "./QuantLib/CashFlow.chs" #-}
{-# LINE 270 "./QuantLib/CashFlow.chs" #-}
{-# LINE 271 "./QuantLib/CashFlow.chs" #-}
{-# LINE 272 "./QuantLib/CashFlow.chs" #-}
{-# LINE 273 "./QuantLib/CashFlow.chs" #-}
{-# LINE 274 "./QuantLib/CashFlow.chs" #-}
{-# LINE 275 "./QuantLib/CashFlow.chs" #-}
{-# LINE 276 "./QuantLib/CashFlow.chs" #-}
{-# LINE 277 "./QuantLib/CashFlow.chs" #-}
{-# LINE 278 "./QuantLib/CashFlow.chs" #-}
{-# LINE 279 "./QuantLib/CashFlow.chs" #-}
{-# LINE 280 "./QuantLib/CashFlow.chs" #-}
{-# LINE 281 "./QuantLib/CashFlow.chs" #-}
{-# LINE 282 "./QuantLib/CashFlow.chs" #-}
{-# LINE 283 "./QuantLib/CashFlow.chs" #-}
{-# LINE 284 "./QuantLib/CashFlow.chs" #-}
{-# LINE 285 "./QuantLib/CashFlow.chs" #-}
{-# LINE 286 "./QuantLib/CashFlow.chs" #-}
{-# LINE 287 "./QuantLib/CashFlow.chs" #-}
{-# LINE 288 "./QuantLib/CashFlow.chs" #-}
{-# LINE 289 "./QuantLib/CashFlow.chs" #-}
{-# LINE 290 "./QuantLib/CashFlow.chs" #-}
{-# LINE 291 "./QuantLib/CashFlow.chs" #-}
{-# LINE 292 "./QuantLib/CashFlow.chs" #-}
{-# LINE 293 "./QuantLib/CashFlow.chs" #-}
{-# LINE 294 "./QuantLib/CashFlow.chs" #-}
{-# LINE 295 "./QuantLib/CashFlow.chs" #-}
{-# LINE 296 "./QuantLib/CashFlow.chs" #-}
{-# LINE 297 "./QuantLib/CashFlow.chs" #-}
{-# LINE 298 "./QuantLib/CashFlow.chs" #-}
{-# LINE 299 "./QuantLib/CashFlow.chs" #-}
{-# LINE 300 "./QuantLib/CashFlow.chs" #-}
{-# LINE 301 "./QuantLib/CashFlow.chs" #-}
{-# LINE 302 "./QuantLib/CashFlow.chs" #-}
{-# LINE 303 "./QuantLib/CashFlow.chs" #-}
{-# LINE 304 "./QuantLib/CashFlow.chs" #-}
{-# LINE 305 "./QuantLib/CashFlow.chs" #-}
{-# LINE 306 "./QuantLib/CashFlow.chs" #-}
{-# LINE 307 "./QuantLib/CashFlow.chs" #-}
{-# LINE 308 "./QuantLib/CashFlow.chs" #-}
data DurationType = Simple
| Macaulay
| Modified
deriving (Enum,Show,Eq,Read)
{-# LINE 310 "./QuantLib/CashFlow.chs" #-}
data RateAveragingType = AveragingSimple
| AveragingCompound
deriving (Enum,Show,Eq,Read)
{-# LINE 311 "./QuantLib/CashFlow.chs" #-}
data TimingAdjustment = Black76
| BivariateLognormal
deriving (Enum,Show,Eq,Read)
{-# LINE 312 "./QuantLib/CashFlow.chs" #-}
data YieldCurveModel = Standard
| ExactYield
| ParallelShifts
| NonParallelShifts
deriving (Int -> YieldCurveModel
Int -> ReplicationType -> ShowS
[ReplicationType] -> ShowS
ReplicationType -> String
YieldCurveModel -> Int
YieldCurveModel -> [YieldCurveModel]
YieldCurveModel -> YieldCurveModel
YieldCurveModel -> YieldCurveModel -> [YieldCurveModel]
YieldCurveModel
-> YieldCurveModel -> YieldCurveModel -> [YieldCurveModel]
(Int -> ReplicationType -> ShowS)
-> (ReplicationType -> String)
-> ([ReplicationType] -> ShowS)
-> Show ReplicationType
(YieldCurveModel -> YieldCurveModel)
-> (YieldCurveModel -> YieldCurveModel)
-> (Int -> YieldCurveModel)
-> (YieldCurveModel -> Int)
-> (YieldCurveModel -> [YieldCurveModel])
-> (YieldCurveModel -> YieldCurveModel -> [YieldCurveModel])
-> (YieldCurveModel -> YieldCurveModel -> [YieldCurveModel])
-> (YieldCurveModel
-> YieldCurveModel -> YieldCurveModel -> [YieldCurveModel])
-> Enum YieldCurveModel
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ReplicationType -> ShowS
showsPrec :: Int -> ReplicationType -> ShowS
$cshow :: ReplicationType -> String
show :: ReplicationType -> String
$cshowList :: [ReplicationType] -> ShowS
showList :: [ReplicationType] -> ShowS
$csucc :: YieldCurveModel -> YieldCurveModel
succ :: YieldCurveModel -> YieldCurveModel
$cpred :: YieldCurveModel -> YieldCurveModel
pred :: YieldCurveModel -> YieldCurveModel
$ctoEnum :: Int -> YieldCurveModel
toEnum :: Int -> YieldCurveModel
$cfromEnum :: YieldCurveModel -> Int
fromEnum :: YieldCurveModel -> Int
$cenumFrom :: YieldCurveModel -> [YieldCurveModel]
enumFrom :: YieldCurveModel -> [YieldCurveModel]
$cenumFromThen :: YieldCurveModel -> YieldCurveModel -> [YieldCurveModel]
enumFromThen :: YieldCurveModel -> YieldCurveModel -> [YieldCurveModel]
$cenumFromTo :: YieldCurveModel -> YieldCurveModel -> [YieldCurveModel]
enumFromTo :: YieldCurveModel -> YieldCurveModel -> [YieldCurveModel]
$cenumFromThenTo :: YieldCurveModel
-> YieldCurveModel -> YieldCurveModel -> [YieldCurveModel]
enumFromThenTo :: YieldCurveModel
-> YieldCurveModel -> YieldCurveModel -> [YieldCurveModel]
Enum,Int -> YieldCurveModel -> ShowS
[YieldCurveModel] -> ShowS
YieldCurveModel -> String
(Int -> YieldCurveModel -> ShowS)
-> (YieldCurveModel -> String)
-> ([YieldCurveModel] -> ShowS)
-> Show YieldCurveModel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> YieldCurveModel -> ShowS
showsPrec :: Int -> YieldCurveModel -> ShowS
$cshow :: YieldCurveModel -> String
show :: YieldCurveModel -> String
$cshowList :: [YieldCurveModel] -> ShowS
showList :: [YieldCurveModel] -> ShowS
Show,Eq,ReadPrec [YieldCurveModel]
ReadPrec YieldCurveModel
Int -> ReadS YieldCurveModel
ReadS [YieldCurveModel]
(Int -> ReadS YieldCurveModel)
-> ReadS [YieldCurveModel]
-> ReadPrec YieldCurveModel
-> ReadPrec [YieldCurveModel]
-> Read YieldCurveModel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS YieldCurveModel
readsPrec :: Int -> ReadS YieldCurveModel
$creadList :: ReadS [YieldCurveModel]
readList :: ReadS [YieldCurveModel]
$creadPrec :: ReadPrec YieldCurveModel
readPrec :: ReadPrec YieldCurveModel
$creadListPrec :: ReadPrec [YieldCurveModel]
readListPrec :: ReadPrec [YieldCurveModel]
Read)
{-# LINE 313 "./QuantLib/CashFlow.chs" #-}
data ReplicationType = ReplicationSub
| ReplicationCentral
| ReplicationSuper
deriving (Show,Eq,Read)
instance Enum ReplicationType where
succ ReplicationSub = ReplicationCentral
succ ReplicationCentral = ReplicationSuper
succ ReplicationSuper = error "ReplicationType.succ: ReplicationSuper has no successor"
pred ReplicationCentral = ReplicationSub
pred ReplicationSuper = ReplicationCentral
pred ReplicationSub = error "ReplicationType.pred: ReplicationSub has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from ReplicationSuper
fromEnum ReplicationSub = 0
fromEnum ReplicationCentral = 1
fromEnum ReplicationSuper = 2
toEnum 0 = ReplicationSub
toEnum 1 = ReplicationCentral
toEnum 2 = ReplicationSuper
toEnum unmatched = error ("ReplicationType.toEnum: Cannot match " ++ show unmatched)
{-# LINE 314 "./QuantLib/CashFlow.chs" #-}
$(deriveOptionsRecord "IborLegOpts" []
[ ("ilgPaymentLag", [t|Int|], [|0|])
, ("ilgPaymentCalendar", [t|Maybe Calendar|], [|Nothing|])
, ("ilgExCouponPeriod", [t|(Int, TimeUnit)|], [|(0, Days)|])
, ("ilgExCouponCalendar", [t|Maybe Calendar|], [|Nothing|])
, ("ilgExCouponConvention", [t|BusinessDayConvention|], [|Unadjusted|])
, ("ilgExCouponEndOfMonth", [t|Bool|], [|False|])
, ("ilgFixingConvention", [t|BusinessDayConvention|], [|Preceding|])
, ("ilgUseIndexedCoupons", [t|Maybe Bool|], [|Nothing|])
])
$(deriveOptionsRecord "CmsLegOpts" []
[ ("cmslExCouponPeriod", [t|(Int, TimeUnit)|], [|(0, Days)|])
, ("cmslExCouponCalendar", [t|Maybe Calendar|], [|Nothing|])
, ("cmslExCouponConvention", [t|BusinessDayConvention|], [|Unadjusted|])
, ("cmslExCouponEndOfMonth", [t|Bool|], [|False|])
, ("cmslFixingConvention", [t|BusinessDayConvention|], [|Preceding|])
])
$(deriveOptionsRecord "DigitalCmsLegOpts" []
[ ("dcmlCallStrikes", [t|[Double]|], [|[]|])
, ("dcmlCallPosition", [t|PositionType|], [|Long|])
, ("dcmlCallAtm", [t|Bool|], [|False|])
, ("dcmlCallPayoffs", [t|[Double]|], [|[]|])
, ("dcmlPutStrikes", [t|[Double]|], [|[]|])
, ("dcmlPutPosition", [t|PositionType|], [|Long|])
, ("dcmlPutAtm", [t|Bool|], [|False|])
, ("dcmlPutPayoffs", [t|[Double]|], [|[]|])
, ("dcmlReplication", [t|Maybe DigitalReplication|], [|Nothing|])
, ("dcmlNakedOption", [t|Bool|], [|False|])
])
$(deriveOptionsRecord "DigitalCmsSpreadLegOpts" []
[ ("dcmslCallStrikes", [t|[Double]|], [|[]|])
, ("dcmslCallPosition", [t|PositionType|], [|Long|])
, ("dcmslCallAtm", [t|Bool|], [|False|])
, ("dcmslCallPayoffs", [t|[Double]|], [|[]|])
, ("dcmslPutStrikes", [t|[Double]|], [|[]|])
, ("dcmslPutPosition", [t|PositionType|], [|Long|])
, ("dcmslPutAtm", [t|Bool|], [|False|])
, ("dcmslPutPayoffs", [t|[Double]|], [|[]|])
, ("dcmslReplication", [t|Maybe DigitalReplication|], [|Nothing|])
, ("dcmslNakedOption", [t|Bool|], [|False|])
])
$(deriveOptionsRecord "DigitalIborLegOpts" []
[ ("dilCallStrikes", [t|[Double]|], [|[]|]), ("dilCallPosition", [t|PositionType|], [|Long|]), ("dilCallAtm", [t|Bool|], [|False|]), ("dilCallPayoffs", [t|[Double]|], [|[]|])
, ("dilPutStrikes", [t|[Double]|], [|[]|]), ("dilPutPosition", [t|PositionType|], [|Long|]), ("dilPutAtm", [t|Bool|], [|False|]), ("dilPutPayoffs", [t|[Double]|], [|[]|])
, ("dilReplication", [t|Maybe DigitalReplication|], [|Nothing|]), ("dilNakedOption", [t|Bool|], [|False|]) ])
$(deriveOptionsRecord "MultipleResetsLegOpts" []
[ ("mrlNotionals", [t|NonEmpty Double|], [|1.0 :| []|]), ("mrlPaymentCalendar", [t|Maybe Calendar|], [|Nothing|]), ("mrlPaymentLag", [t|Int|], [|0|]), ("mrlFixingDays", [t|[Word]|], [|[]|]), ("mrlGearings", [t|[Double]|], [|[]|]), ("mrlCouponSpreads", [t|[Double]|], [|[]|]), ("mrlRateSpreads", [t|[Double]|], [|[]|]), ("mrlExCouponPeriod", [t|(Int, TimeUnit)|], [|(0, Days)|]), ("mrlExCouponCalendar", [t|Maybe Calendar|], [|Nothing|]), ("mrlExCouponConvention", [t|BusinessDayConvention|], [|Unadjusted|]), ("mrlExCouponEndOfMonth", [t|Bool|], [|False|]), ("mrlAveragingMethod", [t|RateAveragingType|], [|AveragingCompound|]) ])
qlLeg :: ([Double]) -> ([Day]) -> IO ((Leg))
qlLeg :: [Double] -> [Day] -> IO Leg
qlLeg [Double]
a1 [Day]
a2 =
[Double] -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a1 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a1'1, Ptr CDouble
a1'2) ->
[Day] -> (Ptr CInt -> IO Leg) -> IO Leg
forall a. [Day] -> (Ptr CInt -> IO a) -> IO a
withDayPtr [Day]
a2 ((Ptr CInt -> IO Leg) -> IO Leg) -> (Ptr CInt -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr CInt
a2' ->
(Ptr (Ptr CChar) -> IO Leg) -> IO Leg
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Leg) -> IO Leg)
-> (Ptr (Ptr CChar) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a3' ->
CUInt
-> Ptr CDouble -> Ptr CInt -> Ptr (Ptr CChar) -> IO (Ptr CLeg')
qlLeg'_ CUInt
a1'1 Ptr CDouble
a1'2 Ptr CInt
a2' Ptr (Ptr CChar)
a3' IO (Ptr CLeg') -> (Ptr CLeg' -> IO Leg) -> IO Leg
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CLeg'
res ->
Ptr CLeg' -> IO Leg
peekLeg Ptr CLeg'
res IO Leg -> (Leg -> IO Leg) -> IO Leg
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Leg
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a3'IO () -> IO Leg -> IO Leg
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Leg -> IO Leg
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Leg
res')
{-# LINE 389 "./QuantLib/CashFlow.chs" #-}
leg :: [(Day, Double)]
-> IO Leg
leg f = qlLeg fs ds where (ds, fs) = unzip f
simpleCashFlow :: (Double)
-> (Day)
-> IO ((CashFlow))
simpleCashFlow :: Double -> Day -> IO CashFlow
simpleCashFlow Double
a1 Day
a2 =
let {a1' :: CDouble
a1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a1} in
Day -> (CInt -> IO CashFlow) -> IO CashFlow
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a2 ((CInt -> IO CashFlow) -> IO CashFlow)
-> (CInt -> IO CashFlow) -> IO CashFlow
forall a b. (a -> b) -> a -> b
$ \CInt
a2' ->
(Ptr (Ptr CChar) -> IO CashFlow) -> IO CashFlow
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO CashFlow) -> IO CashFlow)
-> (Ptr (Ptr CChar) -> IO CashFlow) -> IO CashFlow
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a3' ->
CDouble -> CInt -> Ptr (Ptr CChar) -> IO (Ptr CCashFlow')
simpleCashFlow'_ CDouble
a1' CInt
a2' Ptr (Ptr CChar)
a3' IO (Ptr CCashFlow')
-> (Ptr CCashFlow' -> IO CashFlow) -> IO CashFlow
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CCashFlow'
res ->
Ptr CCashFlow' -> IO CashFlow
peekCashFlow Ptr CCashFlow'
res IO CashFlow -> (CashFlow -> IO CashFlow) -> IO CashFlow
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CashFlow
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a3'IO () -> IO CashFlow -> IO CashFlow
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
CashFlow -> IO CashFlow
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (CashFlow
res')
{-# LINE 399 "./QuantLib/CashFlow.chs" #-}
amount :: (GenCashFlow cf)
-> IO ((Double))
amount a1 =
withCashFlow a1 $ \a1' ->
preErrorCheck $ \a2' ->
amount'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 403 "./QuantLib/CashFlow.chs" #-}
date :: (GenCashFlow cf)
-> (Day)
date a1 =
C2HSImp.unsafePerformIO $
withCashFlow a1 $ \a1' ->
date'_ a1' >>= \res ->
let {res' = toDay res} in
return (res')
{-# LINE 407 "./QuantLib/CashFlow.chs" #-}
indexedCashFlow :: (Double)
-> (GenIndex idx)
-> (Day)
-> (Day)
-> (Day)
-> (Bool)
-> IO ((IndexedCashFlow))
indexedCashFlow :: forall idx.
Double
-> GenIndex idx -> Day -> Day -> Day -> Bool -> IO IndexedCashFlow
indexedCashFlow Double
a1 GenIndex idx
a2 Day
a3 Day
a4 Day
a5 Bool
a6 =
let {a1' :: CDouble
a1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a1} in
GenIndex idx
-> (Ptr CIndex' -> IO IndexedCashFlow) -> IO IndexedCashFlow
forall idx b. GenIndex idx -> (Ptr CIndex' -> IO b) -> IO b
withIndex GenIndex idx
a2 ((Ptr CIndex' -> IO IndexedCashFlow) -> IO IndexedCashFlow)
-> (Ptr CIndex' -> IO IndexedCashFlow) -> IO IndexedCashFlow
forall a b. (a -> b) -> a -> b
$ \Ptr CIndex'
a2' ->
Day -> (CInt -> IO IndexedCashFlow) -> IO IndexedCashFlow
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a3 ((CInt -> IO IndexedCashFlow) -> IO IndexedCashFlow)
-> (CInt -> IO IndexedCashFlow) -> IO IndexedCashFlow
forall a b. (a -> b) -> a -> b
$ \a3' ->
withDay a4 $ \a4' ->
withDay a5 $ \a5' ->
let {a6' = C2HSImp.fromBool a6} in
preErrorCheck $ \a7' ->
indexedCashFlow'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekIndexedCashFlow res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 419 "./QuantLib/CashFlow.chs" #-}
baseFixing :: (GenIndexedCashFlow icf) -> IO ((Double))
baseFixing a1 =
withIndexedCashFlow a1 $ \a1' ->
preErrorCheck $ \a2' ->
baseFixing'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 423 "./QuantLib/CashFlow.chs" #-}
indexFixing :: (GenIndexedCashFlow icf) -> IO ((Double))
indexFixing a1 =
withIndexedCashFlow a1 $ \a1' ->
preErrorCheck $ \a2' ->
indexFixing'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 427 "./QuantLib/CashFlow.chs" #-}
fixedRateCoupon :: (Day)
-> (Double)
-> (Double)
-> (DayCounter)
-> (Day)
-> (Day)
-> (Maybe Day)
-> (Maybe Day)
-> (Maybe Day)
-> IO ((FixedRateCoupon))
fixedRateCoupon :: Day
-> Double
-> Double
-> DayCounter
-> Day
-> Day
-> Maybe Day
-> Maybe Day
-> Maybe Day
-> IO FixedRateCoupon
fixedRateCoupon Day
a1 Double
a2 Double
a3 DayCounter
a4 Day
a5 Day
a6 Maybe Day
a7 Maybe Day
a8 Maybe Day
a9 =
Day -> (CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a1 ((CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon)
-> (CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in
DayCounter
-> (Ptr CDayCounter -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter DayCounter
a4 ((Ptr CDayCounter -> IO FixedRateCoupon) -> IO FixedRateCoupon)
-> (Ptr CDayCounter -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CDayCounter
a4' ->
Day -> (CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a5 ((CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon)
-> (CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a5' ->
Day -> (CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a6 ((CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon)
-> (CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a6' ->
Maybe Day -> (CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a7 ((CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon)
-> (CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a7' ->
Maybe Day -> (CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a8 ((CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon)
-> (CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a8' ->
Maybe Day -> (CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a9 ((CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon)
-> (CInt -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a9' ->
(Ptr (Ptr CChar) -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO FixedRateCoupon) -> IO FixedRateCoupon)
-> (Ptr (Ptr CChar) -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a10' ->
CInt
-> CDouble
-> CDouble
-> Ptr CDayCounter
-> CInt
-> CInt
-> CInt
-> CInt
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CFixedRateCoupon')
fixedRateCoupon'_ CInt
a1' CDouble
a2' CDouble
a3' Ptr CDayCounter
a4' CInt
a5' CInt
a6' CInt
a7' CInt
a8' CInt
a9' Ptr (Ptr CChar)
a10' IO (Ptr CFixedRateCoupon')
-> (Ptr CFixedRateCoupon' -> IO FixedRateCoupon)
-> IO FixedRateCoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CFixedRateCoupon'
res ->
Ptr CFixedRateCoupon' -> IO FixedRateCoupon
peekFixedRateCoupon Ptr CFixedRateCoupon'
res IO FixedRateCoupon
-> (FixedRateCoupon -> IO FixedRateCoupon) -> IO FixedRateCoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \FixedRateCoupon
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a10'IO () -> IO FixedRateCoupon -> IO FixedRateCoupon
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
FixedRateCoupon -> IO FixedRateCoupon
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (FixedRateCoupon
res')
{-# LINE 442 "./QuantLib/CashFlow.chs" #-}
interestRate :: (FixedRateCoupon) -> IO ((InterestRate))
interestRate a1 =
withFixedRateCoupon a1 $ \a1' ->
interestRate'_ a1' >>= \res ->
peekInterestRate res >>= \res' ->
return (res')
{-# LINE 447 "./QuantLib/CashFlow.chs" #-}
floatingRateCoupon :: (Day)
-> (Double)
-> (Day)
-> (Day)
-> (Word)
-> (GenInterestRateIndex ridx)
-> (Double)
-> (Double)
-> (Maybe Day)
-> (Maybe Day)
-> (DayCounter)
-> (Bool)
-> (Maybe Day)
-> (BusinessDayConvention)
-> IO ((FloatingRateCoupon))
floatingRateCoupon :: forall ridx.
Day
-> Double
-> Day
-> Day
-> Word
-> GenInterestRateIndex ridx
-> Double
-> Double
-> Maybe Day
-> Maybe Day
-> DayCounter
-> Bool
-> Maybe Day
-> BusinessDayConvention
-> IO FloatingRateCoupon
floatingRateCoupon Day
a1 Double
a2 Day
a3 Day
a4 Word
a5 GenInterestRateIndex ridx
a6 Double
a7 Double
a8 Maybe Day
a9 Maybe Day
a10 DayCounter
a11 Bool
a12 Maybe Day
a13 BusinessDayConvention
a14 =
Day -> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a1 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
Day -> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a3 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a3' ->
Day -> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a4 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a4' ->
let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in
GenInterestRateIndex ridx
-> (Ptr CInterestRateIndex' -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall ridx b.
GenInterestRateIndex ridx
-> (Ptr CInterestRateIndex' -> IO b) -> IO b
withInterestRateIndex GenInterestRateIndex ridx
a6 ((Ptr CInterestRateIndex' -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon)
-> (Ptr CInterestRateIndex' -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CInterestRateIndex'
a6' ->
let {a7' :: CDouble
a7' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a7} in
let {a8' :: CDouble
a8' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a8} in
Maybe Day
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a9 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a9' ->
Maybe Day
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a10 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a10' ->
DayCounter
-> (Ptr CDayCounter -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter DayCounter
a11 ((Ptr CDayCounter -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon)
-> (Ptr CDayCounter -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CDayCounter
a11' ->
let {a12' :: CInt
a12' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a12} in
Maybe Day
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a13 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a13' ->
let {a14' :: CInt
a14' = BusinessDayConvention -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC BusinessDayConvention
a14} in
(Ptr (Ptr CChar) -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon)
-> (Ptr (Ptr CChar) -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a15' ->
CInt
-> CDouble
-> CInt
-> CInt
-> CUInt
-> Ptr CInterestRateIndex'
-> CDouble
-> CDouble
-> CInt
-> CInt
-> Ptr CDayCounter
-> CInt
-> CInt
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CFloatingRateCoupon')
floatingRateCoupon'_ CInt
a1' CDouble
a2' CInt
a3' CInt
a4' CUInt
a5' Ptr CInterestRateIndex'
a6' CDouble
a7' CDouble
a8' CInt
a9' CInt
a10' Ptr CDayCounter
a11' CInt
a12' CInt
a13' CInt
a14' Ptr (Ptr CChar)
a15' IO (Ptr CFloatingRateCoupon')
-> (Ptr CFloatingRateCoupon' -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CFloatingRateCoupon'
res ->
Ptr CFloatingRateCoupon' -> IO FloatingRateCoupon
peekFloatingRateCoupon Ptr CFloatingRateCoupon'
res IO FloatingRateCoupon
-> (FloatingRateCoupon -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \FloatingRateCoupon
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a15'IO () -> IO FloatingRateCoupon -> IO FloatingRateCoupon
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
FloatingRateCoupon -> IO FloatingRateCoupon
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (FloatingRateCoupon
res')
{-# LINE 466 "./QuantLib/CashFlow.chs" #-}
iborCoupon :: (Day)
-> (Double)
-> (Day)
-> (Day)
-> (Word)
-> (GenIborIndex ibor)
-> (Double)
-> (Double)
-> (Maybe Day)
-> (Maybe Day)
-> (DayCounter)
-> (Bool)
-> (Maybe Day)
-> (BusinessDayConvention)
-> IO ((IborCoupon))
iborCoupon a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 =
withDay a1 $ \a1' ->
let {a2' = realToFrac a2} in
withDay a3 $ \a3' ->
withDay a4 $ \a4' ->
let {a5' = fromIntegral a5} in
withIborIndex a6 $ \a6' ->
let {a7' = realToFrac a7} in
let {a8' = realToFrac a8} in
withMaybeDay a9 $ \a9' ->
withMaybeDay a10 $ \a10' ->
withDayCounter a11 $ \a11' ->
let {a12' = C2HSImp.fromBool a12} in
withMaybeDay a13 $ \a13' ->
let {a14' = fromEnumC a14} in
preErrorCheck $ \a15' ->
iborCoupon'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' a14' a15' >>= \res ->
peekIborCoupon res >>= \res' ->
errorCheck a15'>>
return (res')
{-# LINE 485 "./QuantLib/CashFlow.chs" #-}
averageBmaCoupon :: (Day)
-> (Double)
-> (Day)
-> (Day)
-> (BMAIndex)
-> (Double)
-> (Double)
-> (Maybe Day)
-> (Maybe Day)
-> (DayCounter)
-> IO ((AverageBMACoupon))
averageBmaCoupon a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 =
withDay a1 $ \a1' ->
let {a2' = realToFrac a2} in
withDay a3 $ \a3' ->
withDay a4 $ \a4' ->
withBMAIndex a5 $ \a5' ->
let {a6' = realToFrac a6} in
let {a7' = realToFrac a7} in
withMaybeDay a8 $ \a8' ->
withMaybeDay a9 $ \a9' ->
withDayCounter a10 $ \a10' ->
preErrorCheck $ \a11' ->
averageBmaCoupon'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' >>= \res ->
peekAverageBMACoupon res >>= \res' ->
errorCheck a11'>>
return (res')
{-# LINE 498 "./QuantLib/CashFlow.chs" #-}
averageBmaCouponFixingDatesRaw :: (AverageBMACoupon) -> IO (([Day]))
averageBmaCouponFixingDatesRaw a1 =
withAverageBMACoupon a1 $ \a1' ->
preArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
averageBmaCouponFixingDatesRaw'_ a1' a2'1 a2'2 a3' >>
peekDayArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 501 "./QuantLib/CashFlow.chs" #-}
averageBmaCouponIndexFixingsRaw :: (AverageBMACoupon) -> IO (([Double]))
averageBmaCouponIndexFixingsRaw a1 =
withAverageBMACoupon a1 $ \a1' ->
preArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
averageBmaCouponIndexFixingsRaw'_ a1' a2'1 a2'2 a3' >>
peekDoubleArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 504 "./QuantLib/CashFlow.chs" #-}
cappedFlooredCoupon :: (GenFloatingRateCoupon frc)
-> (Maybe Double)
-> (Maybe Double)
-> IO ((FloatingRateCoupon))
cappedFlooredCoupon a1 a2 a3 =
withFloatingRateCoupon a1 $ \a1' ->
let {a2' = fromMaybeDouble a2} in
let {a3' = fromMaybeDouble a3} in
preErrorCheck $ \a4' ->
cappedFlooredCoupon'_ a1' a2' a3' a4' >>= \res ->
peekFloatingRateCoupon res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 510 "./QuantLib/CashFlow.chs" #-}
strippedCappedFlooredCoupon :: (GenFloatingRateCoupon frc)
-> (Maybe Double)
-> (Maybe Double)
-> IO ((StrippedCappedFlooredCoupon))
strippedCappedFlooredCoupon a1 a2 a3 =
withFloatingRateCoupon a1 $ \a1' ->
let {a2' = fromMaybeDouble a2} in
let {a3' = fromMaybeDouble a3} in
preErrorCheck $ \a4' ->
strippedCappedFlooredCoupon'_ a1' a2' a3' a4' >>= \res ->
peekStrippedCappedFlooredCoupon res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 518 "./QuantLib/CashFlow.chs" #-}
capRate :: (StrippedCappedFlooredCoupon)
-> (Double)
capRate a1 =
C2HSImp.unsafePerformIO $
withStrippedCappedFlooredCoupon a1 $ \a1' ->
capRate'_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 523 "./QuantLib/CashFlow.chs" #-}
floorRate :: (StrippedCappedFlooredCoupon)
-> (Double)
floorRate a1 =
C2HSImp.unsafePerformIO $
withStrippedCappedFlooredCoupon a1 $ \a1' ->
floorRate'_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 528 "./QuantLib/CashFlow.chs" #-}
effectiveCap :: (StrippedCappedFlooredCoupon)
-> (Double)
effectiveCap a1 =
C2HSImp.unsafePerformIO $
withStrippedCappedFlooredCoupon a1 $ \a1' ->
effectiveCap'_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 533 "./QuantLib/CashFlow.chs" #-}
effectiveFloor :: (StrippedCappedFlooredCoupon)
-> (Double)
effectiveFloor a1 =
C2HSImp.unsafePerformIO $
withStrippedCappedFlooredCoupon a1 $ \a1' ->
effectiveFloor'_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 538 "./QuantLib/CashFlow.chs" #-}
isCap :: (StrippedCappedFlooredCoupon)
-> (Bool)
isCap a1 =
C2HSImp.unsafePerformIO $
withStrippedCappedFlooredCoupon a1 $ \a1' ->
isCap'_ a1' >>= \res ->
let {res' = C2HSImp.toBool res} in
return (res')
{-# LINE 542 "./QuantLib/CashFlow.chs" #-}
isFloor :: (StrippedCappedFlooredCoupon)
-> (Bool)
isFloor a1 =
C2HSImp.unsafePerformIO $
withStrippedCappedFlooredCoupon a1 $ \a1' ->
isFloor'_ a1' >>= \res ->
let {res' = C2HSImp.toBool res} in
return (res')
{-# LINE 546 "./QuantLib/CashFlow.chs" #-}
isCollar :: (StrippedCappedFlooredCoupon)
-> (Bool)
isCollar a1 =
C2HSImp.unsafePerformIO $
withStrippedCappedFlooredCoupon a1 $ \a1' ->
isCollar'_ a1' >>= \res ->
let {res' = C2HSImp.toBool res} in
return (res')
{-# LINE 550 "./QuantLib/CashFlow.chs" #-}
cappedFlooredIborCoupon :: (Day)
-> (Double)
-> (Day)
-> (Day)
-> (Word)
-> (GenIborIndex ibor)
-> (Double)
-> (Double)
-> (Maybe Double)
-> (Maybe Double)
-> (Maybe Day)
-> (Maybe Day)
-> (DayCounter)
-> (Bool)
-> (Maybe Day)
-> (BusinessDayConvention)
-> IO ((FloatingRateCoupon))
cappedFlooredIborCoupon :: forall ibor.
Day
-> Double
-> Day
-> Day
-> Word
-> GenIborIndex ibor
-> Double
-> Double
-> Maybe Double
-> Maybe Double
-> Maybe Day
-> Maybe Day
-> DayCounter
-> Bool
-> Maybe Day
-> BusinessDayConvention
-> IO FloatingRateCoupon
cappedFlooredIborCoupon Day
a1 Double
a2 Day
a3 Day
a4 Word
a5 GenIborIndex ibor
a6 Double
a7 Double
a8 Maybe Double
a9 Maybe Double
a10 Maybe Day
a11 Maybe Day
a12 DayCounter
a13 Bool
a14 Maybe Day
a15 BusinessDayConvention
a16 =
Day -> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a1 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
Day -> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a3 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a3' ->
Day -> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a4 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a4' ->
let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in
GenIborIndex ibor
-> (Ptr CIborIndex' -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall ibor b.
GenIborIndex ibor -> (Ptr CIborIndex' -> IO b) -> IO b
withIborIndex GenIborIndex ibor
a6 ((Ptr CIborIndex' -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon)
-> (Ptr CIborIndex' -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CIborIndex'
a6' ->
let {a7' :: CDouble
a7' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a7} in
let {a8' :: CDouble
a8' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a8} in
let {a9' :: CDouble
a9' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a9} in
let {a10' :: CDouble
a10' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a10} in
Maybe Day
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a11 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a11' ->
Maybe Day
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a12 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a12' ->
DayCounter
-> (Ptr CDayCounter -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter DayCounter
a13 ((Ptr CDayCounter -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon)
-> (Ptr CDayCounter -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CDayCounter
a13' ->
let {a14' :: CInt
a14' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a14} in
Maybe Day
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a15 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a15' ->
let {a16' :: CInt
a16' = BusinessDayConvention -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC BusinessDayConvention
a16} in
(Ptr (Ptr CChar) -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon)
-> (Ptr (Ptr CChar) -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a17' ->
CInt
-> CDouble
-> CInt
-> CInt
-> CUInt
-> Ptr CIborIndex'
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CInt
-> CInt
-> Ptr CDayCounter
-> CInt
-> CInt
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CFloatingRateCoupon')
cappedFlooredIborCoupon'_ CInt
a1' CDouble
a2' CInt
a3' CInt
a4' CUInt
a5' Ptr CIborIndex'
a6' CDouble
a7' CDouble
a8' CDouble
a9' CDouble
a10' CInt
a11' CInt
a12' Ptr CDayCounter
a13' CInt
a14' CInt
a15' CInt
a16' Ptr (Ptr CChar)
a17' IO (Ptr CFloatingRateCoupon')
-> (Ptr CFloatingRateCoupon' -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CFloatingRateCoupon'
res ->
Ptr CFloatingRateCoupon' -> IO FloatingRateCoupon
peekFloatingRateCoupon Ptr CFloatingRateCoupon'
res IO FloatingRateCoupon
-> (FloatingRateCoupon -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \FloatingRateCoupon
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a17'IO () -> IO FloatingRateCoupon -> IO FloatingRateCoupon
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
FloatingRateCoupon -> IO FloatingRateCoupon
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (FloatingRateCoupon
res')
{-# LINE 569 "./QuantLib/CashFlow.chs" #-}
digitalIborCoupon :: (IborCoupon)
-> (Maybe Double)
-> (PositionType)
-> (Bool)
-> (Maybe Double)
-> (Maybe Double)
-> (PositionType)
-> (Bool)
-> (Maybe Double)
-> (Maybe DigitalReplication)
-> (Bool)
-> IO ((DigitalCoupon))
digitalIborCoupon a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
withIborCoupon a1 $ \a1' ->
let {a2' = fromMaybeDouble a2} in
let {a3' = fromEnumC a3} in
let {a4' = C2HSImp.fromBool a4} in
let {a5' = fromMaybeDouble a5} in
let {a6' = fromMaybeDouble a6} in
let {a7' = fromEnumC a7} in
let {a8' = C2HSImp.fromBool a8} in
let {a9' = fromMaybeDouble a9} in
withMaybeDigitalReplication a10 $ \a10' ->
let {a11' = C2HSImp.fromBool a11} in
preErrorCheck $ \a12' ->
digitalIborCoupon'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
peekDigitalCoupon res >>= \res' ->
errorCheck a12'>>
return (res')
{-# LINE 583 "./QuantLib/CashFlow.chs" #-}
digitalCoupon :: (GenFloatingRateCoupon frc)
-> (Maybe Double) -> (PositionType) -> (Bool) -> (Maybe Double) -> (Maybe Double) -> (PositionType) -> (Bool) -> (Maybe Double) -> (Maybe DigitalReplication) -> (Bool) -> IO ((DigitalCoupon))
digitalCoupon a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
withFloatingRateCoupon a1 $ \a1' ->
let {a2' = fromMaybeDouble a2} in
let {a3' = fromEnumC a3} in
let {a4' = C2HSImp.fromBool a4} in
let {a5' = fromMaybeDouble a5} in
let {a6' = fromMaybeDouble a6} in
let {a7' = fromEnumC a7} in
let {a8' = C2HSImp.fromBool a8} in
let {a9' = fromMaybeDouble a9} in
withMaybeDigitalReplication a10 $ \a10' ->
let {a11' = C2HSImp.fromBool a11} in
preErrorCheck $ \a12' ->
digitalCoupon'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
peekDigitalCoupon res >>= \res' ->
errorCheck a12'>>
return (res')
{-# LINE 591 "./QuantLib/CashFlow.chs" #-}
callOptionRate :: (GenDigitalCoupon dc) -> IO ((Double))
callOptionRate a1 =
withDigitalCoupon a1 $ \a1' ->
preErrorCheck $ \a2' ->
callOptionRate'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 592 "./QuantLib/CashFlow.chs" #-}
putOptionRate :: (GenDigitalCoupon dc) -> IO ((Double))
putOptionRate a1 =
withDigitalCoupon a1 $ \a1' ->
preErrorCheck $ \a2' ->
putOptionRate'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 593 "./QuantLib/CashFlow.chs" #-}
multipleResetsCoupon :: (Day)
-> (Double)
-> (Schedule)
-> (Word)
-> (GenIborIndex ibor)
-> (Double)
-> (Double)
-> (Double)
-> (Maybe Day)
-> (Maybe Day)
-> (DayCounter)
-> (Maybe Day)
-> IO ((MultipleResetsCoupon))
multipleResetsCoupon :: forall ibor.
Day
-> Double
-> Schedule
-> Word
-> GenIborIndex ibor
-> Double
-> Double
-> Double
-> Maybe Day
-> Maybe Day
-> DayCounter
-> Maybe Day
-> IO MultipleResetsCoupon
multipleResetsCoupon Day
a1 Double
a2 Schedule
a3 Word
a4 GenIborIndex ibor
a5 Double
a6 Double
a7 Double
a8 Maybe Day
a9 Maybe Day
a10 DayCounter
a11 Maybe Day
a12 =
Day -> (CInt -> IO MultipleResetsCoupon) -> IO MultipleResetsCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a1 ((CInt -> IO MultipleResetsCoupon) -> IO MultipleResetsCoupon)
-> (CInt -> IO MultipleResetsCoupon) -> IO MultipleResetsCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
Schedule
-> (Ptr CSchedule -> IO MultipleResetsCoupon)
-> IO MultipleResetsCoupon
forall b. Schedule -> (Ptr CSchedule -> IO b) -> IO b
withSchedule Schedule
a3 ((Ptr CSchedule -> IO MultipleResetsCoupon)
-> IO MultipleResetsCoupon)
-> (Ptr CSchedule -> IO MultipleResetsCoupon)
-> IO MultipleResetsCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CSchedule
a3' ->
let {a4' = fromIntegral a4} in
withIborIndex a5 $ \a5' ->
let {a6' = realToFrac a6} in
let {a7' = realToFrac a7} in
let {a8' = realToFrac a8} in
withMaybeDay a9 $ \a9' ->
withMaybeDay a10 $ \a10' ->
withDayCounter a11 $ \a11' ->
withMaybeDay a12 $ \a12' ->
preErrorCheck $ \a13' ->
multipleResetsCoupon'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' >>= \res ->
peekMultipleResetsCoupon res >>= \res' ->
errorCheck a13'>>
return (res')
{-# LINE 608 "./QuantLib/CashFlow.chs" #-}
multipleResetsCouponFixingDatesRaw :: (MultipleResetsCoupon) -> IO (([Day]))
multipleResetsCouponFixingDatesRaw a1 =
withMultipleResetsCoupon a1 $ \a1' ->
preArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
multipleResetsCouponFixingDatesRaw'_ a1' a2'1 a2'2 a3' >>
peekDayArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 611 "./QuantLib/CashFlow.chs" #-}
rangeAccrualFloatersCoupon :: (Day) -> (Double) -> (GenIborIndex ibor) -> (Day) -> (Day) -> (Word) -> (DayCounter) -> (Double) -> (Double) -> (Maybe Day) -> (Maybe Day) -> (Schedule) -> (Double) -> (Double) -> IO ((RangeAccrualFloatersCoupon))
rangeAccrualFloatersCoupon a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 =
withDay a1 $ \a1' ->
let {a2' = realToFrac a2} in
withIborIndex a3 $ \a3' ->
withDay a4 $ \a4' ->
withDay a5 $ \a5' ->
let {a6' = fromIntegral a6} in
withDayCounter a7 $ \a7' ->
let {a8' = realToFrac a8} in
let {a9' = realToFrac a9} in
withMaybeDay a10 $ \a10' ->
withMaybeDay a11 $ \a11' ->
withSchedule a12 $ \a12' ->
let {a13' = realToFrac a13} in
let {a14' = realToFrac a14} in
preErrorCheck $ \a15' ->
rangeAccrualFloatersCoupon'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' a14' a15' >>= \res ->
peekRangeAccrualFloatersCoupon res >>= \res' ->
errorCheck a15'>>
return (res')
{-# LINE 616 "./QuantLib/CashFlow.chs" #-}
priceWithoutOptionality :: (RangeAccrualFloatersCoupon) -> (GenYieldTermStructure y) -> IO ((Double))
priceWithoutOptionality a1 a2 =
withRangeAccrualFloatersCoupon a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
preErrorCheck $ \a3' ->
priceWithoutOptionality'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 617 "./QuantLib/CashFlow.chs" #-}
yoyInflationCoupon :: (Day) -> (Double) -> (Day) -> (Day) -> (Word) -> (YoYInflationIndex) -> ((Int,TimeUnit)) -> (CPIInterpolationType) -> (DayCounter) -> (Double) -> (Double) -> (Maybe Day) -> (Maybe Day) -> IO ((YoYInflationCoupon))
yoyInflationCoupon a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 =
withDay a1 $ \a1' ->
let {a2' = realToFrac a2} in
withDay a3 $ \a3' ->
withDay a4 $ \a4' ->
let {a5' = fromIntegral a5} in
withYoYInflationIndex a6 $ \a6' ->
let {(a7'1, a7'2) = fromEnumQuantity a7} in
let {a8' = fromEnumC a8} in
withDayCounter a9 $ \a9' ->
let {a10' = realToFrac a10} in
let {a11' = realToFrac a11} in
withMaybeDay a12 $ \a12' ->
withMaybeDay a13 $ \a13' ->
preErrorCheck $ \a14' ->
yoyInflationCoupon'_ a1' a2' a3' a4' a5' a6' a7'1 a7'2 a8' a9' a10' a11' a12' a13' a14' >>= \res ->
peekYoYInflationCoupon res >>= \res' ->
errorCheck a14'>>
return (res')
{-# LINE 621 "./QuantLib/CashFlow.chs" #-}
adjustedFixing :: (YoYInflationCoupon) -> IO ((Double))
adjustedFixing a1 =
withYoYInflationCoupon a1 $ \a1' ->
preErrorCheck $ \a2' ->
adjustedFixing'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 622 "./QuantLib/CashFlow.chs" #-}
averagingMultipleResetsPricer :: IO ((FloatingRateCouponPricer))
averagingMultipleResetsPricer =
preErrorCheck $ \a1' ->
averagingMultipleResetsPricer'_ a1' >>= \res ->
peekFloatingRateCouponPricer res >>= \res' ->
errorCheck a1'>>
return (res')
{-# LINE 625 "./QuantLib/CashFlow.chs" #-}
compoundingMultipleResetsPricer :: IO ((FloatingRateCouponPricer))
compoundingMultipleResetsPricer =
preErrorCheck $ \a1' ->
compoundingMultipleResetsPricer'_ a1' >>= \res ->
peekFloatingRateCouponPricer res >>= \res' ->
errorCheck a1'>>
return (res')
{-# LINE 628 "./QuantLib/CashFlow.chs" #-}
overnightIndexedCoupon :: (Day)
-> (Double)
-> (Day)
-> (Day)
-> (OvernightIborIndex)
-> (Double)
-> (Double)
-> (Maybe Day)
-> (Maybe Day)
-> (DayCounter)
-> (Bool)
-> (RateAveragingType)
-> (Word)
-> (Word)
-> (Bool)
-> (Bool)
-> (Maybe Day)
-> (Maybe Day)
-> (Maybe Day)
-> (Maybe Int)
-> IO ((OvernightIndexedCoupon))
overnightIndexedCoupon :: Day
-> Double
-> Day
-> Day
-> OvernightIborIndex
-> Double
-> Double
-> Maybe Day
-> Maybe Day
-> DayCounter
-> Bool
-> RateAveragingType
-> Word
-> Word
-> Bool
-> Bool
-> Maybe Day
-> Maybe Day
-> Maybe Day
-> Maybe Int
-> IO OvernightIndexedCoupon
overnightIndexedCoupon Day
a1 Double
a2 Day
a3 Day
a4 OvernightIborIndex
a5 Double
a6 Double
a7 Maybe Day
a8 Maybe Day
a9 DayCounter
a10 Bool
a11 RateAveragingType
a12 Word
a13 Word
a14 Bool
a15 Bool
a16 Maybe Day
a17 Maybe Day
a18 Maybe Day
a19 Maybe Int
a20 =
Day
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a1 ((CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon)
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
Day
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a3 ((CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon)
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a3' ->
Day
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a4 ((CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon)
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a4' ->
OvernightIborIndex
-> (Ptr COvernightIndex' -> IO OvernightIndexedCoupon)
-> IO OvernightIndexedCoupon
forall b.
OvernightIborIndex -> (Ptr COvernightIndex' -> IO b) -> IO b
withOvernightIborIndex OvernightIborIndex
a5 ((Ptr COvernightIndex' -> IO OvernightIndexedCoupon)
-> IO OvernightIndexedCoupon)
-> (Ptr COvernightIndex' -> IO OvernightIndexedCoupon)
-> IO OvernightIndexedCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr COvernightIndex'
a5' ->
let {a6' :: CDouble
a6' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a6} in
let {a7' :: CDouble
a7' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a7} in
Maybe Day
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a8 ((CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon)
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a8' ->
Maybe Day
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a9 ((CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon)
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a9' ->
DayCounter
-> (Ptr CDayCounter -> IO OvernightIndexedCoupon)
-> IO OvernightIndexedCoupon
forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter DayCounter
a10 ((Ptr CDayCounter -> IO OvernightIndexedCoupon)
-> IO OvernightIndexedCoupon)
-> (Ptr CDayCounter -> IO OvernightIndexedCoupon)
-> IO OvernightIndexedCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CDayCounter
a10' ->
let {a11' :: CInt
a11' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a11} in
let {a12' :: CInt
a12' = RateAveragingType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC RateAveragingType
a12} in
let {a13' :: CUInt
a13' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a13} in
let {a14' :: CUInt
a14' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a14} in
let {a15' :: CInt
a15' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a15} in
let {a16' :: CInt
a16' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a16} in
Maybe Day
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a17 ((CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon)
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a17' ->
Maybe Day
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a18 ((CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon)
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a18' ->
Maybe Day
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a19 ((CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon)
-> (CInt -> IO OvernightIndexedCoupon) -> IO OvernightIndexedCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a19' ->
let {a20' :: CInt
a20' = Maybe Int -> CInt
forall a b. (Integral a, Integral b) => Maybe a -> b
fromMaybeInt Maybe Int
a20} in
(Ptr (Ptr CChar) -> IO OvernightIndexedCoupon)
-> IO OvernightIndexedCoupon
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO OvernightIndexedCoupon)
-> IO OvernightIndexedCoupon)
-> (Ptr (Ptr CChar) -> IO OvernightIndexedCoupon)
-> IO OvernightIndexedCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a21' ->
CInt
-> CDouble
-> CInt
-> CInt
-> Ptr COvernightIndex'
-> CDouble
-> CDouble
-> CInt
-> CInt
-> Ptr CDayCounter
-> CInt
-> CInt
-> CUInt
-> CUInt
-> CInt
-> CInt
-> CInt
-> CInt
-> CInt
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr COvernightIndexedCoupon')
overnightIndexedCoupon'_ CInt
a1' CDouble
a2' CInt
a3' CInt
a4' Ptr COvernightIndex'
a5' CDouble
a6' CDouble
a7' CInt
a8' CInt
a9' Ptr CDayCounter
a10' CInt
a11' CInt
a12' CUInt
a13' CUInt
a14' CInt
a15' CInt
a16' CInt
a17' CInt
a18' CInt
a19' CInt
a20' Ptr (Ptr CChar)
a21' IO (Ptr COvernightIndexedCoupon')
-> (Ptr COvernightIndexedCoupon' -> IO OvernightIndexedCoupon)
-> IO OvernightIndexedCoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr COvernightIndexedCoupon'
res ->
Ptr COvernightIndexedCoupon' -> IO OvernightIndexedCoupon
peekOvernightIndexedCoupon Ptr COvernightIndexedCoupon'
res IO OvernightIndexedCoupon
-> (OvernightIndexedCoupon -> IO OvernightIndexedCoupon)
-> IO OvernightIndexedCoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \OvernightIndexedCoupon
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a21'IO () -> IO OvernightIndexedCoupon -> IO OvernightIndexedCoupon
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
OvernightIndexedCoupon -> IO OvernightIndexedCoupon
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (OvernightIndexedCoupon
res')
{-# LINE 651 "./QuantLib/CashFlow.chs" #-}
overnightIndexedCouponFixingDatesRaw :: (OvernightIndexedCoupon) -> IO (([Day]))
overnightIndexedCouponFixingDatesRaw a1 =
withOvernightIndexedCoupon a1 $ \a1' ->
preArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
overnightIndexedCouponFixingDatesRaw'_ a1' a2'1 a2'2 a3' >>
peekDayArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 655 "./QuantLib/CashFlow.chs" #-}
overnightIndexedCouponIndexFixingsRaw :: (OvernightIndexedCoupon) -> IO (([Double]))
overnightIndexedCouponIndexFixingsRaw a1 =
withOvernightIndexedCoupon a1 $ \a1' ->
preArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
overnightIndexedCouponIndexFixingsRaw'_ a1' a2'1 a2'2 a3' >>
peekDoubleArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 661 "./QuantLib/CashFlow.chs" #-}
cappedFlooredOvernightIndexedCoupon :: (OvernightIndexedCoupon)
-> (Maybe Double)
-> (Maybe Double)
-> (Bool)
-> (Bool)
-> IO ((FloatingRateCoupon))
cappedFlooredOvernightIndexedCoupon a1 a2 a3 a4 a5 =
withOvernightIndexedCoupon a1 $ \a1' ->
let {a2' = fromMaybeDouble a2} in
let {a3' = fromMaybeDouble a3} in
let {a4' = C2HSImp.fromBool a4} in
let {a5' = C2HSImp.fromBool a5} in
preErrorCheck $ \a6' ->
cappedFlooredOvernightIndexedCoupon'_ a1' a2' a3' a4' a5' a6' >>= \res ->
peekFloatingRateCoupon res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 669 "./QuantLib/CashFlow.chs" #-}
compoundingOvernightIndexedCouponPricer :: (Maybe OptionletVolatilityStructure)
-> (Bool)
-> IO ((FloatingRateCouponPricer))
compoundingOvernightIndexedCouponPricer a1 a2 =
withMaybeOptionletVolatilityStructure a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
preErrorCheck $ \a3' ->
compoundingOvernightIndexedCouponPricer'_ a1' a2' a3' >>= \res ->
peekFloatingRateCouponPricer res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 674 "./QuantLib/CashFlow.chs" #-}
arithmeticAveragedOvernightIndexedCouponPricer :: (Double)
-> (Double)
-> (Bool)
-> (Maybe OptionletVolatilityStructure)
-> (Bool)
-> IO ((FloatingRateCouponPricer))
arithmeticAveragedOvernightIndexedCouponPricer a1 a2 a3 a4 a5 =
let {a1' = realToFrac a1} in
let {a2' = realToFrac a2} in
let {a3' = C2HSImp.fromBool a3} in
withMaybeOptionletVolatilityStructure a4 $ \a4' ->
let {a5' = C2HSImp.fromBool a5} in
preErrorCheck $ \a6' ->
arithmeticAveragedOvernightIndexedCouponPricer'_ a1' a2' a3' a4' a5' a6' >>= \res ->
peekFloatingRateCouponPricer res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 682 "./QuantLib/CashFlow.chs" #-}
blackCompoundingOvernightIndexedCouponPricer :: (Maybe OptionletVolatilityStructure)
-> (Bool)
-> IO ((FloatingRateCouponPricer))
blackCompoundingOvernightIndexedCouponPricer a1 a2 =
withMaybeOptionletVolatilityStructure a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
preErrorCheck $ \a3' ->
blackCompoundingOvernightIndexedCouponPricer'_ a1' a2' a3' >>= \res ->
peekFloatingRateCouponPricer res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 687 "./QuantLib/CashFlow.chs" #-}
blackAveragingOvernightIndexedCouponPricer :: (Maybe OptionletVolatilityStructure)
-> (Bool)
-> IO ((FloatingRateCouponPricer))
blackAveragingOvernightIndexedCouponPricer a1 a2 =
withMaybeOptionletVolatilityStructure a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
preErrorCheck $ \a3' ->
blackAveragingOvernightIndexedCouponPricer'_ a1' a2' a3' >>= \res ->
peekFloatingRateCouponPricer res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 692 "./QuantLib/CashFlow.chs" #-}
cpiCoupon :: (Double)
-> (Day)
-> (Double)
-> (Day)
-> (Day)
-> (GenZeroInflationIndex zidx)
-> ((Int,TimeUnit))
-> (CPIInterpolationType)
-> (DayCounter)
-> (Double)
-> (Maybe Day)
-> (Maybe Day)
-> (Maybe Day)
-> IO ((CPICoupon))
cpiCoupon :: forall zidx.
Double
-> Day
-> Double
-> Day
-> Day
-> GenZeroInflationIndex zidx
-> (Int, TimeUnit)
-> CPIInterpolationType
-> DayCounter
-> Double
-> Maybe Day
-> Maybe Day
-> Maybe Day
-> IO CPICoupon
cpiCoupon Double
a1 Day
a2 Double
a3 Day
a4 Day
a5 GenZeroInflationIndex zidx
a6 (Int, TimeUnit)
a7 CPIInterpolationType
a8 DayCounter
a9 Double
a10 Maybe Day
a11 Maybe Day
a12 Maybe Day
a13 =
let {a1' :: CDouble
a1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a1} in
Day -> (CInt -> IO CPICoupon) -> IO CPICoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a2 ((CInt -> IO CPICoupon) -> IO CPICoupon)
-> (CInt -> IO CPICoupon) -> IO CPICoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a2' ->
let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in
Day -> (CInt -> IO CPICoupon) -> IO CPICoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a4 ((CInt -> IO CPICoupon) -> IO CPICoupon)
-> (CInt -> IO CPICoupon) -> IO CPICoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a4' ->
Day -> (CInt -> IO CPICoupon) -> IO CPICoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a5 ((CInt -> IO CPICoupon) -> IO CPICoupon)
-> (CInt -> IO CPICoupon) -> IO CPICoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a5' ->
GenZeroInflationIndex zidx
-> (Ptr CZeroInflationIndex' -> IO CPICoupon) -> IO CPICoupon
forall zidx b.
GenZeroInflationIndex zidx
-> (Ptr CZeroInflationIndex' -> IO b) -> IO b
withZeroInflationIndex GenZeroInflationIndex zidx
a6 ((Ptr CZeroInflationIndex' -> IO CPICoupon) -> IO CPICoupon)
-> (Ptr CZeroInflationIndex' -> IO CPICoupon) -> IO CPICoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CZeroInflationIndex'
a6' ->
let {(CInt
a7'1, CInt
a7'2) = (Int, TimeUnit) -> (CInt, CInt)
forall a b c.
(Enum a, Integral b, Integral c) =>
(b, a) -> (CInt, c)
fromEnumQuantity (Int, TimeUnit)
a7} in
let {a8' :: CInt
a8' = CPIInterpolationType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC CPIInterpolationType
a8} in
DayCounter -> (Ptr CDayCounter -> IO CPICoupon) -> IO CPICoupon
forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter DayCounter
a9 ((Ptr CDayCounter -> IO CPICoupon) -> IO CPICoupon)
-> (Ptr CDayCounter -> IO CPICoupon) -> IO CPICoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CDayCounter
a9' ->
let {a10' :: CDouble
a10' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a10} in
Maybe Day -> (CInt -> IO CPICoupon) -> IO CPICoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a11 ((CInt -> IO CPICoupon) -> IO CPICoupon)
-> (CInt -> IO CPICoupon) -> IO CPICoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a11' ->
Maybe Day -> (CInt -> IO CPICoupon) -> IO CPICoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a12 ((CInt -> IO CPICoupon) -> IO CPICoupon)
-> (CInt -> IO CPICoupon) -> IO CPICoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a12' ->
Maybe Day -> (CInt -> IO CPICoupon) -> IO CPICoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a13 ((CInt -> IO CPICoupon) -> IO CPICoupon)
-> (CInt -> IO CPICoupon) -> IO CPICoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a13' ->
(Ptr (Ptr CChar) -> IO CPICoupon) -> IO CPICoupon
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO CPICoupon) -> IO CPICoupon)
-> (Ptr (Ptr CChar) -> IO CPICoupon) -> IO CPICoupon
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a14' ->
CDouble
-> CInt
-> CDouble
-> CInt
-> CInt
-> Ptr CZeroInflationIndex'
-> CInt
-> CInt
-> CInt
-> Ptr CDayCounter
-> CDouble
-> CInt
-> CInt
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CCPICoupon')
cpiCoupon'_ CDouble
a1' CInt
a2' CDouble
a3' CInt
a4' CInt
a5' Ptr CZeroInflationIndex'
a6' CInt
a7'1 CInt
a7'2 CInt
a8' Ptr CDayCounter
a9' CDouble
a10' CInt
a11' CInt
a12' CInt
a13' Ptr (Ptr CChar)
a14' IO (Ptr CCPICoupon')
-> (Ptr CCPICoupon' -> IO CPICoupon) -> IO CPICoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CCPICoupon'
res ->
Ptr CCPICoupon' -> IO CPICoupon
peekCPICoupon Ptr CCPICoupon'
res IO CPICoupon -> (CPICoupon -> IO CPICoupon) -> IO CPICoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CPICoupon
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a14'IO () -> IO CPICoupon -> IO CPICoupon
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
CPICoupon -> IO CPICoupon
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (CPICoupon
res')
{-# LINE 708 "./QuantLib/CashFlow.chs" #-}
cpiCouponFromBaseDate :: (Day)
-> (Day)
-> (Double)
-> (Day)
-> (Day)
-> (GenZeroInflationIndex zidx)
-> ((Int,TimeUnit))
-> (CPIInterpolationType)
-> (DayCounter)
-> (Double)
-> (Maybe Day)
-> (Maybe Day)
-> (Maybe Day)
-> IO ((CPICoupon))
cpiCouponFromBaseDate a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 =
withDay a1 $ \a1' ->
withDay a2 $ \a2' ->
let {a3' = realToFrac a3} in
withDay a4 $ \a4' ->
withDay a5 $ \a5' ->
withZeroInflationIndex a6 $ \a6' ->
let {(a7'1, a7'2) = fromEnumQuantity a7} in
let {a8' = fromEnumC a8} in
withDayCounter a9 $ \a9' ->
let {a10' = realToFrac a10} in
withMaybeDay a11 $ \a11' ->
withMaybeDay a12 $ \a12' ->
withMaybeDay a13 $ \a13' ->
preErrorCheck $ \a14' ->
cpiCouponFromBaseDate'_ a1' a2' a3' a4' a5' a6' a7'1 a7'2 a8' a9' a10' a11' a12' a13' a14' >>= \res ->
peekCPICoupon res >>= \res' ->
errorCheck a14'>>
return (res')
{-# LINE 724 "./QuantLib/CashFlow.chs" #-}
cpiCouponWithBaseDate :: (Double)
-> (Day)
-> (Day)
-> (Double)
-> (Day)
-> (Day)
-> (GenZeroInflationIndex zidx)
-> ((Int,TimeUnit))
-> (CPIInterpolationType)
-> (DayCounter)
-> (Double)
-> (Maybe Day)
-> (Maybe Day)
-> (Maybe Day)
-> IO ((CPICoupon))
cpiCouponWithBaseDate a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 =
let {a1' = realToFrac a1} in
withDay a2 $ \a2' ->
withDay a3 $ \a3' ->
let {a4' = realToFrac a4} in
withDay a5 $ \a5' ->
withDay a6 $ \a6' ->
withZeroInflationIndex a7 $ \a7' ->
let {(a8'1, a8'2) = fromEnumQuantity a8} in
let {a9' = fromEnumC a9} in
withDayCounter a10 $ \a10' ->
let {a11' = realToFrac a11} in
withMaybeDay a12 $ \a12' ->
withMaybeDay a13 $ \a13' ->
withMaybeDay a14 $ \a14' ->
preErrorCheck $ \a15' ->
cpiCouponWithBaseDate'_ a1' a2' a3' a4' a5' a6' a7' a8'1 a8'2 a9' a10' a11' a12' a13' a14' a15' >>= \res ->
peekCPICoupon res >>= \res' ->
errorCheck a15'>>
return (res')
{-# LINE 741 "./QuantLib/CashFlow.chs" #-}
cpiCouponPricer :: (Maybe YieldTermStructure)
-> IO ((CPICouponPricer))
cpiCouponPricer a1 =
withMaybeYieldTermStructure a1 $ \a1' ->
preErrorCheck $ \a2' ->
cpiCouponPricer'_ a1' a2' >>= \res ->
peekCPICouponPricer res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 745 "./QuantLib/CashFlow.chs" #-}
cpiCouponPricerWithVol :: (CPIVolatilitySurface)
-> (Maybe YieldTermStructure)
-> IO ((CPICouponPricer))
cpiCouponPricerWithVol a1 a2 =
withGenVolatilityTermStructure a1 $ \a1' ->
withMaybeYieldTermStructure a2 $ \a2' ->
preErrorCheck $ \a3' ->
cpiCouponPricerWithVol'_ a1' a2' a3' >>= \res ->
peekCPICouponPricer res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 750 "./QuantLib/CashFlow.chs" #-}
setCpiCouponPricer :: (CPICoupon)
-> (CPICouponPricer)
-> IO ()
setCpiCouponPricer a1 a2 =
withCPICoupon a1 $ \a1' ->
withCPICouponPricer a2 $ \a2' ->
preErrorCheck $ \a3' ->
setCpiCouponPricer'_ a1' a2' a3' >>
errorCheck a3'>>
return ()
{-# LINE 755 "./QuantLib/CashFlow.chs" #-}
indexRatio :: (CPICoupon)
-> (Day)
-> IO ((Double))
indexRatio a1 a2 =
withCPICoupon a1 $ \a1' ->
withDay a2 $ \a2' ->
preErrorCheck $ \a3' ->
indexRatio'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 761 "./QuantLib/CashFlow.chs" #-}
redemption :: (Double)
-> (Day)
-> IO ((CashFlow))
redemption a1 a2 =
let {a1' = realToFrac a1} in
withDay a2 $ \a2' ->
preErrorCheck $ \a3' ->
redemption'_ a1' a2' a3' >>= \res ->
peekCashFlow res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 766 "./QuantLib/CashFlow.chs" #-}
amortizingPayment :: (Double)
-> (Day)
-> IO ((CashFlow))
amortizingPayment a1 a2 =
let {a1' = realToFrac a1} in
withDay a2 $ \a2' ->
preErrorCheck $ \a3' ->
amortizingPayment'_ a1' a2' a3' >>= \res ->
peekCashFlow res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 771 "./QuantLib/CashFlow.chs" #-}
cashFlowLeg :: ([GenCashFlow cf])
-> IO ((Leg))
cashFlowLeg a1 =
withCashFlowArray a1 $ \(a1'1, a1'2) ->
preErrorCheck $ \a2' ->
cashFlowLeg'_ a1'1 a1'2 a2' >>= \res ->
peekLeg res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 777 "./QuantLib/CashFlow.chs" #-}
startDate :: (GenLeg l) -> IO ((Day))
startDate a1 =
withLeg a1 $ \a1' ->
preErrorCheck $ \a2' ->
startDate'_ a1' a2' >>= \res ->
let {res' = toDay res} in
errorCheck a2'>>
return (res')
{-# LINE 780 "./QuantLib/CashFlow.chs" #-}
nextCashFlows :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Leg))
nextCashFlows a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
nextCashFlows'_ a1' a2' a3' a4' >>= \res ->
peekLeg res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 785 "./QuantLib/CashFlow.chs" #-}
previousCashFlows :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Leg))
previousCashFlows a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
previousCashFlows'_ a1' a2' a3' a4' >>= \res ->
peekLeg res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 790 "./QuantLib/CashFlow.chs" #-}
qlLegCashFlows :: (GenLeg l) -> (Maybe Bool)
-> (Maybe Day)
-> IO (([Double]), ([Day]), ([Bool]))
qlLegCashFlows a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = fromMaybeBool a2} in
withMaybeDay a3 $ \a3' ->
preArray $ \(a4'1, a4'2) ->
preArray $ \(a5'1, a5'2) ->
preArray $ \(a6'1, a6'2) ->
preErrorCheck $ \a7' ->
qlLegCashFlows'_ a1' a2' a3' a4'1 a4'2 a5'1 a5'2 a6'1 a6'2 a7' >>
peekDoubleArray a4'1 a4'2>>= \a4'' ->
peekDayArray a5'1 a5'2>>= \a5'' ->
peekBoolArray a6'1 a6'2>>= \a6'' ->
errorCheck a7'>>
return (a4'', a5'', a6'')
duration :: forall l.
GenLeg l
-> InterestRate
-> DurationType
-> Bool
-> Maybe Day
-> Maybe Day
-> IO Double
{-# LINE 795 "./QuantLib/CashFlow.chs" #-}
cashFlows :: GenLeg l
-> Maybe Bool
-> Maybe Day
-> IO [(Day, Double, Bool)]
cashFlows l i d = do{(as, ds, hs) <- qlLegCashFlows l i d; return $ zip3 ds as hs}
duration :: (GenLeg l) -> (InterestRate)
-> (DurationType) -> (Bool)
-> (Maybe Day)
-> (Maybe Day)
-> IO ((Double))
duration :: forall l.
GenLeg l
-> InterestRate
-> DurationType
-> Bool
-> Maybe Day
-> Maybe Day
-> IO Double
duration GenLeg l
a1 InterestRate
a2 DurationType
a3 Bool
a4 Maybe Day
a5 Maybe Day
a6 =
GenLeg l -> (Ptr CLeg' -> IO Double) -> IO Double
forall l b. GenLeg l -> (Ptr CLeg' -> IO b) -> IO b
withLeg GenLeg l
a1 ((Ptr CLeg' -> IO Double) -> IO Double)
-> (Ptr CLeg' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CLeg'
a1' ->
InterestRate -> (Ptr CInterestRate -> IO Double) -> IO Double
forall b. InterestRate -> (Ptr CInterestRate -> IO b) -> IO b
withInterestRate InterestRate
a2 ((Ptr CInterestRate -> IO Double) -> IO Double)
-> (Ptr CInterestRate -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CInterestRate
a2' ->
let {a3' :: CInt
a3' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (DurationType -> Int) -> DurationType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DurationType -> Int
forall a. Enum a => a -> Int
fromEnum) DurationType
a3} in
let {a4' :: CInt
a4' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a4} in
Maybe Day -> (CInt -> IO Double) -> IO Double
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a5 ((CInt -> IO Double) -> IO Double)
-> (CInt -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \CInt
a5' ->
Maybe Day -> (CInt -> IO Double) -> IO Double
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a6 ((CInt -> IO Double) -> IO Double)
-> (CInt -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \CInt
a6' ->
(Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Double) -> IO Double)
-> (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a7' ->
Ptr CLeg'
-> Ptr CInterestRate
-> CInt
-> CInt
-> CInt
-> CInt
-> Ptr (Ptr CChar)
-> IO CDouble
duration'_ Ptr CLeg'
a1' Ptr CInterestRate
a2' CInt
a3' CInt
a4' CInt
a5' CInt
a6' Ptr (Ptr CChar)
a7' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CDouble
res ->
let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
res} in
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a7'IO () -> IO Double -> IO Double
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Double -> IO Double
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
res')
{-# LINE 810 "./QuantLib/CashFlow.chs" #-}
accrualDays :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Int))
accrualDays a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
accrualDays'_ a1' a2' a3' a4' >>= \res ->
let {res' = fromIntegral res} in
errorCheck a4'>>
return (res')
{-# LINE 815 "./QuantLib/CashFlow.chs" #-}
accrualEndDate :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Maybe Day))
accrualEndDate a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
accrualEndDate'_ a1' a2' a3' a4' >>= \res ->
let {res' = toMaybeDay res} in
errorCheck a4'>>
return (res')
{-# LINE 820 "./QuantLib/CashFlow.chs" #-}
accrualPeriod :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Double))
accrualPeriod a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
accrualPeriod'_ a1' a2' a3' a4' >>= \res ->
let {res' = realToFrac res} in
errorCheck a4'>>
return (res')
{-# LINE 825 "./QuantLib/CashFlow.chs" #-}
accrualStartDate :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Maybe Day))
accrualStartDate a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
accrualStartDate'_ a1' a2' a3' a4' >>= \res ->
let {res' = toMaybeDay res} in
errorCheck a4'>>
return (res')
{-# LINE 830 "./QuantLib/CashFlow.chs" #-}
accruedAmount :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Double))
accruedAmount a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
accruedAmount'_ a1' a2' a3' a4' >>= \res ->
let {res' = realToFrac res} in
errorCheck a4'>>
return (res')
{-# LINE 835 "./QuantLib/CashFlow.chs" #-}
accruedDays :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Int))
accruedDays a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
accruedDays'_ a1' a2' a3' a4' >>= \res ->
let {res' = fromIntegral res} in
errorCheck a4'>>
return (res')
{-# LINE 840 "./QuantLib/CashFlow.chs" #-}
accruedPeriod :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Double))
accruedPeriod a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
accruedPeriod'_ a1' a2' a3' a4' >>= \res ->
let {res' = realToFrac res} in
errorCheck a4'>>
return (res')
{-# LINE 845 "./QuantLib/CashFlow.chs" #-}
basisPointValue :: (GenLeg l) -> (InterestRate) -> (Bool)
-> (Maybe Day)
-> (Maybe Day)
-> IO ((Double))
basisPointValue a1 a2 a3 a4 a5 =
withLeg a1 $ \a1' ->
withInterestRate a2 $ \a2' ->
let {a3' = C2HSImp.fromBool a3} in
withMaybeDay a4 $ \a4' ->
withMaybeDay a5 $ \a5' ->
preErrorCheck $ \a6' ->
basisPointValue'_ a1' a2' a3' a4' a5' a6' >>= \res ->
let {res' = realToFrac res} in
errorCheck a6'>>
return (res')
{-# LINE 853 "./QuantLib/CashFlow.chs" #-}
data Discounting y
= DiscountingCurve !(GenYieldTermStructure y)
| DiscountingZSpread !(GenYieldTermStructure y) !Double !Compounding !Frequency
| DiscountingYield !InterestRate
data BpsDiscounting y
= BpsDiscountingCurve !(GenYieldTermStructure y)
| BpsDiscountingYield !InterestRate
bpsFromYieldRaw :: (GenLeg l) -> (InterestRate) -> (Bool)
-> (Maybe Day)
-> (Maybe Day)
-> IO ((Double))
bpsFromYieldRaw :: forall l.
GenLeg l
-> InterestRate -> Bool -> Maybe Day -> Maybe Day -> IO Double
bpsFromYieldRaw GenLeg l
a1 InterestRate
a2 Bool
a3 Maybe Day
a4 Maybe Day
a5 =
GenLeg l -> (Ptr CLeg' -> IO Double) -> IO Double
forall l b. GenLeg l -> (Ptr CLeg' -> IO b) -> IO b
withLeg GenLeg l
a1 ((Ptr CLeg' -> IO Double) -> IO Double)
-> (Ptr CLeg' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CLeg'
a1' ->
InterestRate -> (Ptr CInterestRate -> IO Double) -> IO Double
forall b. InterestRate -> (Ptr CInterestRate -> IO b) -> IO b
withInterestRate InterestRate
a2 ((Ptr CInterestRate -> IO Double) -> IO Double)
-> (Ptr CInterestRate -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CInterestRate
a2' ->
let {a3' :: CInt
a3' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a3} in
Maybe Day -> (CInt -> IO Double) -> IO Double
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a4 ((CInt -> IO Double) -> IO Double)
-> (CInt -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \CInt
a4' ->
Maybe Day -> (CInt -> IO Double) -> IO Double
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a5 ((CInt -> IO Double) -> IO Double)
-> (CInt -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \CInt
a5' ->
(Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Double) -> IO Double)
-> (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a6' ->
Ptr CLeg'
-> Ptr CInterestRate
-> CInt
-> CInt
-> CInt
-> Ptr (Ptr CChar)
-> IO CDouble
bpsFromYieldRaw'_ Ptr CLeg'
a1' Ptr CInterestRate
a2' CInt
a3' CInt
a4' CInt
a5' Ptr (Ptr CChar)
a6' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CDouble
res ->
let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
res} in
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a6'IO () -> IO Double -> IO Double
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Double -> IO Double
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
res')
{-# LINE 872 "./QuantLib/CashFlow.chs" #-}
convexity :: (GenLeg l) -> (InterestRate) -> (Bool)
-> (Maybe Day)
-> (Maybe Day)
-> IO ((Double))
convexity a1 a2 a3 a4 a5 =
withLeg a1 $ \a1' ->
withInterestRate a2 $ \a2' ->
let {a3' = C2HSImp.fromBool a3} in
withMaybeDay a4 $ \a4' ->
withMaybeDay a5 $ \a5' ->
preErrorCheck $ \a6' ->
convexity'_ a1' a2' a3' a4' a5' a6' >>= \res ->
let {res' = realToFrac res} in
errorCheck a6'>>
return (res')
{-# LINE 880 "./QuantLib/CashFlow.chs" #-}
isExpired :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Bool))
isExpired a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
isExpired'_ a1' a2' a3' a4' >>= \res ->
let {res' = C2HSImp.toBool res} in
errorCheck a4'>>
return (res')
{-# LINE 885 "./QuantLib/CashFlow.chs" #-}
maturityDate :: (GenLeg l) -> IO ((Day))
maturityDate a1 =
withLeg a1 $ \a1' ->
preErrorCheck $ \a2' ->
maturityDate'_ a1' a2' >>= \res ->
let {res' = toDay res} in
errorCheck a2'>>
return (res')
{-# LINE 888 "./QuantLib/CashFlow.chs" #-}
nextCashFlowAmount :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Double))
nextCashFlowAmount a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
nextCashFlowAmount'_ a1' a2' a3' a4' >>= \res ->
let {res' = realToFrac res} in
errorCheck a4'>>
return (res')
{-# LINE 893 "./QuantLib/CashFlow.chs" #-}
nextCashFlowDate :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO (((Maybe Day)))
nextCashFlowDate a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
nextCashFlowDate'_ a1' a2' a3' a4' >>= \res ->
let {res' = toMaybeDay res} in
errorCheck a4'>>
return (res')
{-# LINE 898 "./QuantLib/CashFlow.chs" #-}
nextCouponRate :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Double))
nextCouponRate a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
nextCouponRate'_ a1' a2' a3' a4' >>= \res ->
let {res' = realToFrac res} in
errorCheck a4'>>
return (res')
{-# LINE 903 "./QuantLib/CashFlow.chs" #-}
nominal :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Double))
nominal a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
nominal'_ a1' a2' a3' a4' >>= \res ->
let {res' = realToFrac res} in
errorCheck a4'>>
return (res')
{-# LINE 908 "./QuantLib/CashFlow.chs" #-}
npvFromYieldRaw :: (GenLeg l) -> (InterestRate) -> (Bool)
-> (Maybe Day)
-> (Maybe Day)
-> IO ((Double))
npvFromYieldRaw a1 a2 a3 a4 a5 =
withLeg a1 $ \a1' ->
withInterestRate a2 $ \a2' ->
let {a3' = C2HSImp.fromBool a3} in
withMaybeDay a4 $ \a4' ->
withMaybeDay a5 $ \a5' ->
preErrorCheck $ \a6' ->
npvFromYieldRaw'_ a1' a2' a3' a4' a5' a6' >>= \res ->
let {res' = realToFrac res} in
errorCheck a6'>>
return (res')
{-# LINE 915 "./QuantLib/CashFlow.chs" #-}
atmRate :: (GenLeg l) -> (GenYieldTermStructure y) -> (Bool)
-> (Maybe Day)
-> (Maybe Day)
-> (Double)
-> IO ((Double))
atmRate a1 a2 a3 a4 a5 a6 =
withLeg a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
let {a3' = C2HSImp.fromBool a3} in
withMaybeDay a4 $ \a4' ->
withMaybeDay a5 $ \a5' ->
let {a6' = realToFrac a6} in
preErrorCheck $ \a7' ->
atmRate'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
let {res' = realToFrac res} in
errorCheck a7'>>
return (res')
{-# LINE 923 "./QuantLib/CashFlow.chs" #-}
bpsFromCurveRaw :: (GenLeg l) -> (GenYieldTermStructure y) -> (Bool)
-> (Maybe Day)
-> (Maybe Day)
-> IO ((Double))
bpsFromCurveRaw a1 a2 a3 a4 a5 =
withLeg a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
let {a3' = C2HSImp.fromBool a3} in
withMaybeDay a4 $ \a4' ->
withMaybeDay a5 $ \a5' ->
preErrorCheck $ \a6' ->
bpsFromCurveRaw'_ a1' a2' a3' a4' a5' a6' >>= \res ->
let {res' = realToFrac res} in
errorCheck a6'>>
return (res')
{-# LINE 930 "./QuantLib/CashFlow.chs" #-}
npvWithZSpreadRaw :: (GenLeg l) -> (GenYieldTermStructure y) -> (Double)
-> (Compounding) -> (Frequency) -> (Bool)
-> (Maybe Day)
-> (Maybe Day)
-> IO ((Double))
npvWithZSpreadRaw a1 a2 a3 a4 a5 a6 a7 a8 =
withLeg a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
let {a3' = realToFrac a3} in
let {a4' = (fromIntegral . fromEnum) a4} in
let {a5' = (fromIntegral . fromEnum) a5} in
let {a6' = C2HSImp.fromBool a6} in
withMaybeDay a7 $ \a7' ->
withMaybeDay a8 $ \a8' ->
preErrorCheck $ \a9' ->
npvWithZSpreadRaw'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
let {res' = realToFrac res} in
errorCheck a9'>>
return (res')
{-# LINE 938 "./QuantLib/CashFlow.chs" #-}
npvFromCurveRaw :: (GenLeg l) -> (GenYieldTermStructure y) -> (Bool)
-> (Maybe Day)
-> (Maybe Day)
-> IO ((Double))
npvFromCurveRaw a1 a2 a3 a4 a5 =
withLeg a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
let {a3' = C2HSImp.fromBool a3} in
withMaybeDay a4 $ \a4' ->
withMaybeDay a5 $ \a5' ->
preErrorCheck $ \a6' ->
npvFromCurveRaw'_ a1' a2' a3' a4' a5' a6' >>= \res ->
let {res' = realToFrac res} in
errorCheck a6'>>
return (res')
{-# LINE 945 "./QuantLib/CashFlow.chs" #-}
npv :: GenLeg l -> Discounting y -> Bool -> Maybe Day -> Maybe Day -> IO Double
npv cashflows discounting = case discounting of
DiscountingCurve curve -> npvFromCurveRaw cashflows curve
DiscountingZSpread curve z comp freq -> npvWithZSpreadRaw cashflows curve z comp freq
DiscountingYield y -> npvFromYieldRaw cashflows y
bps :: GenLeg l -> BpsDiscounting y -> Bool -> Maybe Day -> Maybe Day -> IO Double
bps cashflows discounting = case discounting of
BpsDiscountingCurve curve -> bpsFromCurveRaw cashflows curve
BpsDiscountingYield y -> bpsFromYieldRaw cashflows y
npvBps :: (GenLeg l) -> (GenYieldTermStructure y) -> (Bool)
-> (Day)
-> (Day)
-> IO ((Double), (Double))
npvBps :: forall l y.
GenLeg l
-> GenYieldTermStructure y
-> Bool
-> Day
-> Day
-> IO (Double, Double)
npvBps GenLeg l
a1 GenYieldTermStructure y
a2 Bool
a3 Day
a4 Day
a5 =
GenLeg l
-> (Ptr CLeg' -> IO (Double, Double)) -> IO (Double, Double)
forall l b. GenLeg l -> (Ptr CLeg' -> IO b) -> IO b
withLeg GenLeg l
a1 ((Ptr CLeg' -> IO (Double, Double)) -> IO (Double, Double))
-> (Ptr CLeg' -> IO (Double, Double)) -> IO (Double, Double)
forall a b. (a -> b) -> a -> b
$ \Ptr CLeg'
a1' ->
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO (Double, Double))
-> IO (Double, Double)
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y
a2 ((Ptr CYieldTermStructure' -> IO (Double, Double))
-> IO (Double, Double))
-> (Ptr CYieldTermStructure' -> IO (Double, Double))
-> IO (Double, Double)
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a2' ->
let {a3' :: CInt
a3' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a3} in
Day -> (CInt -> IO (Double, Double)) -> IO (Double, Double)
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a4 ((CInt -> IO (Double, Double)) -> IO (Double, Double))
-> (CInt -> IO (Double, Double)) -> IO (Double, Double)
forall a b. (a -> b) -> a -> b
$ \CInt
a4' ->
Day -> (CInt -> IO (Double, Double)) -> IO (Double, Double)
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a5 ((CInt -> IO (Double, Double)) -> IO (Double, Double))
-> (CInt -> IO (Double, Double)) -> IO (Double, Double)
forall a b. (a -> b) -> a -> b
$ \CInt
a5' ->
(Ptr CDouble -> IO (Double, Double)) -> IO (Double, Double)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
prePtr ((Ptr CDouble -> IO (Double, Double)) -> IO (Double, Double))
-> (Ptr CDouble -> IO (Double, Double)) -> IO (Double, Double)
forall a b. (a -> b) -> a -> b
$ \Ptr CDouble
a6' ->
(Ptr CDouble -> IO (Double, Double)) -> IO (Double, Double)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
prePtr ((Ptr CDouble -> IO (Double, Double)) -> IO (Double, Double))
-> (Ptr CDouble -> IO (Double, Double)) -> IO (Double, Double)
forall a b. (a -> b) -> a -> b
$ \Ptr CDouble
a7' ->
(Ptr (Ptr CChar) -> IO (Double, Double)) -> IO (Double, Double)
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO (Double, Double)) -> IO (Double, Double))
-> (Ptr (Ptr CChar) -> IO (Double, Double)) -> IO (Double, Double)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a8' ->
Ptr CLeg'
-> Ptr CYieldTermStructure'
-> CInt
-> CInt
-> CInt
-> Ptr CDouble
-> Ptr CDouble
-> Ptr (Ptr CChar)
-> IO ()
npvBps'_ Ptr CLeg'
a1' Ptr CYieldTermStructure'
a2' CInt
a3' CInt
a4' CInt
a5' Ptr CDouble
a6' Ptr CDouble
a7' Ptr (Ptr CChar)
a8' IO () -> IO Double -> IO Double
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Ptr CDouble -> IO Double
peekDouble Ptr CDouble
a6'IO Double -> (Double -> IO (Double, Double)) -> IO (Double, Double)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Double
a6'' ->
Ptr CDouble -> IO Double
peekDouble Ptr CDouble
a7'IO Double -> (Double -> IO (Double, Double)) -> IO (Double, Double)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Double
a7'' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a8'IO () -> IO (Double, Double) -> IO (Double, Double)
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
(Double, Double) -> IO (Double, Double)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
a6'', Double
a7'')
{-# LINE 965 "./QuantLib/CashFlow.chs" #-}
zSpread :: (GenLeg l) -> (Double)
-> (GenYieldTermStructure y) -> (Compounding) -> (Frequency) -> (Bool)
-> (Maybe Day)
-> (Maybe Day)
-> (Double)
-> (Word)
-> (Double)
-> IO ((Double))
zSpread a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
withLeg a1 $ \a1' ->
let {a2' = realToFrac a2} in
withYieldTermStructure a3 $ \a3' ->
let {a4' = (fromIntegral . fromEnum) a4} in
let {a5' = (fromIntegral . fromEnum) a5} in
let {a6' = C2HSImp.fromBool a6} in
withMaybeDay a7 $ \a7' ->
withMaybeDay a8 $ \a8' ->
let {a9' = realToFrac a9} in
let {a10' = fromIntegral a10} in
let {a11' = realToFrac a11} in
preErrorCheck $ \a12' ->
zSpread'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
let {res' = realToFrac res} in
errorCheck a12'>>
return (res')
{-# LINE 975 "./QuantLib/CashFlow.chs" #-}
previousCashFlowAmount :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Double))
previousCashFlowAmount a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
previousCashFlowAmount'_ a1' a2' a3' a4' >>= \res ->
let {res' = realToFrac res} in
errorCheck a4'>>
return (res')
{-# LINE 980 "./QuantLib/CashFlow.chs" #-}
previousCashFlowDate :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Maybe Day))
previousCashFlowDate a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
previousCashFlowDate'_ a1' a2' a3' a4' >>= \res ->
let {res' = toMaybeDay res} in
errorCheck a4'>>
return (res')
{-# LINE 985 "./QuantLib/CashFlow.chs" #-}
previousCouponRate :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Double))
previousCouponRate a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
previousCouponRate'_ a1' a2' a3' a4' >>= \res ->
let {res' = realToFrac res} in
errorCheck a4'>>
return (res')
{-# LINE 990 "./QuantLib/CashFlow.chs" #-}
referencePeriodEnd :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Maybe Day))
referencePeriodEnd a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
referencePeriodEnd'_ a1' a2' a3' a4' >>= \res ->
let {res' = toMaybeDay res} in
errorCheck a4'>>
return (res')
{-# LINE 995 "./QuantLib/CashFlow.chs" #-}
referencePeriodStart :: (GenLeg l) -> (Bool)
-> (Maybe Day)
-> IO ((Maybe Day))
referencePeriodStart a1 a2 a3 =
withLeg a1 $ \a1' ->
let {a2' = C2HSImp.fromBool a2} in
withMaybeDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
referencePeriodStart'_ a1' a2' a3' a4' >>= \res ->
let {res' = toMaybeDay res} in
errorCheck a4'>>
return (res')
{-# LINE 1000 "./QuantLib/CashFlow.chs" #-}
yield :: (GenLeg l) -> (Double)
-> (DayCounter) -> (Compounding) -> (Frequency) -> (Bool)
-> (Maybe Day)
-> (Maybe Day)
-> (Double)
-> (Word)
-> (Double)
-> IO ((Double))
yield :: forall l.
GenLeg l
-> Double
-> DayCounter
-> Compounding
-> Frequency
-> Bool
-> Maybe Day
-> Maybe Day
-> Double
-> Word
-> Double
-> IO Double
yield GenLeg l
a1 Double
a2 DayCounter
a3 Compounding
a4 Frequency
a5 Bool
a6 Maybe Day
a7 Maybe Day
a8 Double
a9 Word
a10 Double
a11 =
GenLeg l -> (Ptr CLeg' -> IO Double) -> IO Double
forall l b. GenLeg l -> (Ptr CLeg' -> IO b) -> IO b
withLeg GenLeg l
a1 ((Ptr CLeg' -> IO Double) -> IO Double)
-> (Ptr CLeg' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CLeg'
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
DayCounter -> (Ptr CDayCounter -> IO Double) -> IO Double
forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter DayCounter
a3 ((Ptr CDayCounter -> IO Double) -> IO Double)
-> (Ptr CDayCounter -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CDayCounter
a3' ->
let {a4' :: CInt
a4' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Compounding -> Int) -> Compounding -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Compounding -> Int
forall a. Enum a => a -> Int
fromEnum) Compounding
a4} in
let {a5' :: CInt
a5' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Frequency -> Int) -> Frequency -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Frequency -> Int
forall a. Enum a => a -> Int
fromEnum) Frequency
a5} in
let {a6' :: CInt
a6' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a6} in
Maybe Day -> (CInt -> IO Double) -> IO Double
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a7 ((CInt -> IO Double) -> IO Double)
-> (CInt -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \CInt
a7' ->
Maybe Day -> (CInt -> IO Double) -> IO Double
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a8 ((CInt -> IO Double) -> IO Double)
-> (CInt -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \CInt
a8' ->
let {a9' :: CDouble
a9' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a9} in
let {a10' :: CUInt
a10' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a10} in
let {a11' :: CDouble
a11' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a11} in
(Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Double) -> IO Double)
-> (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a12' ->
Ptr CLeg'
-> CDouble
-> Ptr CDayCounter
-> CInt
-> CInt
-> CInt
-> CInt
-> CInt
-> CDouble
-> CUInt
-> CDouble
-> Ptr (Ptr CChar)
-> IO CDouble
yield'_ Ptr CLeg'
a1' CDouble
a2' Ptr CDayCounter
a3' CInt
a4' CInt
a5' CInt
a6' CInt
a7' CInt
a8' CDouble
a9' CUInt
a10' CDouble
a11' Ptr (Ptr CChar)
a12' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CDouble
res ->
let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
res} in
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a12'IO () -> IO Double -> IO Double
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Double -> IO Double
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
res')
{-# LINE 1011 "./QuantLib/CashFlow.chs" #-}
yieldValueBasisPoint :: (GenLeg l) -> (InterestRate)
-> (Bool)
-> (Maybe Day)
-> (Maybe Day)
-> IO ((Double))
yieldValueBasisPoint a1 a2 a3 a4 a5 =
withLeg a1 $ \a1' ->
withInterestRate a2 $ \a2' ->
let {a3' = C2HSImp.fromBool a3} in
withMaybeDay a4 $ \a4' ->
withMaybeDay a5 $ \a5' ->
preErrorCheck $ \a6' ->
yieldValueBasisPoint'_ a1' a2' a3' a4' a5' a6' >>= \res ->
let {res' = realToFrac res} in
errorCheck a6'>>
return (res')
{-# LINE 1019 "./QuantLib/CashFlow.chs" #-}
couponAccrualStartDates :: (CouponLeg) -> IO (([Day]))
couponAccrualStartDates a1 =
withGenLeg a1 $ \a1' ->
preArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
couponAccrualStartDates'_ a1' a2'1 a2'2 a3' >>
peekDayArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 1022 "./QuantLib/CashFlow.chs" #-}
fixedDividend :: (Double)
-> (Day)
-> IO ((Dividend))
fixedDividend a1 a2 =
let {a1' = realToFrac a1} in
withDay a2 $ \a2' ->
preErrorCheck $ \a3' ->
fixedDividend'_ a1' a2' a3' >>= \res ->
peekDividend res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 1027 "./QuantLib/CashFlow.chs" #-}
fractionalDividendWithNominal :: (Double)
-> (Double)
-> (Day)
-> IO ((Dividend))
fractionalDividendWithNominal a1 a2 a3 =
let {a1' = realToFrac a1} in
let {a2' = realToFrac a2} in
withDay a3 $ \a3' ->
preErrorCheck $ \a4' ->
fractionalDividendWithNominal'_ a1' a2' a3' a4' >>= \res ->
peekDividend res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 1033 "./QuantLib/CashFlow.chs" #-}
fractionalDividend :: (Double)
-> (Day)
-> IO ((Dividend))
fractionalDividend a1 a2 =
let {a1' = realToFrac a1} in
withDay a2 $ \a2' ->
preErrorCheck $ \a3' ->
fractionalDividend'_ a1' a2' a3' >>= \res ->
peekDividend res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 1038 "./QuantLib/CashFlow.chs" #-}
averageBmaLeg :: (Schedule) -> (BMAIndex) -> (NonEmpty Double)
-> (DayCounter) -> (BusinessDayConvention) -> ([Double])
-> ([Double])
-> IO ((Leg))
averageBmaLeg a1 a2 a3 a4 a5 a6 a7 =
withSchedule a1 $ \a1' ->
withBMAIndex a2 $ \a2' ->
withNonEmptyDoubleArray a3 $ \(a3'1, a3'2) ->
withDayCounter a4 $ \a4' ->
let {a5' = fromEnumC a5} in
withDoubleArray a6 $ \(a6'1, a6'2) ->
withDoubleArray a7 $ \(a7'1, a7'2) ->
preErrorCheck $ \a8' ->
averageBmaLeg'_ a1' a2' a3'1 a3'2 a4' a5' a6'1 a6'2 a7'1 a7'2 a8' >>= \res ->
peekLeg res >>= \res' ->
errorCheck a8'>>
return (res')
{-# LINE 1045 "./QuantLib/CashFlow.chs" #-}
fixedRateLeg :: Schedule -> NonEmpty Double -> NonEmpty InterestRate -> BusinessDayConvention -> DayCounter -> Calendar -> IO Leg
fixedRateLeg schedule notionals rates = fixedRateLeg_ schedule notionals (toList rates)
fixedRateLeg_ :: (Schedule) -> (NonEmpty Double)
-> ([InterestRate])
-> (BusinessDayConvention)
-> (DayCounter)
-> (Calendar)
-> IO ((Leg))
fixedRateLeg_ a1 a2 a3 a4 a5 a6 =
withSchedule a1 $ \a1' ->
withNonEmptyDoubleArray a2 $ \(a2'1, a2'2) ->
withInterestRateArray a3 $ \(a3'1, a3'2) ->
let {a4' = fromEnumC a4} in
withDayCounter a5 $ \a5' ->
withCalendar a6 $ \a6' ->
preErrorCheck $ \a7' ->
fixedRateLeg_'_ a1' a2'1 a2'2 a3'1 a3'2 a4' a5' a6' a7' >>= \res ->
peekLeg res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 1055 "./QuantLib/CashFlow.chs" #-}
iborLeg :: Schedule -> GenIborIndex ibor -> NonEmpty Double -> DayCounter -> BusinessDayConvention
-> [Word] -> [Double] -> [Double] -> [Double] -> [Double] -> Bool -> Bool -> IO Leg
iborLeg schedule idx notionals dc adj fixingDays gearings spreads caps floors inArrears zp = do
cal <- calendar Null
iborLeg_ schedule idx notionals dc adj fixingDays gearings spreads caps floors inArrears zp
(ilgPaymentLag defaultIborLegOpts) cal (ilgExCouponPeriod defaultIborLegOpts) cal
(ilgExCouponConvention defaultIborLegOpts) (ilgExCouponEndOfMonth defaultIborLegOpts)
(ilgFixingConvention defaultIborLegOpts) (ilgUseIndexedCoupons defaultIborLegOpts)
iborLegWithOptions :: Schedule -> GenIborIndex ibor -> NonEmpty Double -> DayCounter -> BusinessDayConvention
-> [Word] -> [Double] -> [Double] -> [Double] -> [Double] -> Bool -> Bool -> IborLegOpts
-> IO Leg
iborLegWithOptions :: forall ibor.
Schedule
-> GenIborIndex ibor
-> NonEmpty Double
-> DayCounter
-> BusinessDayConvention
-> [Word]
-> [Double]
-> [Double]
-> [Double]
-> [Double]
-> Bool
-> Bool
-> IborLegOpts
-> IO Leg
iborLegWithOptions Schedule
schedule GenIborIndex ibor
idx NonEmpty Double
notionals DayCounter
dc BusinessDayConvention
adj [Word]
fixingDays [Double]
gearings [Double]
spreads [Double]
caps [Double]
floors Bool
inArrears Bool
zp IborLegOpts
opts = do
cal <- CalendarConstructor -> IO Calendar
calendar CalendarConstructor
Null
iborLeg_ schedule idx notionals dc adj fixingDays gearings spreads caps floors inArrears zp
(ilgPaymentLag opts) (fromMaybe cal (ilgPaymentCalendar opts)) (ilgExCouponPeriod opts)
(fromMaybe cal (ilgExCouponCalendar opts)) (ilgExCouponConvention opts)
(ilgExCouponEndOfMonth opts) (ilgFixingConvention opts) (ilgUseIndexedCoupons opts)
iborLeg_ :: (Schedule) -> (GenIborIndex ibor) -> (NonEmpty Double)
-> (DayCounter) -> (BusinessDayConvention)
-> ([Word])
-> ([Double])
-> ([Double])
-> ([Double])
-> ([Double])
-> (Bool)
-> (Bool)
-> (Int)
-> (Calendar)
-> ((Int,TimeUnit))
-> (Calendar)
-> (BusinessDayConvention)
-> (Bool)
-> (BusinessDayConvention)
-> (Maybe Bool)
-> IO ((Leg))
iborLeg_ :: forall ibor.
Schedule
-> GenIborIndex ibor
-> NonEmpty Double
-> DayCounter
-> BusinessDayConvention
-> [Word]
-> [Double]
-> [Double]
-> [Double]
-> [Double]
-> Bool
-> Bool
-> Int
-> Calendar
-> (Int, TimeUnit)
-> Calendar
-> BusinessDayConvention
-> Bool
-> BusinessDayConvention
-> Maybe Bool
-> IO Leg
iborLeg_ Schedule
a1 GenIborIndex ibor
a2 NonEmpty Double
a3 DayCounter
a4 BusinessDayConvention
a5 [Word]
a6 [Double]
a7 [Double]
a8 [Double]
a9 [Double]
a10 Bool
a11 Bool
a12 Int
a13 Calendar
a14 (Int, TimeUnit)
a15 Calendar
a16 BusinessDayConvention
a17 Bool
a18 BusinessDayConvention
a19 Maybe Bool
a20 =
Schedule -> (Ptr CSchedule -> IO Leg) -> IO Leg
forall b. Schedule -> (Ptr CSchedule -> IO b) -> IO b
withSchedule Schedule
a1 ((Ptr CSchedule -> IO Leg) -> IO Leg)
-> (Ptr CSchedule -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr CSchedule
a1' ->
GenIborIndex ibor -> (Ptr CIborIndex' -> IO Leg) -> IO Leg
forall ibor b.
GenIborIndex ibor -> (Ptr CIborIndex' -> IO b) -> IO b
withIborIndex GenIborIndex ibor
a2 ((Ptr CIborIndex' -> IO Leg) -> IO Leg)
-> (Ptr CIborIndex' -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr CIborIndex'
a2' ->
NonEmpty Double -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. NonEmpty Double -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withNonEmptyDoubleArray NonEmpty Double
a3 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a3'1, Ptr CDouble
a3'2) ->
DayCounter -> (Ptr CDayCounter -> IO Leg) -> IO Leg
forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter DayCounter
a4 ((Ptr CDayCounter -> IO Leg) -> IO Leg)
-> (Ptr CDayCounter -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr CDayCounter
a4' ->
let {a5' :: CInt
a5' = BusinessDayConvention -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC BusinessDayConvention
a5} in
[Word] -> ((CUInt, Ptr CUInt) -> IO Leg) -> IO Leg
forall a n b.
(Integral a, Num n, Storable n) =>
[a] -> ((CUInt, Ptr n) -> IO b) -> IO b
withIntArray [Word]
a6 (((CUInt, Ptr CUInt) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CUInt) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a6'1, Ptr CUInt
a6'2) ->
[Double] -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a7 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a7'1, Ptr CDouble
a7'2) ->
[Double] -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a8 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a8'1, Ptr CDouble
a8'2) ->
[Double] -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a9 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a9'1, Ptr CDouble
a9'2) ->
[Double] -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a10 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a10'1, Ptr CDouble
a10'2) ->
let {a11' :: CInt
a11' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a11} in
let {a12' :: CInt
a12' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a12} in
let {a13' :: CInt
a13' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a13} in
Calendar -> (Ptr CCalendar -> IO Leg) -> IO Leg
forall b. Calendar -> (Ptr CCalendar -> IO b) -> IO b
withCalendar Calendar
a14 ((Ptr CCalendar -> IO Leg) -> IO Leg)
-> (Ptr CCalendar -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr CCalendar
a14' ->
let {(CInt
a15'1, CInt
a15'2) = (Int, TimeUnit) -> (CInt, CInt)
forall a b c.
(Enum a, Integral b, Integral c) =>
(b, a) -> (CInt, c)
fromEnumQuantity (Int, TimeUnit)
a15} in
Calendar -> (Ptr CCalendar -> IO Leg) -> IO Leg
forall b. Calendar -> (Ptr CCalendar -> IO b) -> IO b
withCalendar Calendar
a16 ((Ptr CCalendar -> IO Leg) -> IO Leg)
-> (Ptr CCalendar -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr CCalendar
a16' ->
let {a17' :: CInt
a17' = BusinessDayConvention -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC BusinessDayConvention
a17} in
let {a18' :: CInt
a18' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a18} in
let {a19' :: CInt
a19' = BusinessDayConvention -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC BusinessDayConvention
a19} in
let {a20' :: CInt
a20' = Maybe Bool -> CInt
fromMaybeBool Maybe Bool
a20} in
(Ptr (Ptr CChar) -> IO Leg) -> IO Leg
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Leg) -> IO Leg)
-> (Ptr (Ptr CChar) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a21' ->
Ptr CSchedule
-> Ptr CIborIndex'
-> CUInt
-> Ptr CDouble
-> Ptr CDayCounter
-> CInt
-> CUInt
-> Ptr CUInt
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> CInt
-> CInt
-> CInt
-> Ptr CCalendar
-> CInt
-> CInt
-> Ptr CCalendar
-> CInt
-> CInt
-> CInt
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CLeg')
iborLeg_'_ Ptr CSchedule
a1' Ptr CIborIndex'
a2' CUInt
a3'1 Ptr CDouble
a3'2 Ptr CDayCounter
a4' CInt
a5' CUInt
a6'1 Ptr CUInt
a6'2 CUInt
a7'1 Ptr CDouble
a7'2 CUInt
a8'1 Ptr CDouble
a8'2 CUInt
a9'1 Ptr CDouble
a9'2 CUInt
a10'1 Ptr CDouble
a10'2 CInt
a11' CInt
a12' CInt
a13' Ptr CCalendar
a14' CInt
a15'1 CInt
a15'2 Ptr CCalendar
a16' CInt
a17' CInt
a18' CInt
a19' CInt
a20' Ptr (Ptr CChar)
a21' IO (Ptr CLeg') -> (Ptr CLeg' -> IO Leg) -> IO Leg
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CLeg'
res ->
Ptr CLeg' -> IO Leg
peekLeg Ptr CLeg'
res IO Leg -> (Leg -> IO Leg) -> IO Leg
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Leg
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a21'IO () -> IO Leg -> IO Leg
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Leg -> IO Leg
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Leg
res')
{-# LINE 1100 "./QuantLib/CashFlow.chs" #-}
cmsLeg :: Schedule -> GenSwapIndex sidx -> NonEmpty Double -> DayCounter -> BusinessDayConvention
-> [Word] -> [Double] -> [Double] -> [Double] -> [Double] -> Bool -> Bool -> IO Leg
cmsLeg schedule idx notionals dc adj fixingDays gearings spreads caps floors inArrears zp = do
cal <- calendar Null
cmsLeg_ schedule idx notionals dc adj fixingDays gearings spreads caps floors inArrears zp
(cmslExCouponPeriod defaultCmsLegOpts) cal (cmslExCouponConvention defaultCmsLegOpts)
(cmslExCouponEndOfMonth defaultCmsLegOpts) (cmslFixingConvention defaultCmsLegOpts)
cmsLegWithOptions :: Schedule -> GenSwapIndex sidx -> NonEmpty Double -> DayCounter -> BusinessDayConvention
-> [Word] -> [Double] -> [Double] -> [Double] -> [Double] -> Bool -> Bool -> CmsLegOpts
-> IO Leg
cmsLegWithOptions schedule idx notionals dc adj fixingDays gearings spreads caps floors inArrears zp opts = do
cal <- calendar Null
cmsLeg_ schedule idx notionals dc adj fixingDays gearings spreads caps floors inArrears zp
(cmslExCouponPeriod opts) (fromMaybe cal (cmslExCouponCalendar opts))
(cmslExCouponConvention opts) (cmslExCouponEndOfMonth opts) (cmslFixingConvention opts)
cmsLeg_ :: (Schedule) -> (GenSwapIndex sidx) -> (NonEmpty Double)
-> (DayCounter) -> (BusinessDayConvention)
-> ([Word])
-> ([Double])
-> ([Double])
-> ([Double])
-> ([Double])
-> (Bool)
-> (Bool)
-> ((Int,TimeUnit))
-> (Calendar)
-> (BusinessDayConvention)
-> (Bool)
-> (BusinessDayConvention)
-> IO ((Leg))
cmsLeg_ :: forall sidx.
Schedule
-> GenSwapIndex sidx
-> NonEmpty Double
-> DayCounter
-> BusinessDayConvention
-> [Word]
-> [Double]
-> [Double]
-> [Double]
-> [Double]
-> Bool
-> Bool
-> (Int, TimeUnit)
-> Calendar
-> BusinessDayConvention
-> Bool
-> BusinessDayConvention
-> IO Leg
cmsLeg_ Schedule
a1 GenSwapIndex sidx
a2 NonEmpty Double
a3 DayCounter
a4 BusinessDayConvention
a5 [Word]
a6 [Double]
a7 [Double]
a8 [Double]
a9 [Double]
a10 Bool
a11 Bool
a12 (Int, TimeUnit)
a13 Calendar
a14 BusinessDayConvention
a15 Bool
a16 BusinessDayConvention
a17 =
Schedule -> (Ptr CSchedule -> IO Leg) -> IO Leg
forall b. Schedule -> (Ptr CSchedule -> IO b) -> IO b
withSchedule Schedule
a1 ((Ptr CSchedule -> IO Leg) -> IO Leg)
-> (Ptr CSchedule -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr CSchedule
a1' ->
GenSwapIndex sidx -> (Ptr CSwapIndex' -> IO Leg) -> IO Leg
forall sidx b.
GenSwapIndex sidx -> (Ptr CSwapIndex' -> IO b) -> IO b
withSwapIndex GenSwapIndex sidx
a2 ((Ptr CSwapIndex' -> IO Leg) -> IO Leg)
-> (Ptr CSwapIndex' -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr CSwapIndex'
a2' ->
NonEmpty Double -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. NonEmpty Double -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withNonEmptyDoubleArray NonEmpty Double
a3 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a3'1, Ptr CDouble
a3'2) ->
DayCounter -> (Ptr CDayCounter -> IO Leg) -> IO Leg
forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter DayCounter
a4 ((Ptr CDayCounter -> IO Leg) -> IO Leg)
-> (Ptr CDayCounter -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr CDayCounter
a4' ->
let {a5' :: CInt
a5' = BusinessDayConvention -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC BusinessDayConvention
a5} in
[Word] -> ((CUInt, Ptr CUInt) -> IO Leg) -> IO Leg
forall a n b.
(Integral a, Num n, Storable n) =>
[a] -> ((CUInt, Ptr n) -> IO b) -> IO b
withIntArray [Word]
a6 (((CUInt, Ptr CUInt) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CUInt) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a6'1, Ptr CUInt
a6'2) ->
[Double] -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a7 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a7'1, Ptr CDouble
a7'2) ->
[Double] -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a8 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a8'1, Ptr CDouble
a8'2) ->
[Double] -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a9 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a9'1, Ptr CDouble
a9'2) ->
[Double] -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a10 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a10'1, Ptr CDouble
a10'2) ->
let {a11' :: CInt
a11' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a11} in
let {a12' :: CInt
a12' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a12} in
let {(CInt
a13'1, CInt
a13'2) = (Int, TimeUnit) -> (CInt, CInt)
forall a b c.
(Enum a, Integral b, Integral c) =>
(b, a) -> (CInt, c)
fromEnumQuantity (Int, TimeUnit)
a13} in
Calendar -> (Ptr CCalendar -> IO Leg) -> IO Leg
forall b. Calendar -> (Ptr CCalendar -> IO b) -> IO b
withCalendar Calendar
a14 ((Ptr CCalendar -> IO Leg) -> IO Leg)
-> (Ptr CCalendar -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr CCalendar
a14' ->
let {a15' :: CInt
a15' = BusinessDayConvention -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC BusinessDayConvention
a15} in
let {a16' :: CInt
a16' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a16} in
let {a17' :: CInt
a17' = BusinessDayConvention -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC BusinessDayConvention
a17} in
(Ptr (Ptr CChar) -> IO Leg) -> IO Leg
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Leg) -> IO Leg)
-> (Ptr (Ptr CChar) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a18' ->
Ptr CSchedule
-> Ptr CSwapIndex'
-> CUInt
-> Ptr CDouble
-> Ptr CDayCounter
-> CInt
-> CUInt
-> Ptr CUInt
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> CInt
-> CInt
-> CInt
-> CInt
-> Ptr CCalendar
-> CInt
-> CInt
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CLeg')
cmsLeg_'_ Ptr CSchedule
a1' Ptr CSwapIndex'
a2' CUInt
a3'1 Ptr CDouble
a3'2 Ptr CDayCounter
a4' CInt
a5' CUInt
a6'1 Ptr CUInt
a6'2 CUInt
a7'1 Ptr CDouble
a7'2 CUInt
a8'1 Ptr CDouble
a8'2 CUInt
a9'1 Ptr CDouble
a9'2 CUInt
a10'1 Ptr CDouble
a10'2 CInt
a11' CInt
a12' CInt
a13'1 CInt
a13'2 Ptr CCalendar
a14' CInt
a15' CInt
a16' CInt
a17' Ptr (Ptr CChar)
a18' IO (Ptr CLeg') -> (Ptr CLeg' -> IO Leg) -> IO Leg
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CLeg'
res ->
Ptr CLeg' -> IO Leg
peekLeg Ptr CLeg'
res IO Leg -> (Leg -> IO Leg) -> IO Leg
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Leg
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a18'IO () -> IO Leg -> IO Leg
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Leg -> IO Leg
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Leg
res')
{-# LINE 1138 "./QuantLib/CashFlow.chs" #-}
overnightLeg :: (Schedule) -> (OvernightIborIndex) -> (NonEmpty Double)
-> (DayCounter) -> (BusinessDayConvention) -> ([Double])
-> ([Double])
-> IO ((Leg))
overnightLeg a1 a2 a3 a4 a5 a6 a7 =
withSchedule a1 $ \a1' ->
withOvernightIborIndex a2 $ \a2' ->
withNonEmptyDoubleArray a3 $ \(a3'1, a3'2) ->
withDayCounter a4 $ \a4' ->
let {a5' = fromEnumC a5} in
withDoubleArray a6 $ \(a6'1, a6'2) ->
withDoubleArray a7 $ \(a7'1, a7'2) ->
preErrorCheck $ \a8' ->
overnightLeg'_ a1' a2' a3'1 a3'2 a4' a5' a6'1 a6'2 a7'1 a7'2 a8' >>= \res ->
peekLeg res >>= \res' ->
errorCheck a8'>>
return (res')
{-# LINE 1144 "./QuantLib/CashFlow.chs" #-}
rangeAccrualLeg :: (Schedule) -> (GenIborIndex ibor) -> (NonEmpty Double)
-> (DayCounter) -> (BusinessDayConvention) -> ([Word])
-> ([Double])
-> ([Double])
-> ([Double])
-> ([Double])
-> ((Int,TimeUnit))
-> (BusinessDayConvention) -> IO ((Leg))
rangeAccrualLeg a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 =
withSchedule a1 $ \a1' ->
withIborIndex a2 $ \a2' ->
withNonEmptyDoubleArray a3 $ \(a3'1, a3'2) ->
withDayCounter a4 $ \a4' ->
let {a5' = fromEnumC a5} in
withIntArray a6 $ \(a6'1, a6'2) ->
withDoubleArray a7 $ \(a7'1, a7'2) ->
withDoubleArray a8 $ \(a8'1, a8'2) ->
withDoubleArray a9 $ \(a9'1, a9'2) ->
withDoubleArray a10 $ \(a10'1, a10'2) ->
let {(a11'1, a11'2) = fromEnumQuantity a11} in
let {a12' = fromEnumC a12} in
preErrorCheck $ \a13' ->
rangeAccrualLeg'_ a1' a2' a3'1 a3'2 a4' a5' a6'1 a6'2 a7'1 a7'2 a8'1 a8'2 a9'1 a9'2 a10'1 a10'2 a11'1 a11'2 a12' a13' >>= \res ->
peekLeg res >>= \res' ->
errorCheck a13'>>
return (res')
{-# LINE 1154 "./QuantLib/CashFlow.chs" #-}
cpiLeg :: (Schedule) -> (ZeroInflationIndex) -> (Double)
-> ((Word,TimeUnit))
-> (NonEmpty Double)
-> (NonEmpty Double)
-> (DayCounter)
-> (BusinessDayConvention)
-> (Calendar)
-> (CPIInterpolationType)
-> (Bool)
-> IO ((Leg))
cpiLeg a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
withSchedule a1 $ \a1' ->
withZeroInflationIndex a2 $ \a2' ->
let {a3' = realToFrac a3} in
let {(a4'1, a4'2) = fromEnumQuantity a4} in
withNonEmptyDoubleArray a5 $ \(a5'1, a5'2) ->
withNonEmptyDoubleArray a6 $ \(a6'1, a6'2) ->
withDayCounter a7 $ \a7' ->
let {a8' = fromEnumC a8} in
withCalendar a9 $ \a9' ->
let {a10' = fromEnumC a10} in
let {a11' = C2HSImp.fromBool a11} in
preErrorCheck $ \a12' ->
cpiLeg'_ a1' a2' a3' a4'1 a4'2 a5'1 a5'2 a6'1 a6'2 a7' a8' a9' a10' a11' a12' >>= \res ->
peekLeg res >>= \res' ->
errorCheck a12'>>
return (res')
{-# LINE 1169 "./QuantLib/CashFlow.chs" #-}
yoyInflationLeg :: (Schedule) -> (Calendar) -> (YoYInflationIndex) -> ((Word,TimeUnit))
-> (CPIInterpolationType)
-> (NonEmpty Double)
-> (DayCounter)
-> (BusinessDayConvention)
-> ([Word])
-> ([Double])
-> ([Double])
-> ([Double])
-> ([Double])
-> IO ((Leg))
yoyInflationLeg :: Schedule
-> Calendar
-> YoYInflationIndex
-> (Word, TimeUnit)
-> CPIInterpolationType
-> NonEmpty Double
-> DayCounter
-> BusinessDayConvention
-> [Word]
-> [Double]
-> [Double]
-> [Double]
-> [Double]
-> IO Leg
yoyInflationLeg Schedule
a1 Calendar
a2 YoYInflationIndex
a3 (Word, TimeUnit)
a4 CPIInterpolationType
a5 NonEmpty Double
a6 DayCounter
a7 BusinessDayConvention
a8 [Word]
a9 [Double]
a10 [Double]
a11 [Double]
a12 [Double]
a13 =
Schedule -> (Ptr CSchedule -> IO Leg) -> IO Leg
forall b. Schedule -> (Ptr CSchedule -> IO b) -> IO b
withSchedule Schedule
a1 ((Ptr CSchedule -> IO Leg) -> IO Leg)
-> (Ptr CSchedule -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr CSchedule
a1' ->
Calendar -> (Ptr CCalendar -> IO Leg) -> IO Leg
forall b. Calendar -> (Ptr CCalendar -> IO b) -> IO b
withCalendar Calendar
a2 ((Ptr CCalendar -> IO Leg) -> IO Leg)
-> (Ptr CCalendar -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr CCalendar
a2' ->
YoYInflationIndex -> (Ptr CYoYInflationIndex' -> IO Leg) -> IO Leg
forall yidx b.
GenYoYInflationIndex yidx
-> (Ptr CYoYInflationIndex' -> IO b) -> IO b
withYoYInflationIndex YoYInflationIndex
a3 ((Ptr CYoYInflationIndex' -> IO Leg) -> IO Leg)
-> (Ptr CYoYInflationIndex' -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr CYoYInflationIndex'
a3' ->
let {(CInt
a4'1, CInt
a4'2) = (Word, TimeUnit) -> (CInt, CInt)
forall a b c.
(Enum a, Integral b, Integral c) =>
(b, a) -> (CInt, c)
fromEnumQuantity (Word, TimeUnit)
a4} in
let {a5' :: CInt
a5' = CPIInterpolationType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC CPIInterpolationType
a5} in
NonEmpty Double -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. NonEmpty Double -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withNonEmptyDoubleArray NonEmpty Double
a6 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a6'1, Ptr CDouble
a6'2) ->
DayCounter -> (Ptr CDayCounter -> IO Leg) -> IO Leg
forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter DayCounter
a7 ((Ptr CDayCounter -> IO Leg) -> IO Leg)
-> (Ptr CDayCounter -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr CDayCounter
a7' ->
let {a8' :: CInt
a8' = BusinessDayConvention -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC BusinessDayConvention
a8} in
[Word] -> ((CUInt, Ptr CUInt) -> IO Leg) -> IO Leg
forall a n b.
(Integral a, Num n, Storable n) =>
[a] -> ((CUInt, Ptr n) -> IO b) -> IO b
withIntArray [Word]
a9 (((CUInt, Ptr CUInt) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CUInt) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a9'1, Ptr CUInt
a9'2) ->
[Double] -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a10 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a10'1, Ptr CDouble
a10'2) ->
[Double] -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a11 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a11'1, Ptr CDouble
a11'2) ->
[Double] -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a12 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a12'1, Ptr CDouble
a12'2) ->
[Double] -> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall b. [Double] -> ((CUInt, Ptr CDouble) -> IO b) -> IO b
withDoubleArray [Double]
a13 (((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg)
-> ((CUInt, Ptr CDouble) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \(CUInt
a13'1, Ptr CDouble
a13'2) ->
(Ptr (Ptr CChar) -> IO Leg) -> IO Leg
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Leg) -> IO Leg)
-> (Ptr (Ptr CChar) -> IO Leg) -> IO Leg
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a14' ->
Ptr CSchedule
-> Ptr CCalendar
-> Ptr CYoYInflationIndex'
-> CInt
-> CInt
-> CInt
-> CUInt
-> Ptr CDouble
-> Ptr CDayCounter
-> CInt
-> CUInt
-> Ptr CUInt
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> CUInt
-> Ptr CDouble
-> Ptr (Ptr CChar)
-> IO (Ptr CLeg')
yoyInflationLeg'_ Ptr CSchedule
a1' Ptr CCalendar
a2' Ptr CYoYInflationIndex'
a3' CInt
a4'1 CInt
a4'2 CInt
a5' CUInt
a6'1 Ptr CDouble
a6'2 Ptr CDayCounter
a7' CInt
a8' CUInt
a9'1 Ptr CUInt
a9'2 CUInt
a10'1 Ptr CDouble
a10'2 CUInt
a11'1 Ptr CDouble
a11'2 CUInt
a12'1 Ptr CDouble
a12'2 CUInt
a13'1 Ptr CDouble
a13'2 Ptr (Ptr CChar)
a14' IO (Ptr CLeg') -> (Ptr CLeg' -> IO Leg) -> IO Leg
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CLeg'
res ->
Ptr CLeg' -> IO Leg
peekLeg Ptr CLeg'
res IO Leg -> (Leg -> IO Leg) -> IO Leg
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Leg
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a14'IO () -> IO Leg -> IO Leg
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Leg -> IO Leg
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Leg
res')
{-# LINE 1191 "./QuantLib/CashFlow.chs" #-}
{-# LINE 1192 "./QuantLib/CashFlow.chs" #-}
zeroInflationCashFlow :: (Double)
-> (ZeroInflationIndex) -> (CPIInterpolationType)
-> (Day)
-> (Day)
-> ((Word,TimeUnit))
-> (Day)
-> (Bool)
-> IO ((ZeroInflationCashFlow))
zeroInflationCashFlow a1 a2 a3 a4 a5 a6 a7 a8 =
let {a1' = realToFrac a1} in
withZeroInflationIndex a2 $ \a2' ->
let {a3' = fromEnumC a3} in
withDay a4 $ \a4' ->
withDay a5 $ \a5' ->
let {(a6'1, a6'2) = fromEnumQuantity a6} in
withDay a7 $ \a7' ->
let {a8' = C2HSImp.fromBool a8} in
preErrorCheck $ \a9' ->
zeroInflationCashFlow'_ a1' a2' a3' a4' a5' a6'1 a6'2 a7' a8' a9' >>= \res ->
peekZeroInflationCashFlow res >>= \res' ->
errorCheck a9'>>
return (res')
{-# LINE 1204 "./QuantLib/CashFlow.chs" #-}
cpiCashFlow :: (Double)
-> (ZeroInflationIndex) -> (Maybe Day)
-> (Maybe Double)
-> (Day)
-> ((Word,TimeUnit))
-> (CPIInterpolationType)
-> (Day)
-> (Bool)
-> IO ((CPICashFlow))
cpiCashFlow a1 a2 a3 a4 a5 a6 a7 a8 a9 =
let {a1' = realToFrac a1} in
withZeroInflationIndex a2 $ \a2' ->
withMaybeDay a3 $ \a3' ->
let {a4' = fromMaybeDouble a4} in
withDay a5 $ \a5' ->
let {(a6'1, a6'2) = fromEnumQuantity a6} in
let {a7' = fromEnumC a7} in
withDay a8 $ \a8' ->
let {a9' = C2HSImp.fromBool a9} in
preErrorCheck $ \a10' ->
cpiCashFlow'_ a1' a2' a3' a4' a5' a6'1 a6'2 a7' a8' a9' a10' >>= \res ->
peekCPICashFlow res >>= \res' ->
errorCheck a10'>>
return (res')
{-# LINE 1217 "./QuantLib/CashFlow.chs" #-}
equityCashFlow :: (Double)
-> (EquityIndex) -> (Day)
-> (Day)
-> (Day)
-> (Bool)
-> IO ((EquityCashFlow))
equityCashFlow a1 a2 a3 a4 a5 a6 =
let {a1' = realToFrac a1} in
withEquityIndex a2 $ \a2' ->
withDay a3 $ \a3' ->
withDay a4 $ \a4' ->
withDay a5 $ \a5' ->
let {a6' = C2HSImp.fromBool a6} in
preErrorCheck $ \a7' ->
equityCashFlow'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekEquityCashFlow res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 1230 "./QuantLib/CashFlow.chs" #-}
setEquityCashFlowPricer :: (EquityCashFlow) -> (EquityCashFlowPricer) -> IO ()
setEquityCashFlowPricer a1 a2 =
withEquityCashFlow a1 $ \a1' ->
withEquityCashFlowPricer a2 $ \a2' ->
preErrorCheck $ \a3' ->
setEquityCashFlowPricer'_ a1' a2' a3' >>
errorCheck a3'>>
return ()
{-# LINE 1234 "./QuantLib/CashFlow.chs" #-}
equityQuantoCashFlowPricer :: (GenYieldTermStructure y)
-> (GenBlackVolTermStructure bv1)
-> (GenBlackVolTermStructure bv2)
-> (GenQuote q)
-> IO ((EquityCashFlowPricer))
equityQuantoCashFlowPricer :: forall y bv1 bv2 q.
GenYieldTermStructure y
-> GenBlackVolTermStructure bv1
-> GenBlackVolTermStructure bv2
-> GenQuote q
-> IO EquityCashFlowPricer
equityQuantoCashFlowPricer GenYieldTermStructure y
a1 GenBlackVolTermStructure bv1
a2 GenBlackVolTermStructure bv2
a3 GenQuote q
a4 =
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure GenYieldTermStructure y
a1 ((Ptr CYieldTermStructure' -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer)
-> (Ptr CYieldTermStructure' -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a1' ->
GenBlackVolTermStructure bv1
-> (Ptr CBlackVolTermStructure' -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer
forall bv b.
GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO b) -> IO b
withBlackVolTermStructure GenBlackVolTermStructure bv1
a2 ((Ptr CBlackVolTermStructure' -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer)
-> (Ptr CBlackVolTermStructure' -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer
forall a b. (a -> b) -> a -> b
$ \Ptr CBlackVolTermStructure'
a2' ->
GenBlackVolTermStructure bv2
-> (Ptr CBlackVolTermStructure' -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer
forall bv b.
GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO b) -> IO b
withBlackVolTermStructure GenBlackVolTermStructure bv2
a3 ((Ptr CBlackVolTermStructure' -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer)
-> (Ptr CBlackVolTermStructure' -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer
forall a b. (a -> b) -> a -> b
$ \Ptr CBlackVolTermStructure'
a3' ->
GenQuote q
-> (Ptr CQuote' -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q
a4 ((Ptr CQuote' -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer)
-> (Ptr CQuote' -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a4' ->
(Ptr (Ptr CChar) -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer)
-> (Ptr (Ptr CChar) -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a5' ->
Ptr CYieldTermStructure'
-> Ptr CBlackVolTermStructure'
-> Ptr CBlackVolTermStructure'
-> Ptr CQuote'
-> Ptr (Ptr CChar)
-> IO (Ptr CEquityCashFlowPricer)
equityQuantoCashFlowPricer'_ Ptr CYieldTermStructure'
a1' Ptr CBlackVolTermStructure'
a2' Ptr CBlackVolTermStructure'
a3' Ptr CQuote'
a4' Ptr (Ptr CChar)
a5' IO (Ptr CEquityCashFlowPricer)
-> (Ptr CEquityCashFlowPricer -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CEquityCashFlowPricer
res ->
Ptr CEquityCashFlowPricer -> IO EquityCashFlowPricer
peekEquityCashFlowPricer Ptr CEquityCashFlowPricer
res IO EquityCashFlowPricer
-> (EquityCashFlowPricer -> IO EquityCashFlowPricer)
-> IO EquityCashFlowPricer
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \EquityCashFlowPricer
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a5'IO () -> IO EquityCashFlowPricer -> IO EquityCashFlowPricer
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
EquityCashFlowPricer -> IO EquityCashFlowPricer
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (EquityCashFlowPricer
res')
{-# LINE 1242 "./QuantLib/CashFlow.chs" #-}
setEquityLegPricer :: (GenLeg l) -> (EquityCashFlowPricer) -> IO ()
setEquityLegPricer a1 a2 =
withLeg a1 $ \a1' ->
withEquityCashFlowPricer a2 $ \a2' ->
preErrorCheck $ \a3' ->
setEquityLegPricer'_ a1' a2' a3' >>
errorCheck a3'>>
return ()
{-# LINE 1246 "./QuantLib/CashFlow.chs" #-}
toCouponLeg :: (GenLeg l) -> IO ((CouponLeg))
toCouponLeg a1 =
withLeg a1 $ \a1' ->
preErrorCheck $ \a2' ->
toCouponLeg'_ a1' a2' >>= \res ->
peekCouponLeg res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 1249 "./QuantLib/CashFlow.chs" #-}
coupons :: (CouponLeg)
-> IO (([Coupon]))
coupons a1 =
withGenLeg a1 $ \a1' ->
preArray $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
coupons'_ a1' a2'1 a2'2 a3' >>
peekCouponArray a2'1 a2'2>>= \a2'' ->
errorCheck a3'>>
return (a2'')
{-# LINE 1254 "./QuantLib/CashFlow.chs" #-}
blackIborCouponPricer :: (GenOptionletVolatilityStructure ov) -> (TimingAdjustment) -> (Maybe (GenQuote q))
-> (Maybe Bool)
-> IO ((FloatingRateCouponPricer))
blackIborCouponPricer a1 a2 a3 a4 =
withOptionletVolatilityStructure a1 $ \a1' ->
let {a2' = (fromIntegral . fromEnum) a2} in
withMaybeQuote a3 $ \a3' ->
let {a4' = fromMaybeBool a4} in
preErrorCheck $ \a5' ->
blackIborCouponPricer'_ a1' a2' a3' a4' a5' >>= \res ->
peekFloatingRateCouponPricer res >>= \res' ->
errorCheck a5'>>
return (res')
{-# LINE 1261 "./QuantLib/CashFlow.chs" #-}
blackIborQuantoCouponPricer :: (GenBlackVolTermStructure bv)
-> (GenQuote q)
-> (GenOptionletVolatilityStructure ov)
-> IO ((FloatingRateCouponPricer))
blackIborQuantoCouponPricer :: forall bv q ov.
GenBlackVolTermStructure bv
-> GenQuote q
-> GenOptionletVolatilityStructure ov
-> IO FloatingRateCouponPricer
blackIborQuantoCouponPricer GenBlackVolTermStructure bv
a1 GenQuote q
a2 GenOptionletVolatilityStructure ov
a3 =
GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO FloatingRateCouponPricer)
-> IO FloatingRateCouponPricer
forall bv b.
GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO b) -> IO b
withBlackVolTermStructure GenBlackVolTermStructure bv
a1 ((Ptr CBlackVolTermStructure' -> IO FloatingRateCouponPricer)
-> IO FloatingRateCouponPricer)
-> (Ptr CBlackVolTermStructure' -> IO FloatingRateCouponPricer)
-> IO FloatingRateCouponPricer
forall a b. (a -> b) -> a -> b
$ \Ptr CBlackVolTermStructure'
a1' ->
GenQuote q
-> (Ptr CQuote' -> IO FloatingRateCouponPricer)
-> IO FloatingRateCouponPricer
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q
a2 ((Ptr CQuote' -> IO FloatingRateCouponPricer)
-> IO FloatingRateCouponPricer)
-> (Ptr CQuote' -> IO FloatingRateCouponPricer)
-> IO FloatingRateCouponPricer
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a2' ->
GenOptionletVolatilityStructure ov
-> (Ptr COptionletVolatilityStructure'
-> IO FloatingRateCouponPricer)
-> IO FloatingRateCouponPricer
forall ov b.
GenOptionletVolatilityStructure ov
-> (Ptr COptionletVolatilityStructure' -> IO b) -> IO b
withOptionletVolatilityStructure GenOptionletVolatilityStructure ov
a3 ((Ptr COptionletVolatilityStructure'
-> IO FloatingRateCouponPricer)
-> IO FloatingRateCouponPricer)
-> (Ptr COptionletVolatilityStructure'
-> IO FloatingRateCouponPricer)
-> IO FloatingRateCouponPricer
forall a b. (a -> b) -> a -> b
$ \Ptr COptionletVolatilityStructure'
a3' ->
(Ptr (Ptr CChar) -> IO FloatingRateCouponPricer)
-> IO FloatingRateCouponPricer
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO FloatingRateCouponPricer)
-> IO FloatingRateCouponPricer)
-> (Ptr (Ptr CChar) -> IO FloatingRateCouponPricer)
-> IO FloatingRateCouponPricer
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a4' ->
Ptr CBlackVolTermStructure'
-> Ptr CQuote'
-> Ptr COptionletVolatilityStructure'
-> Ptr (Ptr CChar)
-> IO (Ptr CFloatingRateCouponPricer')
blackIborQuantoCouponPricer'_ Ptr CBlackVolTermStructure'
a1' Ptr CQuote'
a2' Ptr COptionletVolatilityStructure'
a3' Ptr (Ptr CChar)
a4' IO (Ptr CFloatingRateCouponPricer')
-> (Ptr CFloatingRateCouponPricer' -> IO FloatingRateCouponPricer)
-> IO FloatingRateCouponPricer
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CFloatingRateCouponPricer'
res ->
Ptr CFloatingRateCouponPricer' -> IO FloatingRateCouponPricer
peekFloatingRateCouponPricer Ptr CFloatingRateCouponPricer'
res IO FloatingRateCouponPricer
-> (FloatingRateCouponPricer -> IO FloatingRateCouponPricer)
-> IO FloatingRateCouponPricer
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \FloatingRateCouponPricer
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a4'IO () -> IO FloatingRateCouponPricer -> IO FloatingRateCouponPricer
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
FloatingRateCouponPricer -> IO FloatingRateCouponPricer
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (FloatingRateCouponPricer
res')
{-# LINE 1271 "./QuantLib/CashFlow.chs" #-}
rangeAccrualPricerByBgm :: (Double)
-> (SmileSection)
-> (SmileSection)
-> (Bool)
-> (Bool)
-> IO ((FloatingRateCouponPricer))
rangeAccrualPricerByBgm a1 a2 a3 a4 a5 =
let {a1' = realToFrac a1} in
withSmileSection a2 $ \a2' ->
withSmileSection a3 $ \a3' ->
let {a4' = C2HSImp.fromBool a4} in
let {a5' = C2HSImp.fromBool a5} in
preErrorCheck $ \a6' ->
rangeAccrualPricerByBgm'_ a1' a2' a3' a4' a5' a6' >>= \res ->
peekFloatingRateCouponPricer res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 1279 "./QuantLib/CashFlow.chs" #-}
blackYoyInflationCouponPricer :: (YoYOptionletVolatilitySurface) -> (GenYieldTermStructure y)
-> IO ((YoYInflationCouponPricer))
blackYoyInflationCouponPricer a1 a2 =
withGenVolatilityTermStructure a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
preErrorCheck $ \a3' ->
blackYoyInflationCouponPricer'_ a1' a2' a3' >>= \res ->
peekYoYInflationCouponPricer res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 1284 "./QuantLib/CashFlow.chs" #-}
unitDisplacedBlackYoyInflationCouponPricer :: (YoYOptionletVolatilitySurface) -> (GenYieldTermStructure y)
-> IO ((YoYInflationCouponPricer))
unitDisplacedBlackYoyInflationCouponPricer a1 a2 =
withGenVolatilityTermStructure a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
preErrorCheck $ \a3' ->
unitDisplacedBlackYoyInflationCouponPricer'_ a1' a2' a3' >>= \res ->
peekYoYInflationCouponPricer res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 1289 "./QuantLib/CashFlow.chs" #-}
bachelierYoyInflationCouponPricer :: (YoYOptionletVolatilitySurface) -> (GenYieldTermStructure y)
-> IO ((YoYInflationCouponPricer))
bachelierYoyInflationCouponPricer a1 a2 =
withGenVolatilityTermStructure a1 $ \a1' ->
withYieldTermStructure a2 $ \a2' ->
preErrorCheck $ \a3' ->
bachelierYoyInflationCouponPricer'_ a1' a2' a3' >>= \res ->
peekYoYInflationCouponPricer res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 1294 "./QuantLib/CashFlow.chs" #-}
setYoyInflationCouponPricer :: (GenLeg l) -> (YoYInflationCouponPricer) -> IO ()
setYoyInflationCouponPricer a1 a2 =
withLeg a1 $ \a1' ->
withYoYInflationCouponPricer a2 $ \a2' ->
preErrorCheck $ \a3' ->
setYoyInflationCouponPricer'_ a1' a2' a3' >>
errorCheck a3'>>
return ()
{-# LINE 1301 "./QuantLib/CashFlow.chs" #-}
setCouponPricer :: (GenLeg l) -> (GenFloatingRateCouponPricer frcp) -> IO ()
setCouponPricer a1 a2 =
withLeg a1 $ \a1' ->
withFloatingRateCouponPricer a2 $ \a2' ->
preErrorCheck $ \a3' ->
setCouponPricer'_ a1' a2' a3' >>
errorCheck a3'>>
return ()
{-# LINE 1304 "./QuantLib/CashFlow.chs" #-}
setCouponPricers :: (GenLeg l) -> ([GenFloatingRateCouponPricer frcp]) -> IO ()
setCouponPricers a1 a2 =
withLeg a1 $ \a1' ->
withFloatingRateCouponPricerArray a2 $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
setCouponPricers'_ a1' a2'1 a2'2 a3' >>
errorCheck a3'>>
return ()
{-# LINE 1308 "./QuantLib/CashFlow.chs" #-}
swapletRate :: (GenFloatingRateCouponPricer frcp) -> IO ((Double))
swapletRate a1 =
withFloatingRateCouponPricer a1 $ \a1' ->
preErrorCheck $ \a2' ->
swapletRate'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 1311 "./QuantLib/CashFlow.chs" #-}
swapletPrice :: (GenFloatingRateCouponPricer frcp) -> IO ((Double))
swapletPrice a1 =
withFloatingRateCouponPricer a1 $ \a1' ->
preErrorCheck $ \a2' ->
swapletPrice'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 1315 "./QuantLib/CashFlow.chs" #-}
capletPrice :: (GenFloatingRateCouponPricer frcp) -> (Double)
-> IO ((Double))
capletPrice a1 a2 =
withFloatingRateCouponPricer a1 $ \a1' ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
capletPrice'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 1320 "./QuantLib/CashFlow.chs" #-}
capletRate :: (GenFloatingRateCouponPricer frcp) -> (Double)
-> IO ((Double))
capletRate a1 a2 =
withFloatingRateCouponPricer a1 $ \a1' ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
capletRate'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 1325 "./QuantLib/CashFlow.chs" #-}
floorletPrice :: (GenFloatingRateCouponPricer frcp) -> (Double)
-> IO ((Double))
floorletPrice a1 a2 =
withFloatingRateCouponPricer a1 $ \a1' ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
floorletPrice'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 1330 "./QuantLib/CashFlow.chs" #-}
floorletRate :: (GenFloatingRateCouponPricer frcp) -> (Double)
-> IO ((Double))
floorletRate a1 a2 =
withFloatingRateCouponPricer a1 $ \a1' ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
floorletRate'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 1335 "./QuantLib/CashFlow.chs" #-}
cmsCoupon :: (Day)
-> (Double)
-> (Day)
-> (Day)
-> (Word)
-> (GenSwapIndex sidx)
-> (Double)
-> (Double)
-> (Maybe Day)
-> (Maybe Day)
-> (DayCounter)
-> (Bool)
-> (Maybe Day)
-> (BusinessDayConvention)
-> IO ((CmsCoupon))
cmsCoupon :: forall sidx.
Day
-> Double
-> Day
-> Day
-> Word
-> GenSwapIndex sidx
-> Double
-> Double
-> Maybe Day
-> Maybe Day
-> DayCounter
-> Bool
-> Maybe Day
-> BusinessDayConvention
-> IO CmsCoupon
cmsCoupon Day
a1 Double
a2 Day
a3 Day
a4 Word
a5 GenSwapIndex sidx
a6 Double
a7 Double
a8 Maybe Day
a9 Maybe Day
a10 DayCounter
a11 Bool
a12 Maybe Day
a13 BusinessDayConvention
a14 =
Day -> (CInt -> IO CmsCoupon) -> IO CmsCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a1 ((CInt -> IO CmsCoupon) -> IO CmsCoupon)
-> (CInt -> IO CmsCoupon) -> IO CmsCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
Day -> (CInt -> IO CmsCoupon) -> IO CmsCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a3 ((CInt -> IO CmsCoupon) -> IO CmsCoupon)
-> (CInt -> IO CmsCoupon) -> IO CmsCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a3' ->
Day -> (CInt -> IO CmsCoupon) -> IO CmsCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a4 ((CInt -> IO CmsCoupon) -> IO CmsCoupon)
-> (CInt -> IO CmsCoupon) -> IO CmsCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a4' ->
let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in
GenSwapIndex sidx
-> (Ptr CSwapIndex' -> IO CmsCoupon) -> IO CmsCoupon
forall sidx b.
GenSwapIndex sidx -> (Ptr CSwapIndex' -> IO b) -> IO b
withSwapIndex GenSwapIndex sidx
a6 ((Ptr CSwapIndex' -> IO CmsCoupon) -> IO CmsCoupon)
-> (Ptr CSwapIndex' -> IO CmsCoupon) -> IO CmsCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CSwapIndex'
a6' ->
let {a7' :: CDouble
a7' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a7} in
let {a8' :: CDouble
a8' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a8} in
Maybe Day -> (CInt -> IO CmsCoupon) -> IO CmsCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a9 ((CInt -> IO CmsCoupon) -> IO CmsCoupon)
-> (CInt -> IO CmsCoupon) -> IO CmsCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a9' ->
Maybe Day -> (CInt -> IO CmsCoupon) -> IO CmsCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a10 ((CInt -> IO CmsCoupon) -> IO CmsCoupon)
-> (CInt -> IO CmsCoupon) -> IO CmsCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a10' ->
DayCounter -> (Ptr CDayCounter -> IO CmsCoupon) -> IO CmsCoupon
forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter DayCounter
a11 ((Ptr CDayCounter -> IO CmsCoupon) -> IO CmsCoupon)
-> (Ptr CDayCounter -> IO CmsCoupon) -> IO CmsCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CDayCounter
a11' ->
let {a12' :: CInt
a12' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a12} in
Maybe Day -> (CInt -> IO CmsCoupon) -> IO CmsCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a13 ((CInt -> IO CmsCoupon) -> IO CmsCoupon)
-> (CInt -> IO CmsCoupon) -> IO CmsCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a13' ->
let {a14' :: CInt
a14' = BusinessDayConvention -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC BusinessDayConvention
a14} in
(Ptr (Ptr CChar) -> IO CmsCoupon) -> IO CmsCoupon
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO CmsCoupon) -> IO CmsCoupon)
-> (Ptr (Ptr CChar) -> IO CmsCoupon) -> IO CmsCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a15' ->
CInt
-> CDouble
-> CInt
-> CInt
-> CUInt
-> Ptr CSwapIndex'
-> CDouble
-> CDouble
-> CInt
-> CInt
-> Ptr CDayCounter
-> CInt
-> CInt
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CCmsCoupon')
cmsCoupon'_ CInt
a1' CDouble
a2' CInt
a3' CInt
a4' CUInt
a5' Ptr CSwapIndex'
a6' CDouble
a7' CDouble
a8' CInt
a9' CInt
a10' Ptr CDayCounter
a11' CInt
a12' CInt
a13' CInt
a14' Ptr (Ptr CChar)
a15' IO (Ptr CCmsCoupon')
-> (Ptr CCmsCoupon' -> IO CmsCoupon) -> IO CmsCoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CCmsCoupon'
res ->
Ptr CCmsCoupon' -> IO CmsCoupon
peekCmsCoupon Ptr CCmsCoupon'
res IO CmsCoupon -> (CmsCoupon -> IO CmsCoupon) -> IO CmsCoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CmsCoupon
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a15'IO () -> IO CmsCoupon -> IO CmsCoupon
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
CmsCoupon -> IO CmsCoupon
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (CmsCoupon
res')
{-# LINE 1356 "./QuantLib/CashFlow.chs" #-}
cmsSpreadCoupon :: (Day)
-> (Double)
-> (Day)
-> (Day)
-> (Word)
-> (SwapSpreadIndex)
-> (Double)
-> (Double)
-> (Maybe Day)
-> (Maybe Day)
-> (DayCounter)
-> (Bool)
-> (Maybe Day)
-> (BusinessDayConvention)
-> IO ((FloatingRateCoupon))
cmsSpreadCoupon a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 =
withDay a1 $ \a1' ->
let {a2' = realToFrac a2} in
withDay a3 $ \a3' ->
withDay a4 $ \a4' ->
let {a5' = fromIntegral a5} in
withSwapSpreadIndex a6 $ \a6' ->
let {a7' = realToFrac a7} in
let {a8' = realToFrac a8} in
withMaybeDay a9 $ \a9' ->
withMaybeDay a10 $ \a10' ->
withDayCounter a11 $ \a11' ->
let {a12' = C2HSImp.fromBool a12} in
withMaybeDay a13 $ \a13' ->
let {a14' = fromEnumC a14} in
preErrorCheck $ \a15' ->
cmsSpreadCoupon'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' a14' a15' >>= \res ->
peekFloatingRateCoupon res >>= \res' ->
errorCheck a15'>>
return (res')
{-# LINE 1374 "./QuantLib/CashFlow.chs" #-}
rate :: (GenCoupon c)
-> IO ((Double))
rate a1 =
withCoupon a1 $ \a1' ->
preErrorCheck $ \a2' ->
rate'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 1381 "./QuantLib/CashFlow.chs" #-}
couponAccruedAmount :: (GenCoupon c)
-> (Day)
-> IO ((Double))
couponAccruedAmount a1 a2 =
withCoupon a1 $ \a1' ->
withDay a2 $ \a2' ->
preErrorCheck $ \a3' ->
couponAccruedAmount'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 1388 "./QuantLib/CashFlow.chs" #-}
setFloatingRateCouponPricer :: (GenFloatingRateCoupon frc)
-> (GenFloatingRateCouponPricer frcp)
-> IO ()
setFloatingRateCouponPricer a1 a2 =
withFloatingRateCoupon a1 $ \a1' ->
withFloatingRateCouponPricer a2 $ \a2' ->
preErrorCheck $ \a3' ->
setFloatingRateCouponPricer'_ a1' a2' a3' >>
errorCheck a3'>>
return ()
{-# LINE 1393 "./QuantLib/CashFlow.chs" #-}
price :: (GenFloatingRateCoupon frc)
-> (Maybe (GenYieldTermStructure y))
-> IO ((Double))
price a1 a2 =
withFloatingRateCoupon a1 $ \a1' ->
withMaybeYieldTermStructure a2 $ \a2' ->
preErrorCheck $ \a3' ->
price'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 1399 "./QuantLib/CashFlow.chs" #-}
convexityAdjustment :: (GenFloatingRateCoupon frc)
-> IO ((Double))
convexityAdjustment a1 =
withFloatingRateCoupon a1 $ \a1' ->
preErrorCheck $ \a2' ->
convexityAdjustment'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 1404 "./QuantLib/CashFlow.chs" #-}
cappedFlooredCmsCoupon :: (Day)
-> (Double)
-> (Day)
-> (Day)
-> (Word)
-> (GenSwapIndex sidx)
-> (Double)
-> (Double)
-> (Maybe Double)
-> (Maybe Double)
-> (Maybe Day)
-> (Maybe Day)
-> (DayCounter)
-> (Bool)
-> (Maybe Day)
-> (BusinessDayConvention)
-> IO ((FloatingRateCoupon))
cappedFlooredCmsCoupon :: forall sidx.
Day
-> Double
-> Day
-> Day
-> Word
-> GenSwapIndex sidx
-> Double
-> Double
-> Maybe Double
-> Maybe Double
-> Maybe Day
-> Maybe Day
-> DayCounter
-> Bool
-> Maybe Day
-> BusinessDayConvention
-> IO FloatingRateCoupon
cappedFlooredCmsCoupon Day
a1 Double
a2 Day
a3 Day
a4 Word
a5 GenSwapIndex sidx
a6 Double
a7 Double
a8 Maybe Double
a9 Maybe Double
a10 Maybe Day
a11 Maybe Day
a12 DayCounter
a13 Bool
a14 Maybe Day
a15 BusinessDayConvention
a16 =
Day -> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a1 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
Day -> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a3 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a3' ->
Day -> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a4 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a4' ->
let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in
GenSwapIndex sidx
-> (Ptr CSwapIndex' -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall sidx b.
GenSwapIndex sidx -> (Ptr CSwapIndex' -> IO b) -> IO b
withSwapIndex GenSwapIndex sidx
a6 ((Ptr CSwapIndex' -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon)
-> (Ptr CSwapIndex' -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CSwapIndex'
a6' ->
let {a7' :: CDouble
a7' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a7} in
let {a8' :: CDouble
a8' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a8} in
let {a9' :: CDouble
a9' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a9} in
let {a10' :: CDouble
a10' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a10} in
Maybe Day
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a11 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a11' ->
Maybe Day
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a12 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a12' ->
DayCounter
-> (Ptr CDayCounter -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter DayCounter
a13 ((Ptr CDayCounter -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon)
-> (Ptr CDayCounter -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CDayCounter
a13' ->
let {a14' :: CInt
a14' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a14} in
Maybe Day
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a15 ((CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon)
-> (CInt -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a15' ->
let {a16' :: CInt
a16' = BusinessDayConvention -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC BusinessDayConvention
a16} in
(Ptr (Ptr CChar) -> IO FloatingRateCoupon) -> IO FloatingRateCoupon
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon)
-> (Ptr (Ptr CChar) -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a17' ->
CInt
-> CDouble
-> CInt
-> CInt
-> CUInt
-> Ptr CSwapIndex'
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CInt
-> CInt
-> Ptr CDayCounter
-> CInt
-> CInt
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CFloatingRateCoupon')
cappedFlooredCmsCoupon'_ CInt
a1' CDouble
a2' CInt
a3' CInt
a4' CUInt
a5' Ptr CSwapIndex'
a6' CDouble
a7' CDouble
a8' CDouble
a9' CDouble
a10' CInt
a11' CInt
a12' Ptr CDayCounter
a13' CInt
a14' CInt
a15' CInt
a16' Ptr (Ptr CChar)
a17' IO (Ptr CFloatingRateCoupon')
-> (Ptr CFloatingRateCoupon' -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CFloatingRateCoupon'
res ->
Ptr CFloatingRateCoupon' -> IO FloatingRateCoupon
peekFloatingRateCoupon Ptr CFloatingRateCoupon'
res IO FloatingRateCoupon
-> (FloatingRateCoupon -> IO FloatingRateCoupon)
-> IO FloatingRateCoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \FloatingRateCoupon
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a17'IO () -> IO FloatingRateCoupon -> IO FloatingRateCoupon
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
FloatingRateCoupon -> IO FloatingRateCoupon
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (FloatingRateCoupon
res')
{-# LINE 1425 "./QuantLib/CashFlow.chs" #-}
cappedFlooredCmsSpreadCoupon :: (Day)
-> (Double)
-> (Day)
-> (Day)
-> (Word)
-> (SwapSpreadIndex)
-> (Double)
-> (Double)
-> (Maybe Double)
-> (Maybe Double)
-> (Maybe Day)
-> (Maybe Day)
-> (DayCounter)
-> (Bool)
-> (Maybe Day)
-> (BusinessDayConvention)
-> IO ((FloatingRateCoupon))
cappedFlooredCmsSpreadCoupon a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 =
withDay a1 $ \a1' ->
let {a2' = realToFrac a2} in
withDay a3 $ \a3' ->
withDay a4 $ \a4' ->
let {a5' = fromIntegral a5} in
withSwapSpreadIndex a6 $ \a6' ->
let {a7' = realToFrac a7} in
let {a8' = realToFrac a8} in
let {a9' = fromMaybeDouble a9} in
let {a10' = fromMaybeDouble a10} in
withMaybeDay a11 $ \a11' ->
withMaybeDay a12 $ \a12' ->
withDayCounter a13 $ \a13' ->
let {a14' = C2HSImp.fromBool a14} in
withMaybeDay a15 $ \a15' ->
let {a16' = fromEnumC a16} in
preErrorCheck $ \a17' ->
cappedFlooredCmsSpreadCoupon'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' a14' a15' a16' a17' >>= \res ->
peekFloatingRateCoupon res >>= \res' ->
errorCheck a17'>>
return (res')
{-# LINE 1445 "./QuantLib/CashFlow.chs" #-}
cmsSpreadLeg :: (Schedule) -> (SwapSpreadIndex)
-> (NonEmpty Double)
-> (DayCounter) -> (BusinessDayConvention)
-> ([Word])
-> ([Double])
-> ([Double])
-> ([Double])
-> ([Double])
-> (Bool)
-> (Bool)
-> IO ((Leg))
cmsSpreadLeg a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 =
withSchedule a1 $ \a1' ->
withSwapSpreadIndex a2 $ \a2' ->
withNonEmptyDoubleArray a3 $ \(a3'1, a3'2) ->
withDayCounter a4 $ \a4' ->
let {a5' = fromEnumC a5} in
withIntArray a6 $ \(a6'1, a6'2) ->
withDoubleArray a7 $ \(a7'1, a7'2) ->
withDoubleArray a8 $ \(a8'1, a8'2) ->
withDoubleArray a9 $ \(a9'1, a9'2) ->
withDoubleArray a10 $ \(a10'1, a10'2) ->
let {a11' = C2HSImp.fromBool a11} in
let {a12' = C2HSImp.fromBool a12} in
preErrorCheck $ \a13' ->
cmsSpreadLeg'_ a1' a2' a3'1 a3'2 a4' a5' a6'1 a6'2 a7'1 a7'2 a8'1 a8'2 a9'1 a9'2 a10'1 a10'2 a11' a12' a13' >>= \res ->
peekLeg res >>= \res' ->
errorCheck a13'>>
return (res')
{-# LINE 1460 "./QuantLib/CashFlow.chs" #-}
digitalReplication :: (ReplicationType)
-> (Double)
-> IO ((DigitalReplication))
digitalReplication a1 a2 =
let {a1' = (fromIntegral . fromEnum) a1} in
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
digitalReplication'_ a1' a2' a3' >>= \res ->
peekDigitalReplication res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 1467 "./QuantLib/CashFlow.chs" #-}
replicationType :: (DigitalReplication)
-> (ReplicationType)
replicationType a1 =
C2HSImp.unsafePerformIO $
withDigitalReplication a1 $ \a1' ->
replicationType'_ a1' >>= \res ->
let {res' = (toEnum . fromIntegral) res} in
return (res')
{-# LINE 1469 "./QuantLib/CashFlow.chs" #-}
gap :: (DigitalReplication)
-> (Double)
gap a1 =
C2HSImp.unsafePerformIO $
withDigitalReplication a1 $ \a1' ->
gap'_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 1471 "./QuantLib/CashFlow.chs" #-}
digitalCmsCoupon :: (CmsCoupon)
-> (Maybe Double)
-> (PositionType)
-> (Bool)
-> (Maybe Double)
-> (Maybe Double)
-> (PositionType)
-> (Bool)
-> (Maybe Double)
-> (Maybe DigitalReplication)
-> (Bool)
-> IO ((DigitalCmsCoupon))
digitalCmsCoupon :: CmsCoupon
-> Maybe Double
-> PositionType
-> Bool
-> Maybe Double
-> Maybe Double
-> PositionType
-> Bool
-> Maybe Double
-> Maybe DigitalReplication
-> Bool
-> IO DigitalCmsCoupon
digitalCmsCoupon CmsCoupon
a1 Maybe Double
a2 PositionType
a3 Bool
a4 Maybe Double
a5 Maybe Double
a6 PositionType
a7 Bool
a8 Maybe Double
a9 Maybe DigitalReplication
a10 Bool
a11 =
CmsCoupon
-> (Ptr CCmsCoupon' -> IO DigitalCmsCoupon) -> IO DigitalCmsCoupon
forall b. CmsCoupon -> (Ptr CCmsCoupon' -> IO b) -> IO b
withCmsCoupon CmsCoupon
a1 ((Ptr CCmsCoupon' -> IO DigitalCmsCoupon) -> IO DigitalCmsCoupon)
-> (Ptr CCmsCoupon' -> IO DigitalCmsCoupon) -> IO DigitalCmsCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CCmsCoupon'
a1' ->
let {a2' :: CDouble
a2' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a2} in
let {a3' :: CInt
a3' = PositionType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC PositionType
a3} in
let {a4' :: CInt
a4' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a4} in
let {a5' :: CDouble
a5' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a5} in
let {a6' :: CDouble
a6' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a6} in
let {a7' :: CInt
a7' = PositionType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC PositionType
a7} in
let {a8' :: CInt
a8' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a8} in
let {a9' :: CDouble
a9' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a9} in
Maybe DigitalReplication
-> (Ptr CDigitalReplication -> IO DigitalCmsCoupon)
-> IO DigitalCmsCoupon
forall b.
Maybe DigitalReplication
-> (Ptr CDigitalReplication -> IO b) -> IO b
withMaybeDigitalReplication Maybe DigitalReplication
a10 ((Ptr CDigitalReplication -> IO DigitalCmsCoupon)
-> IO DigitalCmsCoupon)
-> (Ptr CDigitalReplication -> IO DigitalCmsCoupon)
-> IO DigitalCmsCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CDigitalReplication
a10' ->
let {a11' :: CInt
a11' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a11} in
(Ptr (Ptr CChar) -> IO DigitalCmsCoupon) -> IO DigitalCmsCoupon
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO DigitalCmsCoupon) -> IO DigitalCmsCoupon)
-> (Ptr (Ptr CChar) -> IO DigitalCmsCoupon) -> IO DigitalCmsCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a12' ->
Ptr CCmsCoupon'
-> CDouble
-> CInt
-> CInt
-> CDouble
-> CDouble
-> CInt
-> CInt
-> CDouble
-> Ptr CDigitalReplication
-> CInt
-> Ptr (Ptr CChar)
-> IO (Ptr CDigitalCmsCoupon')
digitalCmsCoupon'_ Ptr CCmsCoupon'
a1' CDouble
a2' CInt
a3' CInt
a4' CDouble
a5' CDouble
a6' CInt
a7' CInt
a8' CDouble
a9' Ptr CDigitalReplication
a10' CInt
a11' Ptr (Ptr CChar)
a12' IO (Ptr CDigitalCmsCoupon')
-> (Ptr CDigitalCmsCoupon' -> IO DigitalCmsCoupon)
-> IO DigitalCmsCoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CDigitalCmsCoupon'
res ->
Ptr CDigitalCmsCoupon' -> IO DigitalCmsCoupon
peekDigitalCmsCoupon Ptr CDigitalCmsCoupon'
res IO DigitalCmsCoupon
-> (DigitalCmsCoupon -> IO DigitalCmsCoupon) -> IO DigitalCmsCoupon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \DigitalCmsCoupon
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a12'IO () -> IO DigitalCmsCoupon -> IO DigitalCmsCoupon
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
DigitalCmsCoupon -> IO DigitalCmsCoupon
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (DigitalCmsCoupon
res')
{-# LINE 1490 "./QuantLib/CashFlow.chs" #-}
digitalCmsSpreadCoupon :: (Day)
-> (Double)
-> (Day)
-> (Day)
-> (Word)
-> (SwapSpreadIndex)
-> (Double)
-> (Double)
-> (Maybe Day)
-> (Maybe Day)
-> (DayCounter)
-> (Bool)
-> (Maybe Day)
-> (BusinessDayConvention)
-> (Maybe Double)
-> (PositionType)
-> (Bool)
-> (Maybe Double)
-> (Maybe Double)
-> (PositionType)
-> (Bool)
-> (Maybe Double)
-> (Maybe DigitalReplication)
-> (Bool)
-> IO ((DigitalCmsSpreadCoupon))
digitalCmsSpreadCoupon :: Day
-> Double
-> Day
-> Day
-> Word
-> SwapSpreadIndex
-> Double
-> Double
-> Maybe Day
-> Maybe Day
-> DayCounter
-> Bool
-> Maybe Day
-> BusinessDayConvention
-> Maybe Double
-> PositionType
-> Bool
-> Maybe Double
-> Maybe Double
-> PositionType
-> Bool
-> Maybe Double
-> Maybe DigitalReplication
-> Bool
-> IO DigitalCmsSpreadCoupon
digitalCmsSpreadCoupon Day
a1 Double
a2 Day
a3 Day
a4 Word
a5 SwapSpreadIndex
a6 Double
a7 Double
a8 Maybe Day
a9 Maybe Day
a10 DayCounter
a11 Bool
a12 Maybe Day
a13 BusinessDayConvention
a14 Maybe Double
a15 PositionType
a16 Bool
a17 Maybe Double
a18 Maybe Double
a19 PositionType
a20 Bool
a21 Maybe Double
a22 Maybe DigitalReplication
a23 Bool
a24 =
Day
-> (CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a1 ((CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon)
-> (CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
Day
-> (CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a3 ((CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon)
-> (CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a3' ->
Day
-> (CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a4 ((CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon)
-> (CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a4' ->
let {a5' :: CUInt
a5' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a5} in
SwapSpreadIndex
-> (Ptr CSwapSpreadIndex' -> IO DigitalCmsSpreadCoupon)
-> IO DigitalCmsSpreadCoupon
forall b.
SwapSpreadIndex -> (Ptr CSwapSpreadIndex' -> IO b) -> IO b
withSwapSpreadIndex SwapSpreadIndex
a6 ((Ptr CSwapSpreadIndex' -> IO DigitalCmsSpreadCoupon)
-> IO DigitalCmsSpreadCoupon)
-> (Ptr CSwapSpreadIndex' -> IO DigitalCmsSpreadCoupon)
-> IO DigitalCmsSpreadCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CSwapSpreadIndex'
a6' ->
let {a7' :: CDouble
a7' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a7} in
let {a8' = realToFrac a8} in
Maybe Day
-> (CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a9 ((CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon)
-> (CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a9' ->
Maybe Day
-> (CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a10 ((CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon)
-> (CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a10' ->
DayCounter
-> (Ptr CDayCounter -> IO DigitalCmsSpreadCoupon)
-> IO DigitalCmsSpreadCoupon
forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter DayCounter
a11 ((Ptr CDayCounter -> IO DigitalCmsSpreadCoupon)
-> IO DigitalCmsSpreadCoupon)
-> (Ptr CDayCounter -> IO DigitalCmsSpreadCoupon)
-> IO DigitalCmsSpreadCoupon
forall a b. (a -> b) -> a -> b
$ \Ptr CDayCounter
a11' ->
let {a12' :: CInt
a12' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a12} in
Maybe Day
-> (CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon
forall a. Maybe Day -> (CInt -> IO a) -> IO a
withMaybeDay Maybe Day
a13 ((CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon)
-> (CInt -> IO DigitalCmsSpreadCoupon) -> IO DigitalCmsSpreadCoupon
forall a b. (a -> b) -> a -> b
$ \CInt
a13' ->
let {a14' :: CInt
a14' = BusinessDayConvention -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC BusinessDayConvention
a14} in
let {a15' :: CDouble
a15' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a15} in
let {a16' :: CInt
a16' = PositionType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC PositionType
a16} in
let {a17' :: CInt
a17' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a17} in
let {a18' :: CDouble
a18' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a18} in
let {a19' :: CDouble
a19' = Maybe Double -> CDouble
fromMaybeDouble Maybe Double
a19} in
let {a20' :: CInt
a20' = PositionType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC PositionType
a20} in
let {a21' = C2HSImp.fromBool a21} in
let {a22' = fromMaybeDouble a22} in
withMaybeDigitalReplication a23 $ \a23' ->
let {a24' = C2HSImp.fromBool a24} in
preErrorCheck $ \a25' ->
digitalCmsSpreadCoupon'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' a14' a15' a16' a17' a18' a19' a20' a21' a22' a23' a24' a25' >>= \res ->
peekDigitalCmsSpreadCoupon res >>= \res' ->
errorCheck a25'>>
return (res')
{-# LINE 1521 "./QuantLib/CashFlow.chs" #-}
digitalCmsLeg :: Schedule -> GenSwapIndex sidx -> NonEmpty Double -> DayCounter -> BusinessDayConvention -> [Word] -> [Double] -> [Double] -> Bool -> DigitalCmsLegOpts -> IO Leg
digitalCmsLeg schedule index notionals dc adjustment fixingDays gearings spreads inArrears opts =
digitalCmsLeg_ schedule index notionals dc adjustment fixingDays gearings spreads inArrears
(dcmlCallStrikes opts) (dcmlCallPosition opts) (dcmlCallAtm opts) (dcmlCallPayoffs opts)
(dcmlPutStrikes opts) (dcmlPutPosition opts) (dcmlPutAtm opts) (dcmlPutPayoffs opts)
(dcmlReplication opts) (dcmlNakedOption opts)
digitalIborLeg :: Schedule -> GenIborIndex ibor -> NonEmpty Double -> DayCounter -> BusinessDayConvention -> [Word] -> [Double] -> [Double] -> Bool -> DigitalIborLegOpts -> IO Leg
digitalIborLeg schedule index notionals dc adjustment fixingDays gearings spreads inArrears opts =
digitalIborLeg_ schedule index notionals dc adjustment fixingDays gearings spreads inArrears (dilCallStrikes opts) (dilCallPosition opts) (dilCallAtm opts) (dilCallPayoffs opts) (dilPutStrikes opts) (dilPutPosition opts) (dilPutAtm opts) (dilPutPayoffs opts) (dilReplication opts) (dilNakedOption opts)
digitalCmsSpreadLeg :: Schedule -> SwapSpreadIndex -> NonEmpty Double -> DayCounter -> BusinessDayConvention -> [Word] -> [Double] -> [Double] -> Bool -> DigitalCmsSpreadLegOpts -> IO Leg
digitalCmsSpreadLeg schedule index notionals dc adjustment fixingDays gearings spreads inArrears opts =
digitalCmsSpreadLeg_ schedule index notionals dc adjustment fixingDays gearings spreads inArrears
(dcmslCallStrikes opts) (dcmslCallPosition opts) (dcmslCallAtm opts) (dcmslCallPayoffs opts)
(dcmslPutStrikes opts) (dcmslPutPosition opts) (dcmslPutAtm opts) (dcmslPutPayoffs opts)
(dcmslReplication opts) (dcmslNakedOption opts)
multipleResetsLeg :: Schedule -> GenIborIndex ibor -> Word -> DayCounter -> BusinessDayConvention -> MultipleResetsLegOpts -> IO Leg
multipleResetsLeg schedule index resets dc adjustment opts = do
nullCalendar <- calendar Null
multipleResetsLeg_ schedule index resets (mrlNotionals opts) dc adjustment (fromMaybe nullCalendar (mrlPaymentCalendar opts)) (mrlPaymentLag opts) (mrlFixingDays opts) (mrlGearings opts) (mrlCouponSpreads opts) (mrlRateSpreads opts) (mrlExCouponPeriod opts) (fromMaybe nullCalendar (mrlExCouponCalendar opts)) (mrlExCouponConvention opts) (mrlExCouponEndOfMonth opts) (mrlAveragingMethod opts)
digitalCmsLeg_ :: (Schedule) -> (GenSwapIndex sidx) -> (NonEmpty Double) -> (DayCounter) -> (BusinessDayConvention) -> ([Word]) -> ([Double]) -> ([Double]) -> (Bool) -> ([Double]) -> (PositionType) -> (Bool) -> ([Double]) -> ([Double]) -> (PositionType) -> (Bool) -> ([Double]) -> (Maybe DigitalReplication) -> (Bool) -> IO ((Leg))
digitalCmsLeg_ a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 =
withSchedule a1 $ \a1' ->
withSwapIndex a2 $ \a2' ->
withNonEmptyDoubleArray a3 $ \(a3'1, a3'2) ->
withDayCounter a4 $ \a4' ->
let {a5' = fromEnumC a5} in
withIntArray a6 $ \(a6'1, a6'2) ->
withDoubleArray a7 $ \(a7'1, a7'2) ->
withDoubleArray a8 $ \(a8'1, a8'2) ->
let {a9' = C2HSImp.fromBool a9} in
withDoubleArray a10 $ \(a10'1, a10'2) ->
let {a11' = fromEnumC a11} in
let {a12' = C2HSImp.fromBool a12} in
withDoubleArray a13 $ \(a13'1, a13'2) ->
withDoubleArray a14 $ \(a14'1, a14'2) ->
let {a15' = fromEnumC a15} in
let {a16' = C2HSImp.fromBool a16} in
withDoubleArray a17 $ \(a17'1, a17'2) ->
withMaybeDigitalReplication a18 $ \a18' ->
let {a19' = C2HSImp.fromBool a19} in
preErrorCheck $ \a20' ->
digitalCmsLeg_'_ a1' a2' a3'1 a3'2 a4' a5' a6'1 a6'2 a7'1 a7'2 a8'1 a8'2 a9' a10'1 a10'2 a11' a12' a13'1 a13'2 a14'1 a14'2 a15' a16' a17'1 a17'2 a18' a19' a20' >>= \res ->
peekLeg res >>= \res' ->
errorCheck a20'>>
return (res')
{-# LINE 1554 "./QuantLib/CashFlow.chs" #-}
digitalIborLeg_ :: (Schedule) -> (GenIborIndex ibor) -> (NonEmpty Double) -> (DayCounter) -> (BusinessDayConvention) -> ([Word]) -> ([Double]) -> ([Double]) -> (Bool) -> ([Double]) -> (PositionType) -> (Bool) -> ([Double]) -> ([Double]) -> (PositionType) -> (Bool) -> ([Double]) -> (Maybe DigitalReplication) -> (Bool) -> IO ((Leg))
digitalIborLeg_ a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 =
withSchedule a1 $ \a1' ->
withIborIndex a2 $ \a2' ->
withNonEmptyDoubleArray a3 $ \(a3'1, a3'2) ->
withDayCounter a4 $ \a4' ->
let {a5' = fromEnumC a5} in
withIntArray a6 $ \(a6'1, a6'2) ->
withDoubleArray a7 $ \(a7'1, a7'2) ->
withDoubleArray a8 $ \(a8'1, a8'2) ->
let {a9' = C2HSImp.fromBool a9} in
withDoubleArray a10 $ \(a10'1, a10'2) ->
let {a11' = fromEnumC a11} in
let {a12' = C2HSImp.fromBool a12} in
withDoubleArray a13 $ \(a13'1, a13'2) ->
withDoubleArray a14 $ \(a14'1, a14'2) ->
let {a15' = fromEnumC a15} in
let {a16' = C2HSImp.fromBool a16} in
withDoubleArray a17 $ \(a17'1, a17'2) ->
withMaybeDigitalReplication a18 $ \a18' ->
let {a19' = C2HSImp.fromBool a19} in
preErrorCheck $ \a20' ->
digitalIborLeg_'_ a1' a2' a3'1 a3'2 a4' a5' a6'1 a6'2 a7'1 a7'2 a8'1 a8'2 a9' a10'1 a10'2 a11' a12' a13'1 a13'2 a14'1 a14'2 a15' a16' a17'1 a17'2 a18' a19' a20' >>= \res ->
peekLeg res >>= \res' ->
errorCheck a20'>>
return (res')
{-# LINE 1555 "./QuantLib/CashFlow.chs" #-}
digitalCmsSpreadLeg_ :: (Schedule) -> (SwapSpreadIndex) -> (NonEmpty Double) -> (DayCounter) -> (BusinessDayConvention) -> ([Word]) -> ([Double]) -> ([Double]) -> (Bool) -> ([Double]) -> (PositionType) -> (Bool) -> ([Double]) -> ([Double]) -> (PositionType) -> (Bool) -> ([Double]) -> (Maybe DigitalReplication) -> (Bool) -> IO ((Leg))
digitalCmsSpreadLeg_ a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 =
withSchedule a1 $ \a1' ->
withSwapSpreadIndex a2 $ \a2' ->
withNonEmptyDoubleArray a3 $ \(a3'1, a3'2) ->
withDayCounter a4 $ \a4' ->
let {a5' = fromEnumC a5} in
withIntArray a6 $ \(a6'1, a6'2) ->
withDoubleArray a7 $ \(a7'1, a7'2) ->
withDoubleArray a8 $ \(a8'1, a8'2) ->
let {a9' = C2HSImp.fromBool a9} in
withDoubleArray a10 $ \(a10'1, a10'2) ->
let {a11' = fromEnumC a11} in
let {a12' = C2HSImp.fromBool a12} in
withDoubleArray a13 $ \(a13'1, a13'2) ->
withDoubleArray a14 $ \(a14'1, a14'2) ->
let {a15' = fromEnumC a15} in
let {a16' = C2HSImp.fromBool a16} in
withDoubleArray a17 $ \(a17'1, a17'2) ->
withMaybeDigitalReplication a18 $ \a18' ->
let {a19' = C2HSImp.fromBool a19} in
preErrorCheck $ \a20' ->
digitalCmsSpreadLeg_'_ a1' a2' a3'1 a3'2 a4' a5' a6'1 a6'2 a7'1 a7'2 a8'1 a8'2 a9' a10'1 a10'2 a11' a12' a13'1 a13'2 a14'1 a14'2 a15' a16' a17'1 a17'2 a18' a19' a20' >>= \res ->
peekLeg res >>= \res' ->
errorCheck a20'>>
return (res')
{-# LINE 1560 "./QuantLib/CashFlow.chs" #-}
multipleResetsLeg_ :: (Schedule) -> (GenIborIndex ibor) -> (Word) -> (NonEmpty Double) -> (DayCounter) -> (BusinessDayConvention) -> (Calendar) -> (Int) -> ([Word]) -> ([Double]) -> ([Double]) -> ([Double]) -> ((Int,TimeUnit)) -> (Calendar) -> (BusinessDayConvention) -> (Bool) -> (RateAveragingType) -> IO ((Leg))
multipleResetsLeg_ a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 =
withSchedule a1 $ \a1' ->
withIborIndex a2 $ \a2' ->
let {a3' = fromIntegral a3} in
withNonEmptyDoubleArray a4 $ \(a4'1, a4'2) ->
withDayCounter a5 $ \a5' ->
let {a6' = fromEnumC a6} in
withCalendar a7 $ \a7' ->
let {a8' = fromIntegral a8} in
withIntArray a9 $ \(a9'1, a9'2) ->
withDoubleArray a10 $ \(a10'1, a10'2) ->
withDoubleArray a11 $ \(a11'1, a11'2) ->
withDoubleArray a12 $ \(a12'1, a12'2) ->
let {(a13'1, a13'2) = fromEnumQuantity a13} in
withCalendar a14 $ \a14' ->
let {a15' = fromEnumC a15} in
let {a16' = C2HSImp.fromBool a16} in
let {a17' = fromEnumC a17} in
preErrorCheck $ \a18' ->
multipleResetsLeg_'_ a1' a2' a3' a4'1 a4'2 a5' a6' a7' a8' a9'1 a9'2 a10'1 a10'2 a11'1 a11'2 a12'1 a12'2 a13'1 a13'2 a14' a15' a16' a17' a18' >>= \res ->
peekLeg res >>= \res' ->
errorCheck a18'>>
return (res')
{-# LINE 1561 "./QuantLib/CashFlow.chs" #-}
analyticHaganPricer :: (GenSwaptionVolatilityStructure sv) -> (YieldCurveModel) -> (GenQuote q)
-> IO ((CmsCouponPricer))
analyticHaganPricer a1 a2 a3 =
withSwaptionVolatilityStructure a1 $ \a1' ->
let {a2' = (fromIntegral . fromEnum) a2} in
withQuote a3 $ \a3' ->
preErrorCheck $ \a4' ->
analyticHaganPricer'_ a1' a2' a3' a4' >>= \res ->
peekCmsCouponPricer res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 1566 "./QuantLib/CashFlow.chs" #-}
numericHaganPricer :: (GenSwaptionVolatilityStructure sv) -> (YieldCurveModel) -> (GenQuote q)
-> (Double)
-> (Double)
-> (Double)
-> (Double)
-> IO ((CmsCouponPricer))
numericHaganPricer a1 a2 a3 a4 a5 a6 a7 =
withSwaptionVolatilityStructure a1 $ \a1' ->
let {a2' = (fromIntegral . fromEnum) a2} in
withQuote a3 $ \a3' ->
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
let {a6' = realToFrac a6} in
let {a7' = realToFrac a7} in
preErrorCheck $ \a8' ->
numericHaganPricer'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
peekCmsCouponPricer res >>= \res' ->
errorCheck a8'>>
return (res')
{-# LINE 1575 "./QuantLib/CashFlow.chs" #-}
data LinearTsrPricerStrategy
= LinearTsrRateBound
| LinearTsrVegaRatio Double
| LinearTsrPriceThreshold Double
| LinearTsrBSStdDevs Double
deriving (Int -> LinearTsrPricerStrategy -> ShowS
[LinearTsrPricerStrategy] -> ShowS
LinearTsrPricerStrategy -> String
(Int -> LinearTsrPricerStrategy -> ShowS)
-> (LinearTsrPricerStrategy -> String)
-> ([LinearTsrPricerStrategy] -> ShowS)
-> Show LinearTsrPricerStrategy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LinearTsrPricerStrategy -> ShowS
showsPrec :: Int -> LinearTsrPricerStrategy -> ShowS
$cshow :: LinearTsrPricerStrategy -> String
show :: LinearTsrPricerStrategy -> String
$cshowList :: [LinearTsrPricerStrategy] -> ShowS
showList :: [LinearTsrPricerStrategy] -> ShowS
Show, LinearTsrPricerStrategy -> LinearTsrPricerStrategy -> Bool
(LinearTsrPricerStrategy -> LinearTsrPricerStrategy -> Bool)
-> (LinearTsrPricerStrategy -> LinearTsrPricerStrategy -> Bool)
-> Eq LinearTsrPricerStrategy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LinearTsrPricerStrategy -> LinearTsrPricerStrategy -> Bool
== :: LinearTsrPricerStrategy -> LinearTsrPricerStrategy -> Bool
$c/= :: LinearTsrPricerStrategy -> LinearTsrPricerStrategy -> Bool
/= :: LinearTsrPricerStrategy -> LinearTsrPricerStrategy -> Bool
Eq)
data LinearTsrPricerSettings = LinearTsrPricerSettings
{ LinearTsrPricerSettings -> LinearTsrPricerStrategy
ltsrStrategy :: LinearTsrPricerStrategy
, LinearTsrPricerSettings -> Maybe (Double, Double)
ltsrBounds :: Maybe (Double, Double)
} deriving (Int -> LinearTsrPricerSettings -> ShowS
[LinearTsrPricerSettings] -> ShowS
LinearTsrPricerSettings -> String
(Int -> LinearTsrPricerSettings -> ShowS)
-> (LinearTsrPricerSettings -> String)
-> ([LinearTsrPricerSettings] -> ShowS)
-> Show LinearTsrPricerSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LinearTsrPricerSettings -> ShowS
showsPrec :: Int -> LinearTsrPricerSettings -> ShowS
$cshow :: LinearTsrPricerSettings -> String
show :: LinearTsrPricerSettings -> String
$cshowList :: [LinearTsrPricerSettings] -> ShowS
showList :: [LinearTsrPricerSettings] -> ShowS
Show, LinearTsrPricerSettings -> LinearTsrPricerSettings -> Bool
(LinearTsrPricerSettings -> LinearTsrPricerSettings -> Bool)
-> (LinearTsrPricerSettings -> LinearTsrPricerSettings -> Bool)
-> Eq LinearTsrPricerSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LinearTsrPricerSettings -> LinearTsrPricerSettings -> Bool
== :: LinearTsrPricerSettings -> LinearTsrPricerSettings -> Bool
$c/= :: LinearTsrPricerSettings -> LinearTsrPricerSettings -> Bool
/= :: LinearTsrPricerSettings -> LinearTsrPricerSettings -> Bool
Eq)
linearTsrPricer :: GenSwaptionVolatilityStructure sv -> GenQuote q -> Maybe (GenYieldTermStructure y)
-> LinearTsrPricerSettings -> IO CmsCouponPricer
linearTsrPricer :: forall sv q y.
GenSwaptionVolatilityStructure sv
-> GenQuote q
-> Maybe (GenYieldTermStructure y)
-> LinearTsrPricerSettings
-> IO CmsCouponPricer
linearTsrPricer GenSwaptionVolatilityStructure sv
swaptionVol GenQuote q
meanReversion Maybe (GenYieldTermStructure y)
couponDiscountCurve (LinearTsrPricerSettings LinearTsrPricerStrategy
strat Maybe (Double, Double)
bounds) =
GenSwaptionVolatilityStructure sv
-> GenQuote q
-> Maybe (GenYieldTermStructure y)
-> Int
-> Double
-> Bool
-> Double
-> Double
-> IO CmsCouponPricer
forall sv q y.
GenSwaptionVolatilityStructure sv
-> GenQuote q
-> Maybe (GenYieldTermStructure y)
-> Int
-> Double
-> Bool
-> Double
-> Double
-> IO CmsCouponPricer
linearTsrPricer_ GenSwaptionVolatilityStructure sv
swaptionVol GenQuote q
meanReversion Maybe (GenYieldTermStructure y)
couponDiscountCurve Int
strategyTag Double
param
(Bool
-> ((Double, Double) -> Bool) -> Maybe (Double, Double) -> Bool
forall b a. b -> (a -> b) -> Maybe a -> b
maybe Bool
False (Bool -> (Double, Double) -> Bool
forall a b. a -> b -> a
const Bool
True) Maybe (Double, Double)
bounds) Double
lowerBound Double
upperBound
where
(Int
strategyTag, Double
param) = case LinearTsrPricerStrategy
strat of
LinearTsrPricerStrategy
LinearTsrRateBound -> (LinearTsrPricerStrategyTag -> Int
forall a. Enum a => a -> Int
fromEnum LinearTsrPricerStrategyTag
LinearTsrPricerRateBound, Double
0)
LinearTsrVegaRatio Double
p -> (LinearTsrPricerStrategyTag -> Int
forall a. Enum a => a -> Int
fromEnum LinearTsrPricerStrategyTag
LinearTsrPricerVegaRatio, Double
p)
LinearTsrPriceThreshold Double
p -> (LinearTsrPricerStrategyTag -> Int
forall a. Enum a => a -> Int
fromEnum LinearTsrPricerStrategyTag
LinearTsrPricerPriceThreshold, Double
p)
LinearTsrBSStdDevs Double
p -> (LinearTsrPricerStrategyTag -> Int
forall a. Enum a => a -> Int
fromEnum LinearTsrPricerStrategyTag
LinearTsrPricerBSStdDevs, Double
p)
(Double
lowerBound, Double
upperBound) = (Double, Double) -> Maybe (Double, Double) -> (Double, Double)
forall a. a -> Maybe a -> a
fromMaybe (Double
0, Double
0) Maybe (Double, Double)
bounds
data LinearTsrPricerStrategyTag = LinearTsrPricerRateBound
| LinearTsrPricerVegaRatio
| LinearTsrPricerPriceThreshold
| LinearTsrPricerBSStdDevs
deriving (Int -> LinearTsrPricerStrategyTag -> ShowS
[LinearTsrPricerStrategyTag] -> ShowS
LinearTsrPricerStrategyTag -> String
(Int -> LinearTsrPricerStrategyTag -> ShowS)
-> (LinearTsrPricerStrategyTag -> String)
-> ([LinearTsrPricerStrategyTag] -> ShowS)
-> Show LinearTsrPricerStrategyTag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LinearTsrPricerStrategyTag -> ShowS
showsPrec :: Int -> LinearTsrPricerStrategyTag -> ShowS
$cshow :: LinearTsrPricerStrategyTag -> String
show :: LinearTsrPricerStrategyTag -> String
$cshowList :: [LinearTsrPricerStrategyTag] -> ShowS
showList :: [LinearTsrPricerStrategyTag] -> ShowS
Show,LinearTsrPricerStrategyTag -> LinearTsrPricerStrategyTag -> Bool
(LinearTsrPricerStrategyTag -> LinearTsrPricerStrategyTag -> Bool)
-> (LinearTsrPricerStrategyTag
-> LinearTsrPricerStrategyTag -> Bool)
-> Eq LinearTsrPricerStrategyTag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LinearTsrPricerStrategyTag -> LinearTsrPricerStrategyTag -> Bool
== :: LinearTsrPricerStrategyTag -> LinearTsrPricerStrategyTag -> Bool
$c/= :: LinearTsrPricerStrategyTag -> LinearTsrPricerStrategyTag -> Bool
/= :: LinearTsrPricerStrategyTag -> LinearTsrPricerStrategyTag -> Bool
Eq,ReadPrec [LinearTsrPricerStrategyTag]
ReadPrec LinearTsrPricerStrategyTag
Int -> ReadS LinearTsrPricerStrategyTag
ReadS [LinearTsrPricerStrategyTag]
(Int -> ReadS LinearTsrPricerStrategyTag)
-> ReadS [LinearTsrPricerStrategyTag]
-> ReadPrec LinearTsrPricerStrategyTag
-> ReadPrec [LinearTsrPricerStrategyTag]
-> Read LinearTsrPricerStrategyTag
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS LinearTsrPricerStrategyTag
readsPrec :: Int -> ReadS LinearTsrPricerStrategyTag
$creadList :: ReadS [LinearTsrPricerStrategyTag]
readList :: ReadS [LinearTsrPricerStrategyTag]
$creadPrec :: ReadPrec LinearTsrPricerStrategyTag
readPrec :: ReadPrec LinearTsrPricerStrategyTag
$creadListPrec :: ReadPrec [LinearTsrPricerStrategyTag]
readListPrec :: ReadPrec [LinearTsrPricerStrategyTag]
Read)
instance Enum LinearTsrPricerStrategyTag where
succ LinearTsrPricerRateBound = LinearTsrPricerVegaRatio
succ LinearTsrPricerVegaRatio = LinearTsrPricerPriceThreshold
succ LinearTsrPricerPriceThreshold = LinearTsrPricerBSStdDevs
succ LinearTsrPricerBSStdDevs = error "LinearTsrPricerStrategyTag.succ: LinearTsrPricerBSStdDevs has no successor"
pred :: LinearTsrPricerStrategyTag -> LinearTsrPricerStrategyTag
pred LinearTsrPricerStrategyTag
LinearTsrPricerVegaRatio = LinearTsrPricerStrategyTag
LinearTsrPricerRateBound
pred LinearTsrPricerStrategyTag
LinearTsrPricerPriceThreshold = LinearTsrPricerStrategyTag
LinearTsrPricerVegaRatio
pred LinearTsrPricerStrategyTag
LinearTsrPricerBSStdDevs = LinearTsrPricerStrategyTag
LinearTsrPricerPriceThreshold
pred LinearTsrPricerStrategyTag
LinearTsrPricerRateBound = String -> LinearTsrPricerStrategyTag
forall a. HasCallStack => String -> a
error String
"LinearTsrPricerStrategyTag.pred: LinearTsrPricerRateBound has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from LinearTsrPricerBSStdDevs
fromEnum LinearTsrPricerRateBound = 0
fromEnum LinearTsrPricerVegaRatio = 1
fromEnum LinearTsrPricerPriceThreshold = 2
fromEnum LinearTsrPricerBSStdDevs = 3
toEnum 0 = LinearTsrPricerRateBound
toEnum 1 = LinearTsrPricerVegaRatio
toEnum 2 = LinearTsrPricerPriceThreshold
toEnum 3 = LinearTsrPricerBSStdDevs
toEnum unmatched = error ("LinearTsrPricerStrategyTag.toEnum: Cannot match " ++ show unmatched)
{-# LINE 1618 "./QuantLib/CashFlow.chs" #-}
linearTsrPricer_ :: (GenSwaptionVolatilityStructure sv) -> (GenQuote q)
-> (Maybe (GenYieldTermStructure y))
-> (Int)
-> (Double)
-> (Bool)
-> (Double)
-> (Double)
-> IO ((CmsCouponPricer))
linearTsrPricer_ a1 a2 a3 a4 a5 a6 a7 a8 =
withSwaptionVolatilityStructure a1 $ \a1' ->
withQuote a2 $ \a2' ->
withMaybeYieldTermStructure a3 $ \a3' ->
let {a4' = fromIntegral a4} in
let {a5' = realToFrac a5} in
let {a6' = C2HSImp.fromBool a6} in
let {a7' = realToFrac a7} in
let {a8' = realToFrac a8} in
preErrorCheck $ \a9' ->
linearTsrPricer_'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
peekCmsCouponPricer res >>= \res' ->
errorCheck a9'>>
return (res')
{-# LINE 1629 "./QuantLib/CashFlow.chs" #-}
lognormalCmsSpreadPricer :: CmsCouponPricer -> GenQuote q -> Maybe (GenYieldTermStructure y) -> Word
-> Maybe VolatilityType -> Maybe Double -> Maybe Double -> IO FloatingRateCouponPricer
lognormalCmsSpreadPricer cmsPricer correlation discountCurve integrationPoints volatilityType shift1 shift2 =
lognormalCmsSpreadPricer_ cmsPricer correlation discountCurve integrationPoints
(maybe False (const True) volatilityType) (maybe 0 fromEnum volatilityType) shift1 shift2
lognormalCmsSpreadPricer_ :: (CmsCouponPricer) -> (GenQuote q) -> (Maybe (GenYieldTermStructure y)) -> (Word) -> (Bool) -> (Int) -> (Maybe Double) -> (Maybe Double) -> IO ((FloatingRateCouponPricer))
lognormalCmsSpreadPricer_ a1 a2 a3 a4 a5 a6 a7 a8 =
withCmsCouponPricer a1 $ \a1' ->
withQuote a2 $ \a2' ->
withMaybeYieldTermStructure a3 $ \a3' ->
let {a4' = fromIntegral a4} in
let {a5' = C2HSImp.fromBool a5} in
let {a6' = fromIntegral a6} in
let {a7' = fromMaybeDouble a7} in
let {a8' = fromMaybeDouble a8} in
preErrorCheck $ \a9' ->
lognormalCmsSpreadPricer_'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
peekFloatingRateCouponPricer res >>= \res' ->
errorCheck a9'>>
return (res')
{-# LINE 1642 "./QuantLib/CashFlow.chs" #-}
fixingDependencies :: GenLeg l -> IO [(String, Day)]
fixingDependencies l = uncurry zip <$> qlLegFixingDependencies l
qlLegFixingDependencies :: (GenLeg l) -> IO (([String]), ([Day]))
qlLegFixingDependencies :: forall l. GenLeg l -> IO ([String], [Day])
qlLegFixingDependencies GenLeg l
a1 =
GenLeg l
-> (Ptr CLeg' -> IO ([String], [Day])) -> IO ([String], [Day])
forall l b. GenLeg l -> (Ptr CLeg' -> IO b) -> IO b
withLeg GenLeg l
a1 ((Ptr CLeg' -> IO ([String], [Day])) -> IO ([String], [Day]))
-> (Ptr CLeg' -> IO ([String], [Day])) -> IO ([String], [Day])
forall a b. (a -> b) -> a -> b
$ \Ptr CLeg'
a1' ->
((Ptr CUInt, Ptr (Ptr (Ptr CChar))) -> IO ([String], [Day]))
-> IO ([String], [Day])
forall a b. ((Ptr CUInt, Ptr (Ptr a)) -> IO b) -> IO b
preArray (((Ptr CUInt, Ptr (Ptr (Ptr CChar))) -> IO ([String], [Day]))
-> IO ([String], [Day]))
-> ((Ptr CUInt, Ptr (Ptr (Ptr CChar))) -> IO ([String], [Day]))
-> IO ([String], [Day])
forall a b. (a -> b) -> a -> b
$ \(Ptr CUInt
a2'1, Ptr (Ptr (Ptr CChar))
a2'2) ->
((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([String], [Day]))
-> IO ([String], [Day])
forall a b. ((Ptr CUInt, Ptr (Ptr a)) -> IO b) -> IO b
preArray (((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([String], [Day]))
-> IO ([String], [Day]))
-> ((Ptr CUInt, Ptr (Ptr CInt)) -> IO ([String], [Day]))
-> IO ([String], [Day])
forall a b. (a -> b) -> a -> b
$ \(Ptr CUInt
a3'1, Ptr (Ptr CInt)
a3'2) ->
(Ptr (Ptr CChar) -> IO ([String], [Day])) -> IO ([String], [Day])
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO ([String], [Day])) -> IO ([String], [Day]))
-> (Ptr (Ptr CChar) -> IO ([String], [Day]))
-> IO ([String], [Day])
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a4' ->
Ptr CLeg'
-> Ptr CUInt
-> Ptr (Ptr (Ptr CChar))
-> Ptr CUInt
-> Ptr (Ptr CInt)
-> Ptr (Ptr CChar)
-> IO ()
qlLegFixingDependencies'_ Ptr CLeg'
a1' Ptr CUInt
a2'1 Ptr (Ptr (Ptr CChar))
a2'2 Ptr CUInt
a3'1 Ptr (Ptr CInt)
a3'2 Ptr (Ptr CChar)
a4' IO () -> IO [String] -> IO [String]
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Ptr CUInt -> Ptr (Ptr (Ptr CChar)) -> IO [String]
peekCStringArray Ptr CUInt
a2'1 Ptr (Ptr (Ptr CChar))
a2'2IO [String]
-> ([String] -> IO ([String], [Day])) -> IO ([String], [Day])
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \[String]
a2'' ->
Ptr CUInt -> Ptr (Ptr CInt) -> IO [Day]
peekDayArray Ptr CUInt
a3'1 Ptr (Ptr CInt)
a3'2IO [Day] -> ([Day] -> IO ([String], [Day])) -> IO ([String], [Day])
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \a3'' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a4'IO () -> IO ([String], [Day]) -> IO ([String], [Day])
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
([String], [Day]) -> IO ([String], [Day])
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ([String]
a2'', [Day]
a3'')
{-# LINE 1659 "./QuantLib/CashFlow.chs" #-}
class HasFixingDates coupon where
fixingDates :: coupon -> IO [Day]
instance HasFixingDates AverageBMACoupon where
fixingDates = averageBmaCouponFixingDatesRaw
instance HasFixingDates MultipleResetsCoupon where
fixingDates = multipleResetsCouponFixingDatesRaw
instance HasFixingDates OvernightIndexedCoupon where
fixingDates = overnightIndexedCouponFixingDatesRaw
class HasIndexFixings coupon where
indexFixings :: coupon -> IO [Double]
instance HasIndexFixings AverageBMACoupon where
indexFixings :: AverageBMACoupon -> IO [Double]
indexFixings = AverageBMACoupon -> IO [Double]
averageBmaCouponIndexFixingsRaw
instance HasIndexFixings OvernightIndexedCoupon where
indexFixings :: OvernightIndexedCoupon -> IO [Double]
indexFixings = OvernightIndexedCoupon -> IO [Double]
overnightIndexedCouponIndexFixingsRaw
foreign import ccall safe "QuantLib/CashFlow.chs.h qlLeg"
qlLeg'_ :: (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg')))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlSimpleCashFlow"
simpleCashFlow'_ :: (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCashFlow'))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowAmount"
amount'_ :: ((C2HSImp.Ptr (CCashFlow')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowDate"
date'_ :: ((C2HSImp.Ptr (CCashFlow')) -> (IO C2HSImp.CInt))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlIndexedCashFlow"
indexedCashFlow'_ :: (C2HSImp.CDouble -> ((C2HSImp.Ptr (CIndex')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CIndexedCashFlow'))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlIndexedCashFlowBaseFixing"
baseFixing'_ :: ((C2HSImp.Ptr (CIndexedCashFlow')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlIndexedCashFlowIndexFixing"
indexFixing'_ :: ((C2HSImp.Ptr (CIndexedCashFlow')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFixedRateCoupon"
fixedRateCoupon'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFixedRateCoupon')))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFixedRateCouponInterestRate"
interestRate'_ :: ((C2HSImp.Ptr (CFixedRateCoupon')) -> (IO (C2HSImp.Ptr (CInterestRate))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFloatingRateCoupon"
floatingRateCoupon'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CInterestRateIndex')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCoupon'))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlIborCouponExact"
iborCoupon'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CIborCoupon'))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlAverageBMACoupon"
averageBmaCoupon'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CBMAIndex')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CAverageBMACoupon'))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlAverageBMACouponFixingDates"
averageBmaCouponFixingDatesRaw'_ :: ((C2HSImp.Ptr (CAverageBMACoupon')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlAverageBMACouponIndexFixings"
averageBmaCouponIndexFixingsRaw'_ :: ((C2HSImp.Ptr (CAverageBMACoupon')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCappedFlooredCoupon"
cappedFlooredCoupon'_ :: ((C2HSImp.Ptr (CFloatingRateCoupon')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCoupon')))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlStrippedCappedFlooredCoupon"
strippedCappedFlooredCoupon'_ :: ((C2HSImp.Ptr (CFloatingRateCoupon')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CStrippedCappedFlooredCoupon')))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlStrippedCappedFlooredCouponCap"
capRate'_ :: ((C2HSImp.Ptr (CStrippedCappedFlooredCoupon')) -> (IO C2HSImp.CDouble))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlStrippedCappedFlooredCouponFloor"
floorRate'_ :: ((C2HSImp.Ptr (CStrippedCappedFlooredCoupon')) -> (IO C2HSImp.CDouble))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlStrippedCappedFlooredCouponEffectiveCap"
effectiveCap'_ :: ((C2HSImp.Ptr (CStrippedCappedFlooredCoupon')) -> (IO C2HSImp.CDouble))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlStrippedCappedFlooredCouponEffectiveFloor"
effectiveFloor'_ :: ((C2HSImp.Ptr (CStrippedCappedFlooredCoupon')) -> (IO C2HSImp.CDouble))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlStrippedCappedFlooredCouponIsCap"
isCap'_ :: ((C2HSImp.Ptr (CStrippedCappedFlooredCoupon')) -> (IO C2HSImp.CInt))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlStrippedCappedFlooredCouponIsFloor"
isFloor'_ :: ((C2HSImp.Ptr (CStrippedCappedFlooredCoupon')) -> (IO C2HSImp.CInt))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlStrippedCappedFlooredCouponIsCollar"
isCollar'_ :: ((C2HSImp.Ptr (CStrippedCappedFlooredCoupon')) -> (IO C2HSImp.CInt))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCappedFlooredIborCoupon"
cappedFlooredIborCoupon'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCoupon'))))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlDigitalIborCoupon"
digitalIborCoupon'_ :: ((C2HSImp.Ptr (CIborCoupon')) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CDigitalReplication)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CDigitalCoupon')))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlDigitalCoupon"
digitalCoupon'_ :: ((C2HSImp.Ptr (CFloatingRateCoupon')) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CDigitalReplication)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CDigitalCoupon')))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlDigitalCouponCallOptionRate"
callOptionRate'_ :: ((C2HSImp.Ptr (CDigitalCoupon')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlDigitalCouponPutOptionRate"
putOptionRate'_ :: ((C2HSImp.Ptr (CDigitalCoupon')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlMultipleResetsCoupon"
multipleResetsCoupon'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CSchedule)) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CMultipleResetsCoupon'))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlMultipleResetsCouponFixingDates"
multipleResetsCouponFixingDatesRaw'_ :: ((C2HSImp.Ptr (CMultipleResetsCoupon')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlRangeAccrualFloatersCoupon"
rangeAccrualFloatersCoupon'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CSchedule)) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CRangeAccrualFloatersCoupon'))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlRangeAccrualFloatersCouponPriceWithoutOptionality"
priceWithoutOptionality'_ :: ((C2HSImp.Ptr (CRangeAccrualFloatersCoupon')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlYoYInflationCoupon"
yoyInflationCoupon'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CYoYInflationIndex')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CYoYInflationCoupon'))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlYoYInflationCouponAdjustedFixing"
adjustedFixing'_ :: ((C2HSImp.Ptr (CYoYInflationCoupon')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlAveragingMultipleResetsPricer"
averagingMultipleResetsPricer'_ :: ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCouponPricer'))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCompoundingMultipleResetsPricer"
compoundingMultipleResetsPricer'_ :: ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCouponPricer'))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlOvernightIndexedCoupon"
overnightIndexedCoupon'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (COvernightIndex')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COvernightIndexedCoupon'))))))))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlOvernightIndexedCouponFixingDates"
overnightIndexedCouponFixingDatesRaw'_ :: ((C2HSImp.Ptr (COvernightIndexedCoupon')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlOvernightIndexedCouponIndexFixings"
overnightIndexedCouponIndexFixingsRaw'_ :: ((C2HSImp.Ptr (COvernightIndexedCoupon')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCappedFlooredOvernightIndexedCoupon"
cappedFlooredOvernightIndexedCoupon'_ :: ((C2HSImp.Ptr (COvernightIndexedCoupon')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCoupon')))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCompoundingOvernightIndexedCouponPricer"
compoundingOvernightIndexedCouponPricer'_ :: ((C2HSImp.Ptr (COptionletVolatilityStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCouponPricer'))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlArithmeticAveragedOvernightIndexedCouponPricer"
arithmeticAveragedOvernightIndexedCouponPricer'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (COptionletVolatilityStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCouponPricer')))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlBlackCompoundingOvernightIndexedCouponPricer"
blackCompoundingOvernightIndexedCouponPricer'_ :: ((C2HSImp.Ptr (COptionletVolatilityStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCouponPricer'))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlBlackAveragingOvernightIndexedCouponPricer"
blackAveragingOvernightIndexedCouponPricer'_ :: ((C2HSImp.Ptr (COptionletVolatilityStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCouponPricer'))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCPICoupon"
cpiCoupon'_ :: (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CZeroInflationIndex')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCPICoupon'))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCPICouponFromBaseDate"
cpiCouponFromBaseDate'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CZeroInflationIndex')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCPICoupon'))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCPICouponWithBaseDate"
cpiCouponWithBaseDate'_ :: (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CZeroInflationIndex')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCPICoupon')))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCPICouponPricer"
cpiCouponPricer'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCPICouponPricer)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCPICouponPricerWithVol"
cpiCouponPricerWithVol'_ :: ((C2HSImp.Ptr (CCPIVolatilitySurface')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCPICouponPricer))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCPICouponSetPricer"
setCpiCouponPricer'_ :: ((C2HSImp.Ptr (CCPICoupon')) -> ((C2HSImp.Ptr (CCPICouponPricer)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCPICouponIndexRatio"
indexRatio'_ :: ((C2HSImp.Ptr (CCPICoupon')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlRedemption"
redemption'_ :: (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCashFlow'))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlAmortizingPayment"
amortizingPayment'_ :: (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCashFlow'))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowLeg"
cashFlowLeg'_ :: (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CCashFlow'))) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg'))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlLegStartDate"
startDate'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt)))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlNextCashFlows"
nextCashFlows'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg')))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlPreviousCashFlows"
previousCashFlows'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg')))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlLegCashFlows"
qlLegCashFlows'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CDouble)) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsDuration"
duration'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (CInterestRate)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsAccrualDays"
accrualDays'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsAccrualEndDate"
accrualEndDate'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsAccrualPeriod"
accrualPeriod'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsAccrualStartDate"
accrualStartDate'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsAccruedAmount"
accruedAmount'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsAccruedDays"
accruedDays'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsAccruedPeriod"
accruedPeriod'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsBasisPointValue"
basisPointValue'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (CInterestRate)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsBps1"
bpsFromYieldRaw'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (CInterestRate)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsConvexity"
convexity'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (CInterestRate)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsIsExpired"
isExpired'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsMaturityDate"
maturityDate'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt)))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsNextCashFlowAmount"
nextCashFlowAmount'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsNextCashFlowDate"
nextCashFlowDate'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsNextCouponRate"
nextCouponRate'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsNominal"
nominal'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsNpv1"
npvFromYieldRaw'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (CInterestRate)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsAtmRate"
atmRate'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsBps"
bpsFromCurveRaw'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsNpv3"
npvWithZSpreadRaw'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsNpv"
npvFromCurveRaw'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsNpvbps"
npvBps'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsZSpread"
zSpread'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsPreviousCashFlowAmount"
previousCashFlowAmount'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsPreviousCashFlowDate"
previousCashFlowDate'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsPreviousCouponRate"
previousCouponRate'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsReferencePeriodEnd"
referencePeriodEnd'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsReferencePeriodStart"
referencePeriodStart'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt)))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsYield"
yield'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCashFlowsYieldValueBasisPoint"
yieldValueBasisPoint'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (CInterestRate)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCouponAccrualStartDates"
couponAccrualStartDates'_ :: ((C2HSImp.Ptr (CCouponLeg')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFixedDividend"
fixedDividend'_ :: (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CDividend))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFractionalDividend1"
fractionalDividendWithNominal'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CDividend)))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFractionalDividend"
fractionalDividend'_ :: (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CDividend))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlAverageBMALeg"
averageBmaLeg'_ :: ((C2HSImp.Ptr (CSchedule)) -> ((C2HSImp.Ptr (CBMAIndex')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg'))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFixedRateLeg"
fixedRateLeg_'_ :: ((C2HSImp.Ptr (CSchedule)) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CInterestRate))) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> ((C2HSImp.Ptr (CCalendar)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg'))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlIborLeg"
iborLeg_'_ :: ((C2HSImp.Ptr (CSchedule)) -> ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg')))))))))))))))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCmsLeg"
cmsLeg_'_ :: ((C2HSImp.Ptr (CSchedule)) -> ((C2HSImp.Ptr (CSwapIndex')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg'))))))))))))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlOvernightLeg"
overnightLeg'_ :: ((C2HSImp.Ptr (CSchedule)) -> ((C2HSImp.Ptr (COvernightIndex')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg'))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlRangeAccrualLeg"
rangeAccrualLeg'_ :: ((C2HSImp.Ptr (CSchedule)) -> ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg')))))))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCPILeg"
cpiLeg'_ :: ((C2HSImp.Ptr (CSchedule)) -> ((C2HSImp.Ptr (CZeroInflationIndex')) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg'))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlYoYInflationLeg"
yoyInflationLeg'_ :: ((C2HSImp.Ptr (CSchedule)) -> ((C2HSImp.Ptr (CCalendar)) -> ((C2HSImp.Ptr (CYoYInflationIndex')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg'))))))))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlZeroInflationCashFlow"
zeroInflationCashFlow'_ :: (C2HSImp.CDouble -> ((C2HSImp.Ptr (CZeroInflationIndex')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CZeroInflationCashFlow')))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCPICashFlow"
cpiCashFlow'_ :: (C2HSImp.CDouble -> ((C2HSImp.Ptr (CZeroInflationIndex')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCPICashFlow'))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlEquityCashFlow"
equityCashFlow'_ :: (C2HSImp.CDouble -> ((C2HSImp.Ptr (CEquityIndex')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CEquityCashFlow'))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlEquityCashFlowSetPricer"
setEquityCashFlowPricer'_ :: ((C2HSImp.Ptr (CEquityCashFlow')) -> ((C2HSImp.Ptr (CEquityCashFlowPricer)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlEquityQuantoCashFlowPricer"
equityQuantoCashFlowPricer'_ :: ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> ((C2HSImp.Ptr (CBlackVolTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CEquityCashFlowPricer))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlQuantLibSetEquityCashFlowPricer"
setEquityLegPricer'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (CEquityCashFlowPricer)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlLegToCouponLeg"
toCouponLeg'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCouponLeg')))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCouponLegCoupons"
coupons'_ :: ((C2HSImp.Ptr (CCouponLeg')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr (C2HSImp.Ptr (CCoupon')))) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlBlackIborCouponPricer"
blackIborCouponPricer'_ :: ((C2HSImp.Ptr (COptionletVolatilityStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCouponPricer'))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlBlackIborQuantoCouponPricer"
blackIborQuantoCouponPricer'_ :: ((C2HSImp.Ptr (CBlackVolTermStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (COptionletVolatilityStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCouponPricer')))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlRangeAccrualPricerByBgm"
rangeAccrualPricerByBgm'_ :: (C2HSImp.CDouble -> ((C2HSImp.Ptr (CSmileSection)) -> ((C2HSImp.Ptr (CSmileSection)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCouponPricer')))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlBlackYoYInflationCouponPricer"
blackYoyInflationCouponPricer'_ :: ((C2HSImp.Ptr (CYoYOptionletVolatilitySurface')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CYoYInflationCouponPricer))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlUnitDisplacedBlackYoYInflationCouponPricer"
unitDisplacedBlackYoyInflationCouponPricer'_ :: ((C2HSImp.Ptr (CYoYOptionletVolatilitySurface')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CYoYInflationCouponPricer))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlBachelierYoYInflationCouponPricer"
bachelierYoyInflationCouponPricer'_ :: ((C2HSImp.Ptr (CYoYOptionletVolatilitySurface')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CYoYInflationCouponPricer))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlSetYoYInflationCouponPricer"
setYoyInflationCouponPricer'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (CYoYInflationCouponPricer)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlQuantLibSetCouponPricer"
setCouponPricer'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr (CFloatingRateCouponPricer')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlQuantLibSetCouponPricers"
setCouponPricers'_ :: ((C2HSImp.Ptr (CLeg')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CFloatingRateCouponPricer'))) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFloatingRateCouponPricerSwapletRate"
swapletRate'_ :: ((C2HSImp.Ptr (CFloatingRateCouponPricer')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFloatingRateCouponPricerSwapletPrice"
swapletPrice'_ :: ((C2HSImp.Ptr (CFloatingRateCouponPricer')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFloatingRateCouponPricerCapletPrice"
capletPrice'_ :: ((C2HSImp.Ptr (CFloatingRateCouponPricer')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFloatingRateCouponPricerCapletRate"
capletRate'_ :: ((C2HSImp.Ptr (CFloatingRateCouponPricer')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFloatingRateCouponPricerFloorletPrice"
floorletPrice'_ :: ((C2HSImp.Ptr (CFloatingRateCouponPricer')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFloatingRateCouponPricerFloorletRate"
floorletRate'_ :: ((C2HSImp.Ptr (CFloatingRateCouponPricer')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCmsCoupon"
cmsCoupon'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CSwapIndex')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCmsCoupon'))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCmsSpreadCoupon"
cmsSpreadCoupon'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CSwapSpreadIndex')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCoupon'))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCouponRate"
rate'_ :: ((C2HSImp.Ptr (CCoupon')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCouponAccruedAmount"
couponAccruedAmount'_ :: ((C2HSImp.Ptr (CCoupon')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFloatingRateCouponSetPricer"
setFloatingRateCouponPricer'_ :: ((C2HSImp.Ptr (CFloatingRateCoupon')) -> ((C2HSImp.Ptr (CFloatingRateCouponPricer')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFloatingRateCouponPrice"
price'_ :: ((C2HSImp.Ptr (CFloatingRateCoupon')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlFloatingRateCouponConvexityAdjustment"
convexityAdjustment'_ :: ((C2HSImp.Ptr (CFloatingRateCoupon')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCappedFlooredCmsCoupon"
cappedFlooredCmsCoupon'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CSwapIndex')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCoupon'))))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCappedFlooredCmsSpreadCoupon"
cappedFlooredCmsSpreadCoupon'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CSwapSpreadIndex')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCoupon'))))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlCmsSpreadLeg"
cmsSpreadLeg'_ :: ((C2HSImp.Ptr (CSchedule)) -> ((C2HSImp.Ptr (CSwapSpreadIndex')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg'))))))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlDigitalReplication"
digitalReplication'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CDigitalReplication))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlDigitalReplicationType"
replicationType'_ :: ((C2HSImp.Ptr (CDigitalReplication)) -> (IO C2HSImp.CInt))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlDigitalReplicationGap"
gap'_ :: ((C2HSImp.Ptr (CDigitalReplication)) -> (IO C2HSImp.CDouble))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlDigitalCmsCoupon"
digitalCmsCoupon'_ :: ((C2HSImp.Ptr (CCmsCoupon')) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CDigitalReplication)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CDigitalCmsCoupon')))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlDigitalCmsSpreadCoupon"
digitalCmsSpreadCoupon'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CSwapSpreadIndex')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CDigitalReplication)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CDigitalCmsSpreadCoupon'))))))))))))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlDigitalCmsLeg"
digitalCmsLeg_'_ :: ((C2HSImp.Ptr (CSchedule)) -> ((C2HSImp.Ptr (CSwapIndex')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDigitalReplication)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg')))))))))))))))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlDigitalIborLeg"
digitalIborLeg_'_ :: ((C2HSImp.Ptr (CSchedule)) -> ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDigitalReplication)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg')))))))))))))))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlDigitalCmsSpreadLeg"
digitalCmsSpreadLeg_'_ :: ((C2HSImp.Ptr (CSchedule)) -> ((C2HSImp.Ptr (CSwapSpreadIndex')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDigitalReplication)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg')))))))))))))))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlMultipleResetsLeg"
multipleResetsLeg_'_ :: ((C2HSImp.Ptr (CSchedule)) -> ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr (CDayCounter)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CUInt) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CLeg')))))))))))))))))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlAnalyticHaganPricer"
analyticHaganPricer'_ :: ((C2HSImp.Ptr (CSwaptionVolatilityStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCmsCouponPricer')))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlNumericHaganPricer"
numericHaganPricer'_ :: ((C2HSImp.Ptr (CSwaptionVolatilityStructure')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCmsCouponPricer')))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlLinearTsrPricer"
linearTsrPricer_'_ :: ((C2HSImp.Ptr (CSwaptionVolatilityStructure')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CCmsCouponPricer'))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlLognormalCmsSpreadPricer"
lognormalCmsSpreadPricer_'_ :: ((C2HSImp.Ptr (CCmsCouponPricer')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFloatingRateCouponPricer'))))))))))))
foreign import ccall safe "QuantLib/CashFlow.chs.h qlLegFixingDependencies"
qlLegFixingDependencies'_ :: ((C2HSImp.Ptr (CLeg')) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar))) -> ((C2HSImp.Ptr C2HSImp.CUInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CInt)) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ())))))))