{-# LINE 1 "./QuantLib/Quote.chs" #-}
module QuantLib.Quote
(
GenQuote
, Quote
, SimpleQuote
, DeltaVolQuote
, FuturesConvAdjustmentQuote
, RelinkableQuote
, PriceType(..)
, IntervalPriceType(..)
, AtmType(..)
, DeltaType(..)
, QuoteOp(..)
, MultiQuoteOp(..)
, asQuote
, simpleQuote
, deltaVolQuote
, atmVolQuote
, eurodollarFuturesImpliedStdDevQuote
, forwardSwapQuote
, forwardValueQuote
, futuresConvAdjustmentQuoteFromImmCode
, futuresConvAdjustmentQuote
, impliedStdDevQuote
, lastFixingQuote
, relinkableQuote
, derivedQuote
, compositeQuote
, multiCompositeQuote
, withDerivedQuote
, withCompositeQuote
, withMultiCompositeQuote
, setValue
, linkTo
, value
, isValid
, futuresValue
) where
import qualified Foreign.C.String as C2HSImp
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.ForeignPtr as C2HSImp
import qualified Foreign.Marshal.Utils as C2HSImp
import qualified Foreign.Ptr as C2HSImp
import Foreign.Ptr(FunPtr)
import QuantLib.Internal
import QuantLib.Internal.Common
import QuantLib.Internal.Type
data IntervalPriceType = IntervalPriceOpen
| IntervalPriceClose
| IntervalPriceHigh
| IntervalPriceLow
deriving (Enum,Show,Eq,Read)
{-# LINE 63 "./QuantLib/Quote.chs" #-}
data AtmType = AtmNull
| AtmSpot
| AtmFwd
| AtmDeltaNeutral
| AtmVegaMax
| AtmGammaMax
| AtmPutCall50
deriving (Enum,Show,Eq,Read)
{-# LINE 64 "./QuantLib/Quote.chs" #-}
data PriceType = Bid
| Ask
| Last
| Close
| Mid
| MidEquivalent
| MidSafe
deriving (Enum,Show,Eq,Read)
{-# LINE 65 "./QuantLib/Quote.chs" #-}
data DeltaType = Spot
| Fwd
| PaSpot
| PaFwd
deriving (Enum,Show,Eq,Read)
{-# LINE 66 "./QuantLib/Quote.chs" #-}
data QuoteOp = QuoteAdd
| QuoteSubtract
| QuoteMultiply
| QuoteDivide
deriving (Show,Eq,Read,Bounded)
instance Enum QuoteOp where
succ :: QuoteOp -> QuoteOp
succ QuoteOp
QuoteAdd = QuoteOp
QuoteSubtract
succ QuoteOp
QuoteSubtract = QuoteOp
QuoteMultiply
succ QuoteOp
QuoteMultiply = QuoteOp
QuoteDivide
succ QuoteOp
QuoteDivide = String -> QuoteOp
forall a. HasCallStack => String -> a
error String
"QuoteOp.succ: QuoteDivide has no successor"
pred :: QuoteOp -> QuoteOp
pred QuoteOp
QuoteSubtract = QuoteOp
QuoteAdd
pred QuoteOp
QuoteMultiply = QuoteOp
QuoteSubtract
pred QuoteOp
QuoteDivide = QuoteOp
QuoteMultiply
pred QuoteOp
QuoteAdd = String -> QuoteOp
forall a. HasCallStack => String -> a
error String
"QuoteOp.pred: QuoteAdd 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 QuoteDivide
fromEnum QuoteAdd = 0
fromEnum QuoteSubtract = 1
fromEnum QuoteMultiply = 2
fromEnum QuoteDivide = 3
toEnum 0 = QuoteAdd
toEnum 1 = QuoteSubtract
toEnum 2 = QuoteMultiply
toEnum 3 = QuoteDivide
toEnum unmatched = error ("QuoteOp.toEnum: Cannot match " ++ show unmatched)
setValue :: SimpleQuote -> Double -> IO Double
{-# LINE 71 "./QuantLib/Quote.chs" #-}
data MultiQuoteOp = QuoteSum
| QuoteProduct
| QuoteNorm2
deriving (Show,Eq,Read,Bounded)
instance Enum MultiQuoteOp where
succ QuoteSum = QuoteProduct
succ QuoteProduct = QuoteNorm2
succ QuoteNorm2 = error "MultiQuoteOp.succ: QuoteNorm2 has no successor"
pred QuoteProduct = QuoteSum
pred QuoteNorm2 = QuoteProduct
pred QuoteSum = error "MultiQuoteOp.pred: QuoteSum 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 QuoteNorm2
fromEnum QuoteSum = 0
fromEnum QuoteProduct = 1
fromEnum QuoteNorm2 = 2
toEnum 0 = QuoteSum
toEnum 1 = QuoteProduct
toEnum 2 = QuoteNorm2
toEnum unmatched = error ("MultiQuoteOp.toEnum: Cannot match " ++ show unmatched)
{-# LINE 74 "./QuantLib/Quote.chs" #-}
{-# LINE 76 "./QuantLib/Quote.chs" #-}
{-# LINE 77 "./QuantLib/Quote.chs" #-}
{-# LINE 78 "./QuantLib/Quote.chs" #-}
{-# LINE 79 "./QuantLib/Quote.chs" #-}
{-# LINE 80 "./QuantLib/Quote.chs" #-}
{-# LINE 81 "./QuantLib/Quote.chs" #-}
{-# LINE 82 "./QuantLib/Quote.chs" #-}
{-# LINE 83 "./QuantLib/Quote.chs" #-}
simpleQuote :: (Double) -> IO ((SimpleQuote))
simpleQuote a1 =
let {a1' = realToFrac a1} in
preErrorCheck $ \a2' ->
simpleQuote'_ a1' a2' >>= \res ->
peekSimpleQuote res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 86 "./QuantLib/Quote.chs" #-}
deltaVolQuote :: (Double)
-> (GenQuote q)
-> (Double)
-> (DeltaType) -> IO ((DeltaVolQuote))
deltaVolQuote a1 a2 a3 a4 =
let {a1' = realToFrac a1} in
withQuote a2 $ \a2' ->
let {a3' = realToFrac a3} in
let {a4' = fromEnumC a4} in
preErrorCheck $ \a5' ->
deltaVolQuote'_ a1' a2' a3' a4' a5' >>= \res ->
peekDeltaVolQuote res >>= \res' ->
errorCheck a5'>>
return (res')
{-# LINE 93 "./QuantLib/Quote.chs" #-}
atmVolQuote :: (GenQuote q)
-> (DeltaType) -> (Double)
-> (AtmType) -> IO ((DeltaVolQuote))
atmVolQuote a1 a2 a3 a4 =
withQuote a1 $ \a1' ->
let {a2' = fromEnumC a2} in
let {a3' = realToFrac a3} in
let {a4' = fromEnumC a4} in
preErrorCheck $ \a5' ->
atmVolQuote'_ a1' a2' a3' a4' a5' >>= \res ->
peekDeltaVolQuote res >>= \res' ->
errorCheck a5'>>
return (res')
{-# LINE 100 "./QuantLib/Quote.chs" #-}
value :: (GenQuote q) -> IO ((Double))
value a1 =
withQuote a1 $ \a1' ->
preErrorCheck $ \a2' ->
value'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 103 "./QuantLib/Quote.chs" #-}
setValue :: (SimpleQuote) -> (Double) -> IO ((Double))
setValue a1 a2 =
withGenQuote a1 $ \a1' ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
setValue'_ a1' a2' a3' >>= \res ->
let {res' = realToFrac res} in
errorCheck a3'>>
return (res')
{-# LINE 107 "./QuantLib/Quote.chs" #-}
eurodollarFuturesImpliedStdDevQuote :: (GenQuote q1)
-> (GenQuote q2)
-> (GenQuote q3)
-> (Double)
-> (Double)
-> (Double)
-> (Word)
-> IO ((Quote))
eurodollarFuturesImpliedStdDevQuote :: forall q1 q2 q3.
GenQuote q1
-> GenQuote q2
-> GenQuote q3
-> Double
-> Double
-> Double
-> Word
-> IO Quote
eurodollarFuturesImpliedStdDevQuote GenQuote q1
a1 GenQuote q2
a2 GenQuote q3
a3 Double
a4 Double
a5 Double
a6 Word
a7 =
GenQuote q1 -> (Ptr CQuote' -> IO Quote) -> IO Quote
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q1
a1 ((Ptr CQuote' -> IO Quote) -> IO Quote)
-> (Ptr CQuote' -> IO Quote) -> IO Quote
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a1' ->
withQuote a2 $ \a2' ->
withQuote a3 $ \a3' ->
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
let {a6' = realToFrac a6} in
let {a7' = fromIntegral a7} in
preErrorCheck $ \a8' ->
eurodollarFuturesImpliedStdDevQuote'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
peekQuote res >>= \res' ->
errorCheck a8'>>
return (res')
{-# LINE 117 "./QuantLib/Quote.chs" #-}
forwardSwapQuote :: (GenSwapIndex sidx) -> (GenQuote q)
-> ((Int,TimeUnit))
-> IO ((Quote))
forwardSwapQuote a1 a2 a3 =
withSwapIndex a1 $ \a1' ->
withQuote a2 $ \a2' ->
let {(a3'1, a3'2) = fromEnumQuantity a3} in
preErrorCheck $ \a4' ->
forwardSwapQuote'_ a1' a2' a3'1 a3'2 a4' >>= \res ->
peekQuote res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 122 "./QuantLib/Quote.chs" #-}
forwardValueQuote :: (GenIndex idx) -> (Day) -> IO ((Quote))
forwardValueQuote a1 a2 =
withIndex a1 $ \a1' ->
withDay a2 $ \a2' ->
preErrorCheck $ \a3' ->
forwardValueQuote'_ a1' a2' a3' >>= \res ->
peekQuote res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 125 "./QuantLib/Quote.chs" #-}
futuresConvAdjustmentQuoteFromImmCode :: (GenIborIndex ibor) -> (String)
-> (GenQuote q1)
-> (GenQuote q2)
-> (GenQuote q3)
-> IO ((FuturesConvAdjustmentQuote))
futuresConvAdjustmentQuoteFromImmCode a1 a2 a3 a4 a5 =
withIborIndex a1 $ \a1' ->
C2HSImp.withCString a2 $ \a2' ->
withQuote a3 $ \a3' ->
withQuote a4 $ \a4' ->
withQuote a5 $ \a5' ->
preErrorCheck $ \a6' ->
futuresConvAdjustmentQuoteFromImmCode'_ a1' a2' a3' a4' a5' a6' >>= \res ->
peekFuturesConvAdjustmentQuote res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 132 "./QuantLib/Quote.chs" #-}
futuresConvAdjustmentQuote :: (GenIborIndex ibor) -> (Day)
-> (GenQuote q1)
-> (GenQuote q2)
-> (GenQuote q3)
-> IO ((FuturesConvAdjustmentQuote))
futuresConvAdjustmentQuote a1 a2 a3 a4 a5 =
withIborIndex a1 $ \a1' ->
withDay a2 $ \a2' ->
withQuote a3 $ \a3' ->
withQuote a4 $ \a4' ->
withQuote a5 $ \a5' ->
preErrorCheck $ \a6' ->
futuresConvAdjustmentQuote'_ a1' a2' a3' a4' a5' a6' >>= \res ->
peekFuturesConvAdjustmentQuote res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 139 "./QuantLib/Quote.chs" #-}
futuresValue :: (FuturesConvAdjustmentQuote) -> IO ((Double))
futuresValue a1 =
withGenQuote a1 $ \a1' ->
preErrorCheck $ \a2' ->
futuresValue'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 142 "./QuantLib/Quote.chs" #-}
impliedStdDevQuote :: (OptionType) -> (GenQuote q1)
-> (GenQuote q2)
-> (Double)
-> (Double)
-> (Double)
-> (Word)
-> IO ((Quote))
impliedStdDevQuote :: forall q1 q2.
OptionType
-> GenQuote q1
-> GenQuote q2
-> Double
-> Double
-> Double
-> Word
-> IO Quote
impliedStdDevQuote OptionType
a1 GenQuote q1
a2 GenQuote q2
a3 Double
a4 Double
a5 Double
a6 Word
a7 =
let {a1' :: CInt
a1' = OptionType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC OptionType
a1} in
GenQuote q1 -> (Ptr CQuote' -> IO Quote) -> IO Quote
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q1
a2 ((Ptr CQuote' -> IO Quote) -> IO Quote)
-> (Ptr CQuote' -> IO Quote) -> IO Quote
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a2' ->
GenQuote q2 -> (Ptr CQuote' -> IO Quote) -> IO Quote
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q2
a3 ((Ptr CQuote' -> IO Quote) -> IO Quote)
-> (Ptr CQuote' -> IO Quote) -> IO Quote
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a3' ->
let {a4' :: CDouble
a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
let {a6' = realToFrac a6} in
let {a7' = fromIntegral a7} in
preErrorCheck $ \a8' ->
impliedStdDevQuote'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
peekQuote res >>= \res' ->
errorCheck a8'>>
return (res')
{-# LINE 151 "./QuantLib/Quote.chs" #-}
lastFixingQuote :: (GenIndex idx) -> IO ((Quote))
lastFixingQuote a1 =
withIndex a1 $ \a1' ->
preErrorCheck $ \a2' ->
lastFixingQuote'_ a1' a2' >>= \res ->
peekQuote res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 154 "./QuantLib/Quote.chs" #-}
isValid :: (GenQuote q) -> IO ((Bool))
isValid a1 =
withQuote a1 $ \a1' ->
preErrorCheck $ \a2' ->
isValid'_ a1' a2' >>= \res ->
let {res' = C2HSImp.toBool res} in
errorCheck a2'>>
return (res')
{-# LINE 157 "./QuantLib/Quote.chs" #-}
relinkableQuote :: (Maybe (GenQuote q)) -> IO ((RelinkableQuote))
relinkableQuote a1 =
withMaybeQuote a1 $ \a1' ->
preErrorCheck $ \a2' ->
relinkableQuote'_ a1' a2' >>= \res ->
peekRelinkableQuote res >>= \res' ->
errorCheck a2'>>
return (res')
{-# LINE 162 "./QuantLib/Quote.chs" #-}
linkTo :: (RelinkableQuote) -> (GenQuote q) -> IO ()
linkTo a1 a2 =
withRelinkableQuote a1 $ \a1' ->
withQuote a2 $ \a2' ->
preErrorCheck $ \a3' ->
linkTo'_ a1' a2' a3' >>
errorCheck a3'>>
return ()
{-# LINE 167 "./QuantLib/Quote.chs" #-}
derivedQuote :: (QuoteOp) -> (GenQuote q) -> (Double)
-> IO ((Quote))
derivedQuote :: forall q. QuoteOp -> GenQuote q -> Double -> IO Quote
derivedQuote QuoteOp
a1 GenQuote q
a2 Double
a3 =
let {a1' :: CInt
a1' = QuoteOp -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC QuoteOp
a1} in
GenQuote q -> (Ptr CQuote' -> IO Quote) -> IO Quote
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote GenQuote q
a2 ((Ptr CQuote' -> IO Quote) -> IO Quote)
-> (Ptr CQuote' -> IO Quote) -> IO Quote
forall a b. (a -> b) -> a -> b
$ \Ptr CQuote'
a2' ->
let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in
(Ptr (Ptr CChar) -> IO Quote) -> IO Quote
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Quote) -> IO Quote)
-> (Ptr (Ptr CChar) -> IO Quote) -> IO Quote
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a4' ->
CInt
-> Ptr CQuote' -> CDouble -> Ptr (Ptr CChar) -> IO (Ptr CQuote')
derivedQuote'_ CInt
a1' Ptr CQuote'
a2' CDouble
a3' Ptr (Ptr CChar)
a4' IO (Ptr CQuote') -> (Ptr CQuote' -> IO Quote) -> IO Quote
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CQuote'
res ->
Ptr CQuote' -> IO Quote
peekQuote Ptr CQuote'
res IO Quote -> (Quote -> IO Quote) -> IO Quote
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Quote
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a4'IO () -> IO Quote -> IO Quote
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Quote -> IO Quote
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Quote
res')
{-# LINE 179 "./QuantLib/Quote.chs" #-}
compositeQuote :: (QuoteOp) -> (GenQuote q1) -> (GenQuote q2) -> IO ((Quote))
compositeQuote a1 a2 a3 =
let {a1' = fromEnumC a1} in
withQuote a2 $ \a2' ->
withQuote a3 $ \a3' ->
preErrorCheck $ \a4' ->
compositeQuote'_ a1' a2' a3' a4' >>= \res ->
peekQuote res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 184 "./QuantLib/Quote.chs" #-}
multiCompositeQuote :: (MultiQuoteOp) -> ([GenQuote q]) -> IO ((Quote))
multiCompositeQuote a1 a2 =
let {a1' = fromEnumC a1} in
withQuoteArray a2 $ \(a2'1, a2'2) ->
preErrorCheck $ \a3' ->
multiCompositeQuote'_ a1' a2'1 a2'2 a3' >>= \res ->
peekQuote res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 191 "./QuantLib/Quote.chs" #-}
qlDerivedQuoteFromFunction :: (GenQuote q) -> (FunPtr QuoteUnaryFun) -> IO ((Quote))
qlDerivedQuoteFromFunction a1 a2 =
withQuote a1 $ \a1' ->
let {a2' = id a2} in
preErrorCheck $ \a3' ->
qlDerivedQuoteFromFunction'_ a1' a2' a3' >>= \res ->
peekQuote res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 194 "./QuantLib/Quote.chs" #-}
qlCompositeQuoteFromFunction :: (GenQuote q1) -> (GenQuote q2) -> (FunPtr QuoteBinaryFun) -> IO ((Quote))
qlCompositeQuoteFromFunction a1 a2 a3 =
withQuote a1 $ \a1' ->
withQuote a2 $ \a2' ->
let {a3' = id a3} in
preErrorCheck $ \a4' ->
qlCompositeQuoteFromFunction'_ a1' a2' a3' a4' >>= \res ->
peekQuote res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 196 "./QuantLib/Quote.chs" #-}
qlMultiCompositeQuoteFromFunction :: ([GenQuote q]) -> (FunPtr QuoteArrayFun) -> IO ((Quote))
qlMultiCompositeQuoteFromFunction a1 a2 =
withQuoteArray a1 $ \(a1'1, a1'2) ->
let {a2' = id a2} in
preErrorCheck $ \a3' ->
qlMultiCompositeQuoteFromFunction'_ a1'1 a1'2 a2' a3' >>= \res ->
peekQuote res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 198 "./QuantLib/Quote.chs" #-}
withDerivedQuote :: (Double -> Double)
-> GenQuote q -> (Quote -> IO b) -> IO b
withDerivedQuote f q k = withPayoffFun f (\fp -> qlDerivedQuoteFromFunction q fp >>= k)
withCompositeQuote :: (Double -> Double -> Double)
-> GenQuote q1 -> GenQuote q2 -> (Quote -> IO b) -> IO b
withCompositeQuote :: forall q1 q2 b.
(Double -> Double -> Double)
-> GenQuote q1 -> GenQuote q2 -> (Quote -> IO b) -> IO b
withCompositeQuote Double -> Double -> Double
f GenQuote q1
q1 GenQuote q2
q2 Quote -> IO b
k = (Double -> Double -> Double)
-> (FunPtr QuoteBinaryFun -> IO b) -> IO b
forall b.
(Double -> Double -> Double)
-> (FunPtr QuoteBinaryFun -> IO b) -> IO b
withQuoteBinaryFun Double -> Double -> Double
f (\FunPtr QuoteBinaryFun
fp -> GenQuote q1 -> GenQuote q2 -> FunPtr QuoteBinaryFun -> IO Quote
forall q1 q2.
GenQuote q1 -> GenQuote q2 -> FunPtr QuoteBinaryFun -> IO Quote
qlCompositeQuoteFromFunction GenQuote q1
q1 GenQuote q2
q2 FunPtr QuoteBinaryFun
fp IO Quote -> (Quote -> IO b) -> IO b
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Quote -> IO b
k)
withMultiCompositeQuote :: ([Double] -> Double)
-> [GenQuote q] -> (Quote -> IO b) -> IO b
withMultiCompositeQuote :: forall q b.
([Double] -> Double) -> [GenQuote q] -> (Quote -> IO b) -> IO b
withMultiCompositeQuote [Double] -> Double
f [GenQuote q]
qs Quote -> IO b
k = ([Double] -> Double)
-> (FunPtr BasketAccumulateFun -> IO b) -> IO b
forall b.
([Double] -> Double)
-> (FunPtr BasketAccumulateFun -> IO b) -> IO b
withBasketAccumulateFun [Double] -> Double
f (\FunPtr BasketAccumulateFun
fp -> [GenQuote q] -> FunPtr BasketAccumulateFun -> IO Quote
forall q. [GenQuote q] -> FunPtr BasketAccumulateFun -> IO Quote
qlMultiCompositeQuoteFromFunction [GenQuote q]
qs FunPtr BasketAccumulateFun
fp IO Quote -> (Quote -> IO b) -> IO b
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Quote -> IO b
k)
foreign import ccall safe "QuantLib/Quote.chs.h qlSimpleQuote"
simpleQuote'_ :: (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CSimpleQuote')))))
foreign import ccall safe "QuantLib/Quote.chs.h qlDeltaVolQuote1"
deltaVolQuote'_ :: (C2HSImp.CDouble -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CDeltaVolQuote'))))))))
foreign import ccall safe "QuantLib/Quote.chs.h qlDeltaVolQuote2"
atmVolQuote'_ :: ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CDeltaVolQuote'))))))))
foreign import ccall safe "QuantLib/Quote.chs.h qlQuoteValue"
value'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Quote.chs.h qlSimpleQuoteSetValue"
setValue'_ :: ((C2HSImp.Ptr (CSimpleQuote')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble))))
foreign import ccall safe "QuantLib/Quote.chs.h qlEurodollarFuturesImpliedStdDevQuote"
eurodollarFuturesImpliedStdDevQuote'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuote')))))))))))
foreign import ccall safe "QuantLib/Quote.chs.h qlForwardSwapQuote"
forwardSwapQuote'_ :: ((C2HSImp.Ptr (CSwapIndex')) -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuote'))))))))
foreign import ccall safe "QuantLib/Quote.chs.h qlForwardValueQuote"
forwardValueQuote'_ :: ((C2HSImp.Ptr (CIndex')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuote'))))))
foreign import ccall safe "QuantLib/Quote.chs.h qlFuturesConvAdjustmentQuote1"
futuresConvAdjustmentQuoteFromImmCode'_ :: ((C2HSImp.Ptr (CIborIndex')) -> ((C2HSImp.Ptr C2HSImp.CChar) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFuturesConvAdjustmentQuote')))))))))
foreign import ccall safe "QuantLib/Quote.chs.h qlFuturesConvAdjustmentQuote"
futuresConvAdjustmentQuote'_ :: ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CFuturesConvAdjustmentQuote')))))))))
foreign import ccall safe "QuantLib/Quote.chs.h qlFuturesConvAdjustmentQuoteFuturesValue"
futuresValue'_ :: ((C2HSImp.Ptr (CFuturesConvAdjustmentQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Quote.chs.h qlImpliedStdDevQuote"
impliedStdDevQuote'_ :: (C2HSImp.CInt -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuote')))))))))))
foreign import ccall safe "QuantLib/Quote.chs.h qlLastFixingQuote"
lastFixingQuote'_ :: ((C2HSImp.Ptr (CIndex')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuote')))))
foreign import ccall safe "QuantLib/Quote.chs.h qlQuoteIsValid"
isValid'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CInt)))
foreign import ccall safe "QuantLib/Quote.chs.h qlRelinkableQuote"
relinkableQuote'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CRelinkableQuote')))))
foreign import ccall safe "QuantLib/Quote.chs.h qlRelinkableQuoteLinkTo"
linkTo'_ :: ((C2HSImp.Ptr (CRelinkableQuote')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO ()))))
foreign import ccall safe "QuantLib/Quote.chs.h qlDerivedQuote"
derivedQuote'_ :: (C2HSImp.CInt -> ((C2HSImp.Ptr (CQuote')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuote')))))))
foreign import ccall safe "QuantLib/Quote.chs.h qlCompositeQuote"
compositeQuote'_ :: (C2HSImp.CInt -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuote')))))))
foreign import ccall safe "QuantLib/Quote.chs.h qlMultiCompositeQuote"
multiCompositeQuote'_ :: (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CQuote'))) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuote')))))))
foreign import ccall safe "QuantLib/Quote.chs.h qlDerivedQuoteFromFunction"
qlDerivedQuoteFromFunction'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.FunPtr (C2HSImp.CDouble -> (IO C2HSImp.CDouble))) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuote'))))))
foreign import ccall safe "QuantLib/Quote.chs.h qlCompositeQuoteFromFunction"
qlCompositeQuoteFromFunction'_ :: ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.Ptr (CQuote')) -> ((C2HSImp.FunPtr (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO C2HSImp.CDouble)))) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuote')))))))
foreign import ccall safe "QuantLib/Quote.chs.h qlMultiCompositeQuoteFromFunction"
qlMultiCompositeQuoteFromFunction'_ :: (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CQuote'))) -> ((C2HSImp.FunPtr ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CUInt -> (IO C2HSImp.CDouble)))) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuote')))))))