{-# LANGUAGE RankNTypes, TypeFamilies, TypeOperators, FlexibleContexts, FlexibleInstances #-}
module QuantLib.Internal.Type where
import Foreign.Ptr(Ptr, FunPtr, nullPtr, freeHaskellFunPtr)
import Foreign.ForeignPtr(ForeignPtr, FinalizerPtr, newForeignPtr, withForeignPtr)
import Foreign.C.Types(CUInt(..), CInt, CDouble(..))
import Foreign.C.String(CString)
import Foreign.Marshal.Array(withArray, peekArray)
import Foreign.Marshal.Utils(withMany)
import Foreign.Storable(peek)

import Control.Monad((>=>))
import System.IO.Unsafe(unsafePerformIO)

import QuantLib.Internal(RealVector, borrowRealVector, peekDynString, preArray, peekDayArray, peekPtrArray)
import Control.Exception (finally, mask)

(<.>) :: Functor f => (b -> r) -> (a -> f b) -> a -> f r
b -> r
f1 <.> :: forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> a -> f b
f2 = (b -> r) -> f b -> f r
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap b -> r
f1 (f b -> f r) -> (a -> f b) -> a -> f r
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> f b
f2

-- STANDALONE TYPES
newtype Standalone a = Standalone (ForeignPtr a)
foreign import ccall "dynamic" callFinalizer :: FinalizerPtr a -> Ptr a -> IO ()
class Finalizable a where
  finalize :: FinalizerPtr a
peekStandalone :: Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone :: forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone = ForeignPtr a -> Standalone a
forall a. ForeignPtr a -> Standalone a
Standalone (ForeignPtr a -> Standalone a)
-> (Ptr a -> IO (ForeignPtr a)) -> Ptr a -> IO (Standalone a)
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FinalizerPtr a
forall a. Finalizable a => FinalizerPtr a
finalize
withStandalone :: Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone :: forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone ForeignPtr a
p) = ForeignPtr a -> (Ptr a -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr a
p
withMaybeStandalone :: Maybe (Standalone a) -> (Ptr a -> IO b) -> IO b
withMaybeStandalone :: forall a b. Maybe (Standalone a) -> (Ptr a -> IO b) -> IO b
withMaybeStandalone Maybe (Standalone a)
x Ptr a -> IO b
f = IO b -> (Standalone a -> IO b) -> Maybe (Standalone a) -> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Ptr a -> IO b
f Ptr a
forall a. Ptr a
nullPtr) (Standalone a -> (Ptr a -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
`withStandalone` Ptr a -> IO b
f) Maybe (Standalone a)
x
withStandaloneArray :: (t -> Standalone a) -> [t] -> ((CUInt, Ptr (Ptr a)) -> IO b) -> IO b
withStandaloneArray :: forall t a b.
(t -> Standalone a)
-> [t] -> ((CUInt, Ptr (Ptr a)) -> IO b) -> IO b
withStandaloneArray t -> Standalone a
c [t]
x (CUInt, Ptr (Ptr a)) -> IO b
f = (Standalone a -> (Ptr a -> IO b) -> IO b)
-> [Standalone a] -> ([Ptr a] -> IO b) -> IO b
forall a b res.
(a -> (b -> res) -> res) -> [a] -> ([b] -> res) -> res
withMany Standalone a -> (Ptr a -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone ((t -> Standalone a) -> [t] -> [Standalone a]
forall a b. (a -> b) -> [a] -> [b]
map t -> Standalone a
c [t]
x) ([Ptr a] -> (Ptr (Ptr a) -> IO b) -> IO b
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
`withArray` (\Ptr (Ptr a)
px -> (CUInt, Ptr (Ptr a)) -> IO b
f (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> Int -> CUInt
forall a b. (a -> b) -> a -> b
$ [t] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [t]
x, Ptr (Ptr a)
px)))
-- The name of a QuantLib object is fixed for its lifetime, so reading it through
-- unsafePerformIO is safe; NOINLINE keeps GHC from duplicating or floating the C++
-- call, matching how QuantLib.Context guards its own unsafePerformIO sites.
showStandalone :: (Ptr a -> IO CString) -> Standalone a -> String
showStandalone :: forall a. (Ptr a -> IO CString) -> Standalone a -> String
showStandalone Ptr a -> IO CString
f Standalone a
x = IO String -> String
forall a. IO a -> a
unsafePerformIO (IO String -> String) -> IO String -> String
forall a b. (a -> b) -> a -> b
$ Standalone a -> (Ptr a -> IO String) -> IO String
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone Standalone a
x (Ptr a -> IO CString
f (Ptr a -> IO CString)
-> (CString -> IO String) -> Ptr a -> IO String
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> CString -> IO String
peekDynString)
{-# NOINLINE showStandalone #-}

-- On `safe' vs `unsafe' imports, file-wide (this was an open TODO; it is settled):
--   * The `&qlFreeX' finalizer imports below take a symbol *address*, not a call, so their
--     `unsafe' annotation is inert. The call that matters is `callFinalizer' above, plus
--     whatever the GC runs; both are safe.
--   * Everything that runs QuantLib logic stays `safe'. Under the non-threaded RTS an
--     `unsafe' call blocks GC and the scheduler for its whole duration, and pricing or
--     bootstrapping is unbounded.
--   * The qlXAsY upcast shims are the one legitimate `unsafe' candidate -- bare
--     `ret(new QlY(*arg(o)))', no callback into Haskell, bounded work -- but they are
--     already dominated by the QuantLib call they precede, so leave them `safe' absent a
--     measurement; a per-shim rule would break the first time one grows logic.
-- If a Haskell callback is ever passed into C++, every import on that path must be `safe'.
--
-- 'withCostFunction' below is the first such callback: it turns a Haskell @[Double] -> Double@
-- into a C function pointer QuantLib's optimizer calls back into once per outer iteration (the
-- whole parameter vector, not per component) -- the coarsened-callback shape documented in
-- CLAUDE.md's "coarsen the language-boundary crossing" bullet, modeled on QuantLib-SWIG's own
-- @PyCostFunction@ (@SWIG/functions.i@).
foreign import ccall "wrapper" mkCostFunPtr
  :: (Ptr CDouble -> CUInt -> IO CDouble) -> IO (FunPtr (Ptr CDouble -> CUInt -> IO CDouble))
-- Build a C function pointer around a Haskell cost function for the duration of one 'optimize'
-- call, freeing it with 'freeHaskellFunPtr' once the continuation returns, whether normally or
-- via exception.
withCostFunction :: (RealVector -> Double) -> (FunPtr (Ptr CDouble -> CUInt -> IO CDouble) -> IO b) -> IO b
withCostFunction :: forall b.
(RealVector -> Double)
-> (FunPtr (Ptr CDouble -> CUInt -> IO CDouble) -> IO b) -> IO b
withCostFunction RealVector -> Double
f FunPtr (Ptr CDouble -> CUInt -> IO CDouble) -> IO b
g = ((forall a. IO a -> IO a) -> IO b) -> IO b
forall b. ((forall a. IO a -> IO a) -> IO b) -> IO b
mask (((forall a. IO a -> IO a) -> IO b) -> IO b)
-> ((forall a. IO a -> IO a) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \forall a. IO a -> IO a
restore -> do
  fp <- (Ptr CDouble -> CUInt -> IO CDouble)
-> IO (FunPtr (Ptr CDouble -> CUInt -> IO CDouble))
mkCostFunPtr Ptr CDouble -> CUInt -> IO CDouble
call
  restore (g fp) `finally` freeHaskellFunPtr fp
  where
    call :: Ptr CDouble -> CUInt -> IO CDouble
call Ptr CDouble
xs CUInt
n = do
      x <- Ptr CDouble -> CUInt -> IO RealVector
borrowRealVector Ptr CDouble
xs CUInt
n
      pure (realToFrac (f x))

type FdmInnerValueFun = Ptr CDouble -> CUInt -> CDouble -> IO CDouble
foreign import ccall "wrapper" mkFdmInnerValueFunPtr :: FdmInnerValueFun -> IO (FunPtr FdmInnerValueFun)
-- |Wrap a Haskell @t -> nodeLocation -> value@ function as an 'FdmInnerValueFun' C callback, for
-- either of @FdmInnerValueCalculator::innerValue@\/@avgInnerValue@ -- the one hook in this file
-- that is a genuine, uncoarsened per-grid-node callback rather than a whole-grid one (see
-- 'QuantLib.Method.fdmSolve' and its accompanying haddock for why no batched shape exists here,
-- matching QuantLib-SWIG's own @FdmInnerValueCalculatorDelegate@). Reuses the same
-- mask\/finally\/freeHaskellFunPtr bracket as 'withCostFunction' above; unlike the
-- 'FdmApplyFun'-family callbacks, this one returns a single scalar so has no
-- 'pokeBoundedFdmResult'-style output-length hazard.
withFdmInnerValue :: (Double -> [Double] -> Double) -> (FunPtr FdmInnerValueFun -> IO b) -> IO b
withFdmInnerValue :: forall b.
(Double -> [Double] -> Double)
-> (FunPtr FdmInnerValueFun -> IO b) -> IO b
withFdmInnerValue Double -> [Double] -> Double
f FunPtr FdmInnerValueFun -> IO b
g = ((forall a. IO a -> IO a) -> IO b) -> IO b
forall b. ((forall a. IO a -> IO a) -> IO b) -> IO b
mask (((forall a. IO a -> IO a) -> IO b) -> IO b)
-> ((forall a. IO a -> IO a) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \forall a. IO a -> IO a
restore -> do
  fp <- FdmInnerValueFun -> IO (FunPtr FdmInnerValueFun)
mkFdmInnerValueFunPtr FdmInnerValueFun
call
  restore (g fp) `finally` freeHaskellFunPtr fp
  where
    call :: FdmInnerValueFun
call Ptr CDouble
locPtr CUInt
n CDouble
t = do
      loc <- Int -> Ptr CDouble -> IO [CDouble]
forall a. Storable a => Int -> Ptr a -> IO [a]
peekArray (CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
n) Ptr CDouble
locPtr
      pure (realToFrac (f (realToFrac t) (map realToFrac loc)))

type FdmGridMappingFun = CDouble -> IO CDouble
foreign import ccall "wrapper" mkFdmGridMappingFunPtr :: FdmGridMappingFun -> IO (FunPtr FdmGridMappingFun)
-- |Wrap a Haskell @Double -> Double@ function as an 'FdmGridMappingFun' C callback, for
-- @FdmCellAveragingInnerValue@'s optional @gridMapping@ (@QuantLib.Method.withCustomCellAveragingInnerValue@)
-- -- another genuine per-node callback (invoked from inside @avgInnerValueCalc@'s Simpson
-- integration and from every @innerValue@ call), same reasoning as 'withFdmInnerValue' above.
withFdmGridMapping :: (Double -> Double) -> (FunPtr FdmGridMappingFun -> IO b) -> IO b
withFdmGridMapping :: forall b.
(Double -> Double)
-> (FunPtr (CDouble -> IO CDouble) -> IO b) -> IO b
withFdmGridMapping Double -> Double
f FunPtr (CDouble -> IO CDouble) -> IO b
g = ((forall a. IO a -> IO a) -> IO b) -> IO b
forall b. ((forall a. IO a -> IO a) -> IO b) -> IO b
mask (((forall a. IO a -> IO a) -> IO b) -> IO b)
-> ((forall a. IO a -> IO a) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \forall a. IO a -> IO a
restore -> do
  fp <- (CDouble -> IO CDouble) -> IO (FunPtr (CDouble -> IO CDouble))
mkFdmGridMappingFunPtr CDouble -> IO CDouble
call
  restore (g fp) `finally` freeHaskellFunPtr fp
  where
    call :: CDouble -> IO CDouble
call CDouble
x = CDouble -> IO CDouble
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac (Double -> Double
f (CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
x)))

type PayoffFun = CDouble -> IO CDouble
foreign import ccall "wrapper" mkPayoffFunPtr :: PayoffFun -> IO (FunPtr PayoffFun)
-- |Wrap a Haskell @price -> value@ function as a 'PayoffFun' C callback, for
-- @QuantLib.Internal.Common.withCustomPayoff@. Another genuine, uncoarsened callback: QuantLib's
-- @Payoff::operator()@ takes one scalar price everywhere it is called -- per tree node in
-- @DiscretizedVanillaOption@, inside @FdmCellAveragingInnerValue@'s per-cell Simpson integral, per
-- path per exercise index in @AmericanPathPricer@ -- and nothing upstream batches an @Array@, so
-- there is no whole-vector shape to coarsen to (same situation as 'withFdmInnerValue' above).
withPayoffFun :: (Double -> Double) -> (FunPtr PayoffFun -> IO b) -> IO b
withPayoffFun :: forall b.
(Double -> Double)
-> (FunPtr (CDouble -> IO CDouble) -> IO b) -> IO b
withPayoffFun Double -> Double
f FunPtr (CDouble -> IO CDouble) -> IO b
g = ((forall a. IO a -> IO a) -> IO b) -> IO b
forall b. ((forall a. IO a -> IO a) -> IO b) -> IO b
mask (((forall a. IO a -> IO a) -> IO b) -> IO b)
-> ((forall a. IO a -> IO a) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \forall a. IO a -> IO a
restore -> do
  fp <- (CDouble -> IO CDouble) -> IO (FunPtr (CDouble -> IO CDouble))
mkPayoffFunPtr CDouble -> IO CDouble
call
  restore (g fp) `finally` freeHaskellFunPtr fp
  where
    call :: CDouble -> IO CDouble
call CDouble
x = CDouble -> IO CDouble
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac (Double -> Double
f (CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
x)))

type BasketAccumulateFun = Ptr CDouble -> CUInt -> IO CDouble
foreign import ccall "wrapper" mkBasketAccumulateFunPtr :: BasketAccumulateFun -> IO (FunPtr BasketAccumulateFun)
-- |Wrap a Haskell @underlyings -> accumulated@ function as a 'BasketAccumulateFun' C callback, for
-- @QuantLib.Internal.Common.withCustomBasketPayoff@. Unlike 'withPayoffFun' this one /is/ already
-- coarsened by upstream's own interface: @BasketPayoff::accumulate@ takes the whole underlying-state
-- @Array@ per call, not one component at a time.
withBasketAccumulateFun :: ([Double] -> Double) -> (FunPtr BasketAccumulateFun -> IO b) -> IO b
withBasketAccumulateFun :: forall b.
([Double] -> Double)
-> (FunPtr (Ptr CDouble -> CUInt -> IO CDouble) -> IO b) -> IO b
withBasketAccumulateFun [Double] -> Double
f FunPtr (Ptr CDouble -> CUInt -> IO CDouble) -> IO b
g = ((forall a. IO a -> IO a) -> IO b) -> IO b
forall b. ((forall a. IO a -> IO a) -> IO b) -> IO b
mask (((forall a. IO a -> IO a) -> IO b) -> IO b)
-> ((forall a. IO a -> IO a) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \forall a. IO a -> IO a
restore -> do
  fp <- (Ptr CDouble -> CUInt -> IO CDouble)
-> IO (FunPtr (Ptr CDouble -> CUInt -> IO CDouble))
mkBasketAccumulateFunPtr Ptr CDouble -> CUInt -> IO CDouble
call
  restore (g fp) `finally` freeHaskellFunPtr fp
  where
    call :: Ptr CDouble -> CUInt -> IO CDouble
call Ptr CDouble
xs CUInt
n = do
      x <- Int -> Ptr CDouble -> IO [CDouble]
forall a. Storable a => Int -> Ptr a -> IO [a]
peekArray (CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUInt
n) Ptr CDouble
xs
      pure (realToFrac (f (map realToFrac x)))

-- |The unary callback a Haskell-defined @DerivedQuote@ crosses on, for
-- @QuantLib.Quote.withDerivedQuote@. Same C signature as 'PayoffFun', so it reuses
-- 'withPayoffFun' rather than duplicating the @wrapper@ import; the alias exists so the quote
-- bindings read in their own terms.
type QuoteUnaryFun = PayoffFun

-- |As 'QuoteUnaryFun', but for @MultiCompositeQuote@ (@QuantLib.Quote.withMultiCompositeQuote@):
-- same C signature as 'BasketAccumulateFun', and coarsened the same way -- upstream hands the
-- whole element vector over per evaluation.
type QuoteArrayFun = BasketAccumulateFun

type QuoteBinaryFun = CDouble -> CDouble -> IO CDouble
foreign import ccall "wrapper" mkQuoteBinaryFunPtr :: QuoteBinaryFun -> IO (FunPtr QuoteBinaryFun)
-- |Wrap a Haskell @value1 -> value2 -> value@ function as a 'QuoteBinaryFun' C callback, for
-- @QuantLib.Quote.withCompositeQuote@. The genuinely new arity of the three: @CompositeQuote@'s
-- @BinaryFunction@ takes both element values at once, so there is nothing to coarsen -- one
-- crossing per @Quote::value()@ evaluation is already the whole computation.
withQuoteBinaryFun :: (Double -> Double -> Double) -> (FunPtr QuoteBinaryFun -> IO b) -> IO b
withQuoteBinaryFun :: forall b.
(Double -> Double -> Double)
-> (FunPtr QuoteBinaryFun -> IO b) -> IO b
withQuoteBinaryFun Double -> Double -> Double
f FunPtr QuoteBinaryFun -> IO b
g = ((forall a. IO a -> IO a) -> IO b) -> IO b
forall b. ((forall a. IO a -> IO a) -> IO b) -> IO b
mask (((forall a. IO a -> IO a) -> IO b) -> IO b)
-> ((forall a. IO a -> IO a) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \forall a. IO a -> IO a
restore -> do
  fp <- QuoteBinaryFun -> IO (FunPtr QuoteBinaryFun)
mkQuoteBinaryFunPtr QuoteBinaryFun
call
  restore (g fp) `finally` freeHaskellFunPtr fp
  where
    call :: QuoteBinaryFun
call CDouble
x CDouble
y = CDouble -> IO CDouble
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac (Double -> Double -> Double
f (CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
x) (CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
y)))

data CCalendar
newtype Calendar = Calendar {Calendar -> Standalone CCalendar
getCCalendar :: Standalone CCalendar}
instance Finalizable CCalendar where finalize :: FinalizerPtr CCalendar
finalize = FinalizerPtr CCalendar
qlFreeCalendar
foreign import ccall unsafe "ql.h &qlFreeCalendar" qlFreeCalendar :: FinalizerPtr CCalendar
peekCalendar :: Ptr CCalendar -> IO Calendar
peekCalendar :: Ptr CCalendar -> IO Calendar
peekCalendar = Standalone CCalendar -> Calendar
Calendar (Standalone CCalendar -> Calendar)
-> (Ptr CCalendar -> IO (Standalone CCalendar))
-> Ptr CCalendar
-> IO Calendar
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCalendar -> IO (Standalone CCalendar)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withCalendar :: Calendar -> (Ptr CCalendar -> IO b) -> IO b
withCalendar :: forall b. Calendar -> (Ptr CCalendar -> IO b) -> IO b
withCalendar = Standalone CCalendar -> (Ptr CCalendar -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CCalendar -> (Ptr CCalendar -> IO b) -> IO b)
-> (Calendar -> Standalone CCalendar)
-> Calendar
-> (Ptr CCalendar -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Calendar -> Standalone CCalendar
getCCalendar
foreign import ccall safe "ql.h qlCalendarName" qlCalendarName :: Ptr CCalendar -> IO CString
instance Show Calendar where show :: Calendar -> String
show Calendar
x = (Ptr CCalendar -> IO CString) -> Standalone CCalendar -> String
forall a. (Ptr a -> IO CString) -> Standalone a -> String
showStandalone Ptr CCalendar -> IO CString
qlCalendarName (Calendar -> Standalone CCalendar
getCCalendar Calendar
x)
-- Equality by name, here and for the Currency/Region/DayCounter/Schedule instances
-- below. This is deliberate: it is how QuantLib itself compares these types.
instance Eq Calendar where Calendar
x == :: Calendar -> Calendar -> Bool
== Calendar
y = Calendar -> String
forall a. Show a => a -> String
show Calendar
x String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== Calendar -> String
forall a. Show a => a -> String
show Calendar
y

data CCurrency
newtype Currency = Currency {Currency -> Standalone CCurrency
getCCurrency :: Standalone CCurrency}
foreign import ccall unsafe "ql.h &qlFreeCurrency" qlFreeCurrency :: FinalizerPtr CCurrency
instance Finalizable CCurrency where finalize :: FinalizerPtr CCurrency
finalize = FinalizerPtr CCurrency
qlFreeCurrency
peekCurrency :: Ptr CCurrency -> IO Currency
peekCurrency :: Ptr CCurrency -> IO Currency
peekCurrency = Standalone CCurrency -> Currency
Currency (Standalone CCurrency -> Currency)
-> (Ptr CCurrency -> IO (Standalone CCurrency))
-> Ptr CCurrency
-> IO Currency
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCurrency -> IO (Standalone CCurrency)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withCurrency :: Currency -> (Ptr CCurrency -> IO b) -> IO b
withCurrency :: forall b. Currency -> (Ptr CCurrency -> IO b) -> IO b
withCurrency = Standalone CCurrency -> (Ptr CCurrency -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CCurrency -> (Ptr CCurrency -> IO b) -> IO b)
-> (Currency -> Standalone CCurrency)
-> Currency
-> (Ptr CCurrency -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Currency -> Standalone CCurrency
getCCurrency
withMaybeCurrency :: Maybe Currency -> (Ptr CCurrency -> IO b) -> IO b
withMaybeCurrency :: forall b. Maybe Currency -> (Ptr CCurrency -> IO b) -> IO b
withMaybeCurrency = Maybe (Standalone CCurrency) -> (Ptr CCurrency -> IO b) -> IO b
forall a b. Maybe (Standalone a) -> (Ptr a -> IO b) -> IO b
withMaybeStandalone (Maybe (Standalone CCurrency) -> (Ptr CCurrency -> IO b) -> IO b)
-> (Maybe Currency -> Maybe (Standalone CCurrency))
-> Maybe Currency
-> (Ptr CCurrency -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Currency -> Standalone CCurrency
getCCurrency (Currency -> Standalone CCurrency)
-> Maybe Currency -> Maybe (Standalone CCurrency)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>)
peekMaybeCurrency :: Ptr CCurrency -> IO (Maybe Currency)
peekMaybeCurrency :: Ptr CCurrency -> IO (Maybe Currency)
peekMaybeCurrency Ptr CCurrency
p
  | Ptr CCurrency
p Ptr CCurrency -> Ptr CCurrency -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr CCurrency
forall a. Ptr a
nullPtr = Maybe Currency -> IO (Maybe Currency)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe Currency
forall a. Maybe a
Nothing
  | Bool
otherwise = Currency -> Maybe Currency
forall a. a -> Maybe a
Just (Currency -> Maybe Currency) -> IO Currency -> IO (Maybe Currency)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr CCurrency -> IO Currency
peekCurrency Ptr CCurrency
p
-- |Peek a 'Currency' out of a @Currency**@ out-parameter (as opposed to 'peekCurrency', which
-- peeks it directly out of a @Currency*@ primary return).
peekCurrencyPtr :: Ptr (Ptr CCurrency) -> IO Currency
peekCurrencyPtr :: Ptr (Ptr CCurrency) -> IO Currency
peekCurrencyPtr = Ptr (Ptr CCurrency) -> IO (Ptr CCurrency)
forall a. Storable a => Ptr a -> IO a
peek (Ptr (Ptr CCurrency) -> IO (Ptr CCurrency))
-> (Ptr CCurrency -> IO Currency)
-> Ptr (Ptr CCurrency)
-> IO Currency
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> Ptr CCurrency -> IO Currency
peekCurrency
-- |Split a @(Double, Currency)@ cash amount (QuantLib's 'Money', per the @Period@-as-tuple
-- convention) into the @(double, Currency*)@ pair of C arguments it marshals to, for use with
-- the c2hs @&@ splitter -- the input-direction counterpart of 'peekCurrencyPtr'.
withMoney :: (Double, Currency) -> ((CDouble, Ptr CCurrency) -> IO b) -> IO b
withMoney :: forall b.
(Double, Currency) -> ((CDouble, Ptr CCurrency) -> IO b) -> IO b
withMoney (Double
amount, Currency
ccy) (CDouble, Ptr CCurrency) -> IO b
f = Currency -> (Ptr CCurrency -> IO b) -> IO b
forall b. Currency -> (Ptr CCurrency -> IO b) -> IO b
withCurrency Currency
ccy (\Ptr CCurrency
p -> (CDouble, Ptr CCurrency) -> IO b
f (Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
amount, Ptr CCurrency
p))
foreign import ccall safe "ql.h qlCurrencyName" qlCurrencyName :: Ptr CCurrency -> IO CString
instance Show Currency where show :: Currency -> String
show Currency
x = (Ptr CCurrency -> IO CString) -> Standalone CCurrency -> String
forall a. (Ptr a -> IO CString) -> Standalone a -> String
showStandalone Ptr CCurrency -> IO CString
qlCurrencyName (Currency -> Standalone CCurrency
getCCurrency Currency
x)
instance Eq Currency where Currency
x == :: Currency -> Currency -> Bool
== Currency
y = Currency -> String
forall a. Show a => a -> String
show Currency
x String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== Currency -> String
forall a. Show a => a -> String
show Currency
y

data CCommodityType
newtype CommodityType = CommodityType {CommodityType -> Standalone CCommodityType
getCCommodityType :: Standalone CCommodityType}
foreign import ccall unsafe "ql.h &qlFreeCommodityType" qlFreeCommodityType :: FinalizerPtr CCommodityType
instance Finalizable CCommodityType where finalize :: FinalizerPtr CCommodityType
finalize = FinalizerPtr CCommodityType
qlFreeCommodityType
peekCommodityType :: Ptr CCommodityType -> IO CommodityType
peekCommodityType :: Ptr CCommodityType -> IO CommodityType
peekCommodityType = Standalone CCommodityType -> CommodityType
CommodityType (Standalone CCommodityType -> CommodityType)
-> (Ptr CCommodityType -> IO (Standalone CCommodityType))
-> Ptr CCommodityType
-> IO CommodityType
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCommodityType -> IO (Standalone CCommodityType)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withCommodityType :: CommodityType -> (Ptr CCommodityType -> IO b) -> IO b
withCommodityType :: forall b. CommodityType -> (Ptr CCommodityType -> IO b) -> IO b
withCommodityType = Standalone CCommodityType -> (Ptr CCommodityType -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CCommodityType -> (Ptr CCommodityType -> IO b) -> IO b)
-> (CommodityType -> Standalone CCommodityType)
-> CommodityType
-> (Ptr CCommodityType -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CommodityType -> Standalone CCommodityType
getCCommodityType
withMaybeCommodityType :: Maybe CommodityType -> (Ptr CCommodityType -> IO b) -> IO b
withMaybeCommodityType :: forall b.
Maybe CommodityType -> (Ptr CCommodityType -> IO b) -> IO b
withMaybeCommodityType = Maybe (Standalone CCommodityType)
-> (Ptr CCommodityType -> IO b) -> IO b
forall a b. Maybe (Standalone a) -> (Ptr a -> IO b) -> IO b
withMaybeStandalone (Maybe (Standalone CCommodityType)
 -> (Ptr CCommodityType -> IO b) -> IO b)
-> (Maybe CommodityType -> Maybe (Standalone CCommodityType))
-> Maybe CommodityType
-> (Ptr CCommodityType -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (CommodityType -> Standalone CCommodityType
getCCommodityType (CommodityType -> Standalone CCommodityType)
-> Maybe CommodityType -> Maybe (Standalone CCommodityType)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>)
peekMaybeCommodityType :: Ptr CCommodityType -> IO (Maybe CommodityType)
peekMaybeCommodityType :: Ptr CCommodityType -> IO (Maybe CommodityType)
peekMaybeCommodityType Ptr CCommodityType
p
  | Ptr CCommodityType
p Ptr CCommodityType -> Ptr CCommodityType -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr CCommodityType
forall a. Ptr a
nullPtr = Maybe CommodityType -> IO (Maybe CommodityType)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe CommodityType
forall a. Maybe a
Nothing
  | Bool
otherwise = CommodityType -> Maybe CommodityType
forall a. a -> Maybe a
Just (CommodityType -> Maybe CommodityType)
-> IO CommodityType -> IO (Maybe CommodityType)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr CCommodityType -> IO CommodityType
peekCommodityType Ptr CCommodityType
p
foreign import ccall safe "ql.h qlCommodityTypeCode" qlCommodityTypeCode :: Ptr CCommodityType -> IO CString
instance Show CommodityType where show :: CommodityType -> String
show CommodityType
x = (Ptr CCommodityType -> IO CString)
-> Standalone CCommodityType -> String
forall a. (Ptr a -> IO CString) -> Standalone a -> String
showStandalone Ptr CCommodityType -> IO CString
qlCommodityTypeCode (CommodityType -> Standalone CCommodityType
getCCommodityType CommodityType
x)
instance Eq CommodityType where CommodityType
x == :: CommodityType -> CommodityType -> Bool
== CommodityType
y = CommodityType -> String
forall a. Show a => a -> String
show CommodityType
x String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== CommodityType -> String
forall a. Show a => a -> String
show CommodityType
y
-- |Peek a 'CommodityType' out of a @CommodityType**@ out-parameter (as opposed to
-- 'peekCommodityType', which peeks it directly out of a @CommodityType*@ primary return).
peekCommodityTypePtr :: Ptr (Ptr CCommodityType) -> IO CommodityType
peekCommodityTypePtr :: Ptr (Ptr CCommodityType) -> IO CommodityType
peekCommodityTypePtr = Ptr (Ptr CCommodityType) -> IO (Ptr CCommodityType)
forall a. Storable a => Ptr a -> IO a
peek (Ptr (Ptr CCommodityType) -> IO (Ptr CCommodityType))
-> (Ptr CCommodityType -> IO CommodityType)
-> Ptr (Ptr CCommodityType)
-> IO CommodityType
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> Ptr CCommodityType -> IO CommodityType
peekCommodityType

data CUnitOfMeasure
newtype UnitOfMeasure = UnitOfMeasure {UnitOfMeasure -> Standalone CUnitOfMeasure
getCUnitOfMeasure :: Standalone CUnitOfMeasure}
foreign import ccall unsafe "ql.h &qlFreeUnitOfMeasure" qlFreeUnitOfMeasure :: FinalizerPtr CUnitOfMeasure
instance Finalizable CUnitOfMeasure where finalize :: FinalizerPtr CUnitOfMeasure
finalize = FinalizerPtr CUnitOfMeasure
qlFreeUnitOfMeasure
peekUnitOfMeasure :: Ptr CUnitOfMeasure -> IO UnitOfMeasure
peekUnitOfMeasure :: Ptr CUnitOfMeasure -> IO UnitOfMeasure
peekUnitOfMeasure = Standalone CUnitOfMeasure -> UnitOfMeasure
UnitOfMeasure (Standalone CUnitOfMeasure -> UnitOfMeasure)
-> (Ptr CUnitOfMeasure -> IO (Standalone CUnitOfMeasure))
-> Ptr CUnitOfMeasure
-> IO UnitOfMeasure
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CUnitOfMeasure -> IO (Standalone CUnitOfMeasure)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withUnitOfMeasure :: UnitOfMeasure -> (Ptr CUnitOfMeasure -> IO b) -> IO b
withUnitOfMeasure :: forall b. UnitOfMeasure -> (Ptr CUnitOfMeasure -> IO b) -> IO b
withUnitOfMeasure = Standalone CUnitOfMeasure -> (Ptr CUnitOfMeasure -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CUnitOfMeasure -> (Ptr CUnitOfMeasure -> IO b) -> IO b)
-> (UnitOfMeasure -> Standalone CUnitOfMeasure)
-> UnitOfMeasure
-> (Ptr CUnitOfMeasure -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UnitOfMeasure -> Standalone CUnitOfMeasure
getCUnitOfMeasure
withMaybeUnitOfMeasure :: Maybe UnitOfMeasure -> (Ptr CUnitOfMeasure -> IO b) -> IO b
withMaybeUnitOfMeasure :: forall b.
Maybe UnitOfMeasure -> (Ptr CUnitOfMeasure -> IO b) -> IO b
withMaybeUnitOfMeasure = Maybe (Standalone CUnitOfMeasure)
-> (Ptr CUnitOfMeasure -> IO b) -> IO b
forall a b. Maybe (Standalone a) -> (Ptr a -> IO b) -> IO b
withMaybeStandalone (Maybe (Standalone CUnitOfMeasure)
 -> (Ptr CUnitOfMeasure -> IO b) -> IO b)
-> (Maybe UnitOfMeasure -> Maybe (Standalone CUnitOfMeasure))
-> Maybe UnitOfMeasure
-> (Ptr CUnitOfMeasure -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (UnitOfMeasure -> Standalone CUnitOfMeasure
getCUnitOfMeasure (UnitOfMeasure -> Standalone CUnitOfMeasure)
-> Maybe UnitOfMeasure -> Maybe (Standalone CUnitOfMeasure)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>)
peekMaybeUnitOfMeasure :: Ptr CUnitOfMeasure -> IO (Maybe UnitOfMeasure)
peekMaybeUnitOfMeasure :: Ptr CUnitOfMeasure -> IO (Maybe UnitOfMeasure)
peekMaybeUnitOfMeasure Ptr CUnitOfMeasure
p
  | Ptr CUnitOfMeasure
p Ptr CUnitOfMeasure -> Ptr CUnitOfMeasure -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr CUnitOfMeasure
forall a. Ptr a
nullPtr = Maybe UnitOfMeasure -> IO (Maybe UnitOfMeasure)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe UnitOfMeasure
forall a. Maybe a
Nothing
  | Bool
otherwise = UnitOfMeasure -> Maybe UnitOfMeasure
forall a. a -> Maybe a
Just (UnitOfMeasure -> Maybe UnitOfMeasure)
-> IO UnitOfMeasure -> IO (Maybe UnitOfMeasure)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr CUnitOfMeasure -> IO UnitOfMeasure
peekUnitOfMeasure Ptr CUnitOfMeasure
p
foreign import ccall safe "ql.h qlUnitOfMeasureCode" qlUnitOfMeasureCode :: Ptr CUnitOfMeasure -> IO CString
instance Show UnitOfMeasure where show :: UnitOfMeasure -> String
show UnitOfMeasure
x = (Ptr CUnitOfMeasure -> IO CString)
-> Standalone CUnitOfMeasure -> String
forall a. (Ptr a -> IO CString) -> Standalone a -> String
showStandalone Ptr CUnitOfMeasure -> IO CString
qlUnitOfMeasureCode (UnitOfMeasure -> Standalone CUnitOfMeasure
getCUnitOfMeasure UnitOfMeasure
x)
instance Eq UnitOfMeasure where UnitOfMeasure
x == :: UnitOfMeasure -> UnitOfMeasure -> Bool
== UnitOfMeasure
y = UnitOfMeasure -> String
forall a. Show a => a -> String
show UnitOfMeasure
x String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== UnitOfMeasure -> String
forall a. Show a => a -> String
show UnitOfMeasure
y
-- |Peek a 'UnitOfMeasure' out of a @UnitOfMeasure**@ out-parameter (as opposed to
-- 'peekUnitOfMeasure', which peeks it directly out of a @UnitOfMeasure*@ primary return).
peekUnitOfMeasurePtr :: Ptr (Ptr CUnitOfMeasure) -> IO UnitOfMeasure
peekUnitOfMeasurePtr :: Ptr (Ptr CUnitOfMeasure) -> IO UnitOfMeasure
peekUnitOfMeasurePtr = Ptr (Ptr CUnitOfMeasure) -> IO (Ptr CUnitOfMeasure)
forall a. Storable a => Ptr a -> IO a
peek (Ptr (Ptr CUnitOfMeasure) -> IO (Ptr CUnitOfMeasure))
-> (Ptr CUnitOfMeasure -> IO UnitOfMeasure)
-> Ptr (Ptr CUnitOfMeasure)
-> IO UnitOfMeasure
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> Ptr CUnitOfMeasure -> IO UnitOfMeasure
peekUnitOfMeasure

data CPaymentTerm
newtype PaymentTerm = PaymentTerm {PaymentTerm -> Standalone CPaymentTerm
getCPaymentTerm :: Standalone CPaymentTerm}
foreign import ccall unsafe "ql.h &qlFreePaymentTerm" qlFreePaymentTerm :: FinalizerPtr CPaymentTerm
instance Finalizable CPaymentTerm where finalize :: FinalizerPtr CPaymentTerm
finalize = FinalizerPtr CPaymentTerm
qlFreePaymentTerm
peekPaymentTerm :: Ptr CPaymentTerm -> IO PaymentTerm
peekPaymentTerm :: Ptr CPaymentTerm -> IO PaymentTerm
peekPaymentTerm = Standalone CPaymentTerm -> PaymentTerm
PaymentTerm (Standalone CPaymentTerm -> PaymentTerm)
-> (Ptr CPaymentTerm -> IO (Standalone CPaymentTerm))
-> Ptr CPaymentTerm
-> IO PaymentTerm
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CPaymentTerm -> IO (Standalone CPaymentTerm)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withPaymentTerm :: PaymentTerm -> (Ptr CPaymentTerm -> IO b) -> IO b
withPaymentTerm :: forall b. PaymentTerm -> (Ptr CPaymentTerm -> IO b) -> IO b
withPaymentTerm = Standalone CPaymentTerm -> (Ptr CPaymentTerm -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CPaymentTerm -> (Ptr CPaymentTerm -> IO b) -> IO b)
-> (PaymentTerm -> Standalone CPaymentTerm)
-> PaymentTerm
-> (Ptr CPaymentTerm -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PaymentTerm -> Standalone CPaymentTerm
getCPaymentTerm
withMaybePaymentTerm :: Maybe PaymentTerm -> (Ptr CPaymentTerm -> IO b) -> IO b
withMaybePaymentTerm :: forall b. Maybe PaymentTerm -> (Ptr CPaymentTerm -> IO b) -> IO b
withMaybePaymentTerm = Maybe (Standalone CPaymentTerm)
-> (Ptr CPaymentTerm -> IO b) -> IO b
forall a b. Maybe (Standalone a) -> (Ptr a -> IO b) -> IO b
withMaybeStandalone (Maybe (Standalone CPaymentTerm)
 -> (Ptr CPaymentTerm -> IO b) -> IO b)
-> (Maybe PaymentTerm -> Maybe (Standalone CPaymentTerm))
-> Maybe PaymentTerm
-> (Ptr CPaymentTerm -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (PaymentTerm -> Standalone CPaymentTerm
getCPaymentTerm (PaymentTerm -> Standalone CPaymentTerm)
-> Maybe PaymentTerm -> Maybe (Standalone CPaymentTerm)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>)
peekMaybePaymentTerm :: Ptr CPaymentTerm -> IO (Maybe PaymentTerm)
peekMaybePaymentTerm :: Ptr CPaymentTerm -> IO (Maybe PaymentTerm)
peekMaybePaymentTerm Ptr CPaymentTerm
p
  | Ptr CPaymentTerm
p Ptr CPaymentTerm -> Ptr CPaymentTerm -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr CPaymentTerm
forall a. Ptr a
nullPtr = Maybe PaymentTerm -> IO (Maybe PaymentTerm)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe PaymentTerm
forall a. Maybe a
Nothing
  | Bool
otherwise = PaymentTerm -> Maybe PaymentTerm
forall a. a -> Maybe a
Just (PaymentTerm -> Maybe PaymentTerm)
-> IO PaymentTerm -> IO (Maybe PaymentTerm)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr CPaymentTerm -> IO PaymentTerm
peekPaymentTerm Ptr CPaymentTerm
p
foreign import ccall safe "ql.h qlPaymentTermName" qlPaymentTermName :: Ptr CPaymentTerm -> IO CString
instance Show PaymentTerm where show :: PaymentTerm -> String
show PaymentTerm
x = (Ptr CPaymentTerm -> IO CString)
-> Standalone CPaymentTerm -> String
forall a. (Ptr a -> IO CString) -> Standalone a -> String
showStandalone Ptr CPaymentTerm -> IO CString
qlPaymentTermName (PaymentTerm -> Standalone CPaymentTerm
getCPaymentTerm PaymentTerm
x)
instance Eq PaymentTerm where PaymentTerm
x == :: PaymentTerm -> PaymentTerm -> Bool
== PaymentTerm
y = PaymentTerm -> String
forall a. Show a => a -> String
show PaymentTerm
x String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== PaymentTerm -> String
forall a. Show a => a -> String
show PaymentTerm
y

data CUnitOfMeasureConversion
newtype UnitOfMeasureConversion = UnitOfMeasureConversion {UnitOfMeasureConversion -> Standalone CUnitOfMeasureConversion
getCUnitOfMeasureConversion :: Standalone CUnitOfMeasureConversion}
foreign import ccall unsafe "ql.h &qlFreeUnitOfMeasureConversion" qlFreeUnitOfMeasureConversion :: FinalizerPtr CUnitOfMeasureConversion
instance Finalizable CUnitOfMeasureConversion where finalize :: FinalizerPtr CUnitOfMeasureConversion
finalize = FinalizerPtr CUnitOfMeasureConversion
qlFreeUnitOfMeasureConversion
peekUnitOfMeasureConversion :: Ptr CUnitOfMeasureConversion -> IO UnitOfMeasureConversion
peekUnitOfMeasureConversion :: Ptr CUnitOfMeasureConversion -> IO UnitOfMeasureConversion
peekUnitOfMeasureConversion = Standalone CUnitOfMeasureConversion -> UnitOfMeasureConversion
UnitOfMeasureConversion (Standalone CUnitOfMeasureConversion -> UnitOfMeasureConversion)
-> (Ptr CUnitOfMeasureConversion
    -> IO (Standalone CUnitOfMeasureConversion))
-> Ptr CUnitOfMeasureConversion
-> IO UnitOfMeasureConversion
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CUnitOfMeasureConversion
-> IO (Standalone CUnitOfMeasureConversion)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withUnitOfMeasureConversion :: UnitOfMeasureConversion -> (Ptr CUnitOfMeasureConversion -> IO b) -> IO b
withUnitOfMeasureConversion :: forall b.
UnitOfMeasureConversion
-> (Ptr CUnitOfMeasureConversion -> IO b) -> IO b
withUnitOfMeasureConversion = Standalone CUnitOfMeasureConversion
-> (Ptr CUnitOfMeasureConversion -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CUnitOfMeasureConversion
 -> (Ptr CUnitOfMeasureConversion -> IO b) -> IO b)
-> (UnitOfMeasureConversion -> Standalone CUnitOfMeasureConversion)
-> UnitOfMeasureConversion
-> (Ptr CUnitOfMeasureConversion -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UnitOfMeasureConversion -> Standalone CUnitOfMeasureConversion
getCUnitOfMeasureConversion
foreign import ccall safe "ql.h qlUnitOfMeasureConversionCode" qlUnitOfMeasureConversionCode :: Ptr CUnitOfMeasureConversion -> IO CString
instance Show UnitOfMeasureConversion where show :: UnitOfMeasureConversion -> String
show UnitOfMeasureConversion
x = (Ptr CUnitOfMeasureConversion -> IO CString)
-> Standalone CUnitOfMeasureConversion -> String
forall a. (Ptr a -> IO CString) -> Standalone a -> String
showStandalone Ptr CUnitOfMeasureConversion -> IO CString
qlUnitOfMeasureConversionCode (UnitOfMeasureConversion -> Standalone CUnitOfMeasureConversion
getCUnitOfMeasureConversion UnitOfMeasureConversion
x)
instance Eq UnitOfMeasureConversion where UnitOfMeasureConversion
x == :: UnitOfMeasureConversion -> UnitOfMeasureConversion -> Bool
== UnitOfMeasureConversion
y = UnitOfMeasureConversion -> String
forall a. Show a => a -> String
show UnitOfMeasureConversion
x String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== UnitOfMeasureConversion -> String
forall a. Show a => a -> String
show UnitOfMeasureConversion
y

data CExchangeRate
newtype ExchangeRate = ExchangeRate {ExchangeRate -> Standalone CExchangeRate
getCExchangeRate :: Standalone CExchangeRate}
foreign import ccall unsafe "ql.h &qlFreeExchangeRate" qlFreeExchangeRate :: FinalizerPtr CExchangeRate
instance Finalizable CExchangeRate where finalize :: FinalizerPtr CExchangeRate
finalize = FinalizerPtr CExchangeRate
qlFreeExchangeRate
peekExchangeRate :: Ptr CExchangeRate -> IO ExchangeRate
peekExchangeRate :: Ptr CExchangeRate -> IO ExchangeRate
peekExchangeRate = Standalone CExchangeRate -> ExchangeRate
ExchangeRate (Standalone CExchangeRate -> ExchangeRate)
-> (Ptr CExchangeRate -> IO (Standalone CExchangeRate))
-> Ptr CExchangeRate
-> IO ExchangeRate
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CExchangeRate -> IO (Standalone CExchangeRate)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withExchangeRate :: ExchangeRate -> (Ptr CExchangeRate -> IO b) -> IO b
withExchangeRate :: forall b. ExchangeRate -> (Ptr CExchangeRate -> IO b) -> IO b
withExchangeRate = Standalone CExchangeRate -> (Ptr CExchangeRate -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CExchangeRate -> (Ptr CExchangeRate -> IO b) -> IO b)
-> (ExchangeRate -> Standalone CExchangeRate)
-> ExchangeRate
-> (Ptr CExchangeRate -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ExchangeRate -> Standalone CExchangeRate
getCExchangeRate

data CRegion
newtype Region = Region {Region -> Standalone CRegion
getCRegion :: Standalone CRegion}
foreign import ccall unsafe "ql.h &qlFreeRegion" qlFreeRegion :: FinalizerPtr CRegion
instance Finalizable CRegion where finalize :: FinalizerPtr CRegion
finalize = FinalizerPtr CRegion
qlFreeRegion
peekRegion :: Ptr CRegion -> IO Region
peekRegion :: Ptr CRegion -> IO Region
peekRegion = Standalone CRegion -> Region
Region (Standalone CRegion -> Region)
-> (Ptr CRegion -> IO (Standalone CRegion))
-> Ptr CRegion
-> IO Region
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CRegion -> IO (Standalone CRegion)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withRegion :: Region -> (Ptr CRegion -> IO b) -> IO b
withRegion :: forall b. Region -> (Ptr CRegion -> IO b) -> IO b
withRegion = Standalone CRegion -> (Ptr CRegion -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CRegion -> (Ptr CRegion -> IO b) -> IO b)
-> (Region -> Standalone CRegion)
-> Region
-> (Ptr CRegion -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Region -> Standalone CRegion
getCRegion
foreign import ccall safe "ql.h qlRegionName" qlRegionName :: Ptr CRegion -> IO CString
instance Show Region where show :: Region -> String
show Region
x = (Ptr CRegion -> IO CString) -> Standalone CRegion -> String
forall a. (Ptr a -> IO CString) -> Standalone a -> String
showStandalone Ptr CRegion -> IO CString
qlRegionName (Region -> Standalone CRegion
getCRegion Region
x)
instance Eq Region where Region
x == :: Region -> Region -> Bool
== Region
y = Region -> String
forall a. Show a => a -> String
show Region
x String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== Region -> String
forall a. Show a => a -> String
show Region
y

data CDayCounter
newtype DayCounter = DayCounter {DayCounter -> Standalone CDayCounter
getCDayCounter :: Standalone CDayCounter}
foreign import ccall unsafe "ql.h &qlFreeDayCounter" qlFreeDayCounter :: FinalizerPtr CDayCounter
instance Finalizable CDayCounter where finalize :: FinalizerPtr CDayCounter
finalize = FinalizerPtr CDayCounter
qlFreeDayCounter
peekDayCounter :: Ptr CDayCounter -> IO DayCounter
peekDayCounter :: Ptr CDayCounter -> IO DayCounter
peekDayCounter = Standalone CDayCounter -> DayCounter
DayCounter (Standalone CDayCounter -> DayCounter)
-> (Ptr CDayCounter -> IO (Standalone CDayCounter))
-> Ptr CDayCounter
-> IO DayCounter
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CDayCounter -> IO (Standalone CDayCounter)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withDayCounter :: DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter :: forall b. DayCounter -> (Ptr CDayCounter -> IO b) -> IO b
withDayCounter = Standalone CDayCounter -> (Ptr CDayCounter -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CDayCounter -> (Ptr CDayCounter -> IO b) -> IO b)
-> (DayCounter -> Standalone CDayCounter)
-> DayCounter
-> (Ptr CDayCounter -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DayCounter -> Standalone CDayCounter
getCDayCounter
foreign import ccall safe "ql.h qlDayCounterName" qlDayCounterName :: Ptr CDayCounter -> IO CString
instance Show DayCounter where show :: DayCounter -> String
show DayCounter
x = (Ptr CDayCounter -> IO CString) -> Standalone CDayCounter -> String
forall a. (Ptr a -> IO CString) -> Standalone a -> String
showStandalone Ptr CDayCounter -> IO CString
qlDayCounterName (DayCounter -> Standalone CDayCounter
getCDayCounter DayCounter
x)
instance Eq DayCounter where DayCounter
x == :: DayCounter -> DayCounter -> Bool
== DayCounter
y = DayCounter -> String
forall a. Show a => a -> String
show DayCounter
x String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== DayCounter -> String
forall a. Show a => a -> String
show DayCounter
y

data CSchedule
newtype Schedule = Schedule {Schedule -> Standalone CSchedule
getCSchedule :: Standalone CSchedule}
foreign import ccall unsafe "ql.h &qlFreeSchedule" qlFreeSchedule :: FinalizerPtr CSchedule
instance Finalizable CSchedule where finalize :: FinalizerPtr CSchedule
finalize = FinalizerPtr CSchedule
qlFreeSchedule
peekSchedule :: Ptr CSchedule -> IO Schedule
peekSchedule :: Ptr CSchedule -> IO Schedule
peekSchedule = Standalone CSchedule -> Schedule
Schedule (Standalone CSchedule -> Schedule)
-> (Ptr CSchedule -> IO (Standalone CSchedule))
-> Ptr CSchedule
-> IO Schedule
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CSchedule -> IO (Standalone CSchedule)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withSchedule :: Schedule -> (Ptr CSchedule -> IO b) -> IO b
withSchedule :: forall b. Schedule -> (Ptr CSchedule -> IO b) -> IO b
withSchedule = Standalone CSchedule -> (Ptr CSchedule -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CSchedule -> (Ptr CSchedule -> IO b) -> IO b)
-> (Schedule -> Standalone CSchedule)
-> Schedule
-> (Ptr CSchedule -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Schedule -> Standalone CSchedule
getCSchedule
foreign import ccall safe "ql.h qlScheduleDates" qlScheduleDates :: Ptr CSchedule -> Ptr CUInt -> Ptr (Ptr CInt) -> IO ()
showSchedule :: Schedule -> String
showSchedule :: Schedule -> String
showSchedule Schedule
x = IO String -> String
forall a. IO a -> a
unsafePerformIO (IO String -> String) -> IO String -> String
forall a b. (a -> b) -> a -> b
$ Schedule -> (Ptr CSchedule -> IO String) -> IO String
forall b. Schedule -> (Ptr CSchedule -> IO b) -> IO b
withSchedule Schedule
x ((Ptr CSchedule -> IO String) -> IO String)
-> (Ptr CSchedule -> IO String) -> IO String
forall a b. (a -> b) -> a -> b
$ \Ptr CSchedule
p ->
  [Day] -> String
forall a. Show a => a -> String
show ([Day] -> String) -> IO [Day] -> IO String
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ((Ptr CUInt, Ptr (Ptr CInt)) -> IO [Day]) -> IO [Day]
forall a b. ((Ptr CUInt, Ptr (Ptr a)) -> IO b) -> IO b
preArray (\(Ptr CUInt
cp, Ptr (Ptr CInt)
ap) -> Ptr CSchedule -> Ptr CUInt -> Ptr (Ptr CInt) -> IO ()
qlScheduleDates Ptr CSchedule
p Ptr CUInt
cp Ptr (Ptr CInt)
ap IO () -> IO [Day] -> IO [Day]
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr CUInt -> Ptr (Ptr CInt) -> IO [Day]
peekDayArray Ptr CUInt
cp Ptr (Ptr CInt)
ap)
{-# NOINLINE showSchedule #-}

instance Show Schedule where
  show :: Schedule -> String
show = Schedule -> String
showSchedule
instance Eq Schedule where
  Schedule
x == :: Schedule -> Schedule -> Bool
== Schedule
y = Schedule -> String
forall a. Show a => a -> String
show Schedule
x String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== Schedule -> String
forall a. Show a => a -> String
show Schedule
y

data CInterestRate
newtype InterestRate = InterestRate {InterestRate -> Standalone CInterestRate
getCInterestRate :: Standalone CInterestRate}
foreign import ccall unsafe "ql.h &qlFreeInterestRate" qlFreeInterestRate :: FinalizerPtr CInterestRate
instance Finalizable CInterestRate where finalize :: FinalizerPtr CInterestRate
finalize = FinalizerPtr CInterestRate
qlFreeInterestRate
peekInterestRate :: Ptr CInterestRate -> IO InterestRate
peekInterestRate :: Ptr CInterestRate -> IO InterestRate
peekInterestRate = Standalone CInterestRate -> InterestRate
InterestRate (Standalone CInterestRate -> InterestRate)
-> (Ptr CInterestRate -> IO (Standalone CInterestRate))
-> Ptr CInterestRate
-> IO InterestRate
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CInterestRate -> IO (Standalone CInterestRate)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withInterestRate :: InterestRate -> (Ptr CInterestRate -> IO b) -> IO b
withInterestRate :: forall b. InterestRate -> (Ptr CInterestRate -> IO b) -> IO b
withInterestRate = Standalone CInterestRate -> (Ptr CInterestRate -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CInterestRate -> (Ptr CInterestRate -> IO b) -> IO b)
-> (InterestRate -> Standalone CInterestRate)
-> InterestRate
-> (Ptr CInterestRate -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. InterestRate -> Standalone CInterestRate
getCInterestRate
withInterestRateArray :: [InterestRate] -> ((CUInt, Ptr (Ptr CInterestRate)) -> IO b) -> IO b
withInterestRateArray :: forall b.
[InterestRate]
-> ((CUInt, Ptr (Ptr CInterestRate)) -> IO b) -> IO b
withInterestRateArray = (InterestRate -> Standalone CInterestRate)
-> [InterestRate]
-> ((CUInt, Ptr (Ptr CInterestRate)) -> IO b)
-> IO b
forall t a b.
(t -> Standalone a)
-> [t] -> ((CUInt, Ptr (Ptr a)) -> IO b) -> IO b
withStandaloneArray InterestRate -> Standalone CInterestRate
getCInterestRate

-- |a GARCH(1,1) volatility model -- see 'QuantLib.Model.garch11'\/'garch11Calibrated'.
data CGarch11
newtype Garch11 = Garch11 {Garch11 -> Standalone CGarch11
getCGarch11 :: Standalone CGarch11}
foreign import ccall unsafe "ql.h &qlFreeGarch11" qlFreeGarch11 :: FinalizerPtr CGarch11
instance Finalizable CGarch11 where finalize :: FinalizerPtr CGarch11
finalize = FinalizerPtr CGarch11
qlFreeGarch11
peekGarch11 :: Ptr CGarch11 -> IO Garch11
peekGarch11 :: Ptr CGarch11 -> IO Garch11
peekGarch11 = Standalone CGarch11 -> Garch11
Garch11 (Standalone CGarch11 -> Garch11)
-> (Ptr CGarch11 -> IO (Standalone CGarch11))
-> Ptr CGarch11
-> IO Garch11
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CGarch11 -> IO (Standalone CGarch11)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withGarch11 :: Garch11 -> (Ptr CGarch11 -> IO b) -> IO b
withGarch11 :: forall b. Garch11 -> (Ptr CGarch11 -> IO b) -> IO b
withGarch11 = Standalone CGarch11 -> (Ptr CGarch11 -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CGarch11 -> (Ptr CGarch11 -> IO b) -> IO b)
-> (Garch11 -> Standalone CGarch11)
-> Garch11
-> (Ptr CGarch11 -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Garch11 -> Standalone CGarch11
getCGarch11

data CTimeGrid
newtype TimeGrid = TimeGrid {TimeGrid -> Standalone CTimeGrid
getCTimeGrid :: Standalone CTimeGrid}
foreign import ccall unsafe "ql.h &qlFreeTimeGrid" qlFreeTimeGrid :: FinalizerPtr CTimeGrid
instance Finalizable CTimeGrid where finalize :: FinalizerPtr CTimeGrid
finalize = FinalizerPtr CTimeGrid
qlFreeTimeGrid
peekTimeGrid :: Ptr CTimeGrid -> IO TimeGrid
peekTimeGrid :: Ptr CTimeGrid -> IO TimeGrid
peekTimeGrid = Standalone CTimeGrid -> TimeGrid
TimeGrid (Standalone CTimeGrid -> TimeGrid)
-> (Ptr CTimeGrid -> IO (Standalone CTimeGrid))
-> Ptr CTimeGrid
-> IO TimeGrid
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CTimeGrid -> IO (Standalone CTimeGrid)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withTimeGrid :: TimeGrid -> (Ptr CTimeGrid -> IO b) -> IO b
withTimeGrid :: forall b. TimeGrid -> (Ptr CTimeGrid -> IO b) -> IO b
withTimeGrid = Standalone CTimeGrid -> (Ptr CTimeGrid -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CTimeGrid -> (Ptr CTimeGrid -> IO b) -> IO b)
-> (TimeGrid -> Standalone CTimeGrid)
-> TimeGrid
-> (Ptr CTimeGrid -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TimeGrid -> Standalone CTimeGrid
getCTimeGrid

-- |Never subclassed and never passed polymorphically elsewhere, so it gets the plain
-- 'Standalone' shape (like 'TimeGrid') rather than a @GenX@/'AnyOf' hierarchy root.
data CHistoricalIndexAnalysis
newtype HistoricalIndexAnalysis = HistoricalIndexAnalysis {HistoricalIndexAnalysis -> Standalone CHistoricalIndexAnalysis
getCHistoricalIndexAnalysis :: Standalone CHistoricalIndexAnalysis}
foreign import ccall unsafe "ql.h &qlFreeHistoricalIndexAnalysis" qlFreeHistoricalIndexAnalysis :: FinalizerPtr CHistoricalIndexAnalysis
instance Finalizable CHistoricalIndexAnalysis where finalize :: FinalizerPtr CHistoricalIndexAnalysis
finalize = FinalizerPtr CHistoricalIndexAnalysis
qlFreeHistoricalIndexAnalysis
peekHistoricalIndexAnalysis :: Ptr CHistoricalIndexAnalysis -> IO HistoricalIndexAnalysis
peekHistoricalIndexAnalysis :: Ptr CHistoricalIndexAnalysis -> IO HistoricalIndexAnalysis
peekHistoricalIndexAnalysis = Standalone CHistoricalIndexAnalysis -> HistoricalIndexAnalysis
HistoricalIndexAnalysis (Standalone CHistoricalIndexAnalysis -> HistoricalIndexAnalysis)
-> (Ptr CHistoricalIndexAnalysis
    -> IO (Standalone CHistoricalIndexAnalysis))
-> Ptr CHistoricalIndexAnalysis
-> IO HistoricalIndexAnalysis
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CHistoricalIndexAnalysis
-> IO (Standalone CHistoricalIndexAnalysis)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withHistoricalIndexAnalysis :: HistoricalIndexAnalysis -> (Ptr CHistoricalIndexAnalysis -> IO b) -> IO b
withHistoricalIndexAnalysis :: forall b.
HistoricalIndexAnalysis
-> (Ptr CHistoricalIndexAnalysis -> IO b) -> IO b
withHistoricalIndexAnalysis = Standalone CHistoricalIndexAnalysis
-> (Ptr CHistoricalIndexAnalysis -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CHistoricalIndexAnalysis
 -> (Ptr CHistoricalIndexAnalysis -> IO b) -> IO b)
-> (HistoricalIndexAnalysis -> Standalone CHistoricalIndexAnalysis)
-> HistoricalIndexAnalysis
-> (Ptr CHistoricalIndexAnalysis -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HistoricalIndexAnalysis -> Standalone CHistoricalIndexAnalysis
getCHistoricalIndexAnalysis

data CDividend
newtype Dividend = Dividend {Dividend -> Standalone CDividend
getCDividend :: Standalone CDividend}
foreign import ccall unsafe "ql.h &qlFreeDividend" qlFreeDividend :: FinalizerPtr CDividend
instance Finalizable CDividend where finalize :: FinalizerPtr CDividend
finalize = FinalizerPtr CDividend
qlFreeDividend
peekDividend :: Ptr CDividend -> IO Dividend
peekDividend :: Ptr CDividend -> IO Dividend
peekDividend = Standalone CDividend -> Dividend
Dividend (Standalone CDividend -> Dividend)
-> (Ptr CDividend -> IO (Standalone CDividend))
-> Ptr CDividend
-> IO Dividend
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CDividend -> IO (Standalone CDividend)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withDividend :: Dividend -> (Ptr CDividend -> IO b) -> IO b
withDividend :: forall b. Dividend -> (Ptr CDividend -> IO b) -> IO b
withDividend = Standalone CDividend -> (Ptr CDividend -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CDividend -> (Ptr CDividend -> IO b) -> IO b)
-> (Dividend -> Standalone CDividend)
-> Dividend
-> (Ptr CDividend -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Dividend -> Standalone CDividend
getCDividend
withDividendArray :: [Dividend] -> ((CUInt, Ptr (Ptr CDividend)) -> IO b) -> IO b
withDividendArray :: forall b.
[Dividend] -> ((CUInt, Ptr (Ptr CDividend)) -> IO b) -> IO b
withDividendArray = (Dividend -> Standalone CDividend)
-> [Dividend] -> ((CUInt, Ptr (Ptr CDividend)) -> IO b) -> IO b
forall t a b.
(t -> Standalone a)
-> [t] -> ((CUInt, Ptr (Ptr a)) -> IO b) -> IO b
withStandaloneArray Dividend -> Standalone CDividend
getCDividend

data CFdmQuantoHelper
newtype FdmQuantoHelper = FdmQuantoHelper {FdmQuantoHelper -> Standalone CFdmQuantoHelper
getCFdmQuantoHelper :: Standalone CFdmQuantoHelper}
foreign import ccall unsafe "ql.h &qlFreeFdmQuantoHelper" qlFreeFdmQuantoHelper :: FinalizerPtr CFdmQuantoHelper
instance Finalizable CFdmQuantoHelper where finalize :: FinalizerPtr CFdmQuantoHelper
finalize = FinalizerPtr CFdmQuantoHelper
qlFreeFdmQuantoHelper
peekFdmQuantoHelper :: Ptr CFdmQuantoHelper -> IO FdmQuantoHelper
peekFdmQuantoHelper :: Ptr CFdmQuantoHelper -> IO FdmQuantoHelper
peekFdmQuantoHelper = Standalone CFdmQuantoHelper -> FdmQuantoHelper
FdmQuantoHelper (Standalone CFdmQuantoHelper -> FdmQuantoHelper)
-> (Ptr CFdmQuantoHelper -> IO (Standalone CFdmQuantoHelper))
-> Ptr CFdmQuantoHelper
-> IO FdmQuantoHelper
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CFdmQuantoHelper -> IO (Standalone CFdmQuantoHelper)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withFdmQuantoHelper :: FdmQuantoHelper -> (Ptr CFdmQuantoHelper -> IO b) -> IO b
withFdmQuantoHelper :: forall b. FdmQuantoHelper -> (Ptr CFdmQuantoHelper -> IO b) -> IO b
withFdmQuantoHelper = Standalone CFdmQuantoHelper
-> (Ptr CFdmQuantoHelper -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CFdmQuantoHelper
 -> (Ptr CFdmQuantoHelper -> IO b) -> IO b)
-> (FdmQuantoHelper -> Standalone CFdmQuantoHelper)
-> FdmQuantoHelper
-> (Ptr CFdmQuantoHelper -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FdmQuantoHelper -> Standalone CFdmQuantoHelper
getCFdmQuantoHelper
withMaybeFdmQuantoHelper :: Maybe FdmQuantoHelper -> (Ptr CFdmQuantoHelper -> IO b) -> IO b
withMaybeFdmQuantoHelper :: forall b.
Maybe FdmQuantoHelper -> (Ptr CFdmQuantoHelper -> IO b) -> IO b
withMaybeFdmQuantoHelper = Maybe (Standalone CFdmQuantoHelper)
-> (Ptr CFdmQuantoHelper -> IO b) -> IO b
forall a b. Maybe (Standalone a) -> (Ptr a -> IO b) -> IO b
withMaybeStandalone (Maybe (Standalone CFdmQuantoHelper)
 -> (Ptr CFdmQuantoHelper -> IO b) -> IO b)
-> (Maybe FdmQuantoHelper -> Maybe (Standalone CFdmQuantoHelper))
-> Maybe FdmQuantoHelper
-> (Ptr CFdmQuantoHelper -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (FdmQuantoHelper -> Standalone CFdmQuantoHelper
getCFdmQuantoHelper (FdmQuantoHelper -> Standalone CFdmQuantoHelper)
-> Maybe FdmQuantoHelper -> Maybe (Standalone CFdmQuantoHelper)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>)

data CFdm1dMesher
newtype Fdm1dMesher = Fdm1dMesher {Fdm1dMesher -> Standalone CFdm1dMesher
getCFdm1dMesher :: Standalone CFdm1dMesher}
foreign import ccall unsafe "ql.h &qlFreeFdm1dMesher" qlFreeFdm1dMesher :: FinalizerPtr CFdm1dMesher
instance Finalizable CFdm1dMesher where finalize :: FinalizerPtr CFdm1dMesher
finalize = FinalizerPtr CFdm1dMesher
qlFreeFdm1dMesher
peekFdm1dMesher :: Ptr CFdm1dMesher -> IO Fdm1dMesher
peekFdm1dMesher :: Ptr CFdm1dMesher -> IO Fdm1dMesher
peekFdm1dMesher = Standalone CFdm1dMesher -> Fdm1dMesher
Fdm1dMesher (Standalone CFdm1dMesher -> Fdm1dMesher)
-> (Ptr CFdm1dMesher -> IO (Standalone CFdm1dMesher))
-> Ptr CFdm1dMesher
-> IO Fdm1dMesher
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CFdm1dMesher -> IO (Standalone CFdm1dMesher)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withFdm1dMesher :: Fdm1dMesher -> (Ptr CFdm1dMesher -> IO b) -> IO b
withFdm1dMesher :: forall b. Fdm1dMesher -> (Ptr CFdm1dMesher -> IO b) -> IO b
withFdm1dMesher = Standalone CFdm1dMesher -> (Ptr CFdm1dMesher -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CFdm1dMesher -> (Ptr CFdm1dMesher -> IO b) -> IO b)
-> (Fdm1dMesher -> Standalone CFdm1dMesher)
-> Fdm1dMesher
-> (Ptr CFdm1dMesher -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Fdm1dMesher -> Standalone CFdm1dMesher
getCFdm1dMesher
withFdm1dMesherArray :: [Fdm1dMesher] -> ((CUInt, Ptr (Ptr CFdm1dMesher)) -> IO b) -> IO b
withFdm1dMesherArray :: forall b.
[Fdm1dMesher] -> ((CUInt, Ptr (Ptr CFdm1dMesher)) -> IO b) -> IO b
withFdm1dMesherArray = (Fdm1dMesher -> Standalone CFdm1dMesher)
-> [Fdm1dMesher]
-> ((CUInt, Ptr (Ptr CFdm1dMesher)) -> IO b)
-> IO b
forall t a b.
(t -> Standalone a)
-> [t] -> ((CUInt, Ptr (Ptr a)) -> IO b) -> IO b
withStandaloneArray Fdm1dMesher -> Standalone CFdm1dMesher
getCFdm1dMesher

data CFdmMesher
newtype FdmMesher = FdmMesher {FdmMesher -> Standalone CFdmMesher
getCFdmMesher :: Standalone CFdmMesher}
foreign import ccall unsafe "ql.h &qlFreeFdmMesher" qlFreeFdmMesher :: FinalizerPtr CFdmMesher
instance Finalizable CFdmMesher where finalize :: FinalizerPtr CFdmMesher
finalize = FinalizerPtr CFdmMesher
qlFreeFdmMesher
peekFdmMesher :: Ptr CFdmMesher -> IO FdmMesher
peekFdmMesher :: Ptr CFdmMesher -> IO FdmMesher
peekFdmMesher = Standalone CFdmMesher -> FdmMesher
FdmMesher (Standalone CFdmMesher -> FdmMesher)
-> (Ptr CFdmMesher -> IO (Standalone CFdmMesher))
-> Ptr CFdmMesher
-> IO FdmMesher
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CFdmMesher -> IO (Standalone CFdmMesher)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withFdmMesher :: FdmMesher -> (Ptr CFdmMesher -> IO b) -> IO b
withFdmMesher :: forall b. FdmMesher -> (Ptr CFdmMesher -> IO b) -> IO b
withFdmMesher = Standalone CFdmMesher -> (Ptr CFdmMesher -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CFdmMesher -> (Ptr CFdmMesher -> IO b) -> IO b)
-> (FdmMesher -> Standalone CFdmMesher)
-> FdmMesher
-> (Ptr CFdmMesher -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FdmMesher -> Standalone CFdmMesher
getCFdmMesher

data CFdmInnerValueCalculator
newtype FdmInnerValueCalculator = FdmInnerValueCalculator {FdmInnerValueCalculator -> Standalone CFdmInnerValueCalculator
getCFdmInnerValueCalculator :: Standalone CFdmInnerValueCalculator}
foreign import ccall unsafe "ql.h &qlFreeFdmInnerValueCalculator" qlFreeFdmInnerValueCalculator :: FinalizerPtr CFdmInnerValueCalculator
instance Finalizable CFdmInnerValueCalculator where finalize :: FinalizerPtr CFdmInnerValueCalculator
finalize = FinalizerPtr CFdmInnerValueCalculator
qlFreeFdmInnerValueCalculator
peekFdmInnerValueCalculator :: Ptr CFdmInnerValueCalculator -> IO FdmInnerValueCalculator
peekFdmInnerValueCalculator :: Ptr CFdmInnerValueCalculator -> IO FdmInnerValueCalculator
peekFdmInnerValueCalculator = Standalone CFdmInnerValueCalculator -> FdmInnerValueCalculator
FdmInnerValueCalculator (Standalone CFdmInnerValueCalculator -> FdmInnerValueCalculator)
-> (Ptr CFdmInnerValueCalculator
    -> IO (Standalone CFdmInnerValueCalculator))
-> Ptr CFdmInnerValueCalculator
-> IO FdmInnerValueCalculator
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CFdmInnerValueCalculator
-> IO (Standalone CFdmInnerValueCalculator)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withFdmInnerValueCalculator :: FdmInnerValueCalculator -> (Ptr CFdmInnerValueCalculator -> IO b) -> IO b
withFdmInnerValueCalculator :: forall b.
FdmInnerValueCalculator
-> (Ptr CFdmInnerValueCalculator -> IO b) -> IO b
withFdmInnerValueCalculator = Standalone CFdmInnerValueCalculator
-> (Ptr CFdmInnerValueCalculator -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CFdmInnerValueCalculator
 -> (Ptr CFdmInnerValueCalculator -> IO b) -> IO b)
-> (FdmInnerValueCalculator -> Standalone CFdmInnerValueCalculator)
-> FdmInnerValueCalculator
-> (Ptr CFdmInnerValueCalculator -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FdmInnerValueCalculator -> Standalone CFdmInnerValueCalculator
getCFdmInnerValueCalculator


data CSmileSection
newtype SmileSection = SmileSection {SmileSection -> Standalone CSmileSection
getCSmileSection :: Standalone CSmileSection}
foreign import ccall unsafe "ql.h &qlFreeSmileSection" qlFreeSmileSection :: FinalizerPtr CSmileSection
instance Finalizable CSmileSection where finalize :: FinalizerPtr CSmileSection
finalize = FinalizerPtr CSmileSection
qlFreeSmileSection
peekSmileSection :: Ptr CSmileSection -> IO SmileSection
peekSmileSection :: Ptr CSmileSection -> IO SmileSection
peekSmileSection = Standalone CSmileSection -> SmileSection
SmileSection (Standalone CSmileSection -> SmileSection)
-> (Ptr CSmileSection -> IO (Standalone CSmileSection))
-> Ptr CSmileSection
-> IO SmileSection
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CSmileSection -> IO (Standalone CSmileSection)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withSmileSection :: SmileSection -> (Ptr CSmileSection -> IO b) -> IO b
withSmileSection :: forall b. SmileSection -> (Ptr CSmileSection -> IO b) -> IO b
withSmileSection = Standalone CSmileSection -> (Ptr CSmileSection -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CSmileSection -> (Ptr CSmileSection -> IO b) -> IO b)
-> (SmileSection -> Standalone CSmileSection)
-> SmileSection
-> (Ptr CSmileSection -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SmileSection -> Standalone CSmileSection
getCSmileSection

-- |a dedicated leaf, not a downcast target: 'QuantLib.TermStructure.Volatility.sabrInterpolatedSmileSection'
-- returns this concrete type directly so its alpha\/beta\/nu\/rho\/etc getters need no
-- runtime cast to reach them (see CLAUDE.md's "avoid dynamic_cast unless upstream forces it"
-- rule). Use 'QuantLib.TermStructure.Volatility.sabrAsSmileSection' to
-- pass one into anything that wants the generic 'SmileSection' interface.
data CSabrInterpolatedSmileSection
newtype SabrInterpolatedSmileSection = SabrInterpolatedSmileSection {SabrInterpolatedSmileSection
-> Standalone CSabrInterpolatedSmileSection
getCSabrInterpolatedSmileSection :: Standalone CSabrInterpolatedSmileSection}
foreign import ccall unsafe "ql.h &qlFreeSabrInterpolatedSmileSection" qlFreeSabrInterpolatedSmileSection :: FinalizerPtr CSabrInterpolatedSmileSection
instance Finalizable CSabrInterpolatedSmileSection where finalize :: FinalizerPtr CSabrInterpolatedSmileSection
finalize = FinalizerPtr CSabrInterpolatedSmileSection
qlFreeSabrInterpolatedSmileSection
peekSabrInterpolatedSmileSection :: Ptr CSabrInterpolatedSmileSection -> IO SabrInterpolatedSmileSection
peekSabrInterpolatedSmileSection :: Ptr CSabrInterpolatedSmileSection
-> IO SabrInterpolatedSmileSection
peekSabrInterpolatedSmileSection = Standalone CSabrInterpolatedSmileSection
-> SabrInterpolatedSmileSection
SabrInterpolatedSmileSection (Standalone CSabrInterpolatedSmileSection
 -> SabrInterpolatedSmileSection)
-> (Ptr CSabrInterpolatedSmileSection
    -> IO (Standalone CSabrInterpolatedSmileSection))
-> Ptr CSabrInterpolatedSmileSection
-> IO SabrInterpolatedSmileSection
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CSabrInterpolatedSmileSection
-> IO (Standalone CSabrInterpolatedSmileSection)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withSabrInterpolatedSmileSection :: SabrInterpolatedSmileSection -> (Ptr CSabrInterpolatedSmileSection -> IO b) -> IO b
withSabrInterpolatedSmileSection :: forall b.
SabrInterpolatedSmileSection
-> (Ptr CSabrInterpolatedSmileSection -> IO b) -> IO b
withSabrInterpolatedSmileSection = Standalone CSabrInterpolatedSmileSection
-> (Ptr CSabrInterpolatedSmileSection -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CSabrInterpolatedSmileSection
 -> (Ptr CSabrInterpolatedSmileSection -> IO b) -> IO b)
-> (SabrInterpolatedSmileSection
    -> Standalone CSabrInterpolatedSmileSection)
-> SabrInterpolatedSmileSection
-> (Ptr CSabrInterpolatedSmileSection -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SabrInterpolatedSmileSection
-> Standalone CSabrInterpolatedSmileSection
getCSabrInterpolatedSmileSection

-- |a dedicated leaf, same reasoning and 'SmileSection' escape hatch as 'CSabrInterpolatedSmileSection'
-- above -- see 'QuantLib.TermStructure.Volatility.sviInterpolatedSmileSection'\/
-- 'QuantLib.TermStructure.Volatility.sviAsSmileSection'.
data CSviInterpolatedSmileSection
newtype SviInterpolatedSmileSection = SviInterpolatedSmileSection {SviInterpolatedSmileSection
-> Standalone CSviInterpolatedSmileSection
getCSviInterpolatedSmileSection :: Standalone CSviInterpolatedSmileSection}
foreign import ccall unsafe "ql.h &qlFreeSviInterpolatedSmileSection" qlFreeSviInterpolatedSmileSection :: FinalizerPtr CSviInterpolatedSmileSection
instance Finalizable CSviInterpolatedSmileSection where finalize :: FinalizerPtr CSviInterpolatedSmileSection
finalize = FinalizerPtr CSviInterpolatedSmileSection
qlFreeSviInterpolatedSmileSection
peekSviInterpolatedSmileSection :: Ptr CSviInterpolatedSmileSection -> IO SviInterpolatedSmileSection
peekSviInterpolatedSmileSection :: Ptr CSviInterpolatedSmileSection -> IO SviInterpolatedSmileSection
peekSviInterpolatedSmileSection = Standalone CSviInterpolatedSmileSection
-> SviInterpolatedSmileSection
SviInterpolatedSmileSection (Standalone CSviInterpolatedSmileSection
 -> SviInterpolatedSmileSection)
-> (Ptr CSviInterpolatedSmileSection
    -> IO (Standalone CSviInterpolatedSmileSection))
-> Ptr CSviInterpolatedSmileSection
-> IO SviInterpolatedSmileSection
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CSviInterpolatedSmileSection
-> IO (Standalone CSviInterpolatedSmileSection)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withSviInterpolatedSmileSection :: SviInterpolatedSmileSection -> (Ptr CSviInterpolatedSmileSection -> IO b) -> IO b
withSviInterpolatedSmileSection :: forall b.
SviInterpolatedSmileSection
-> (Ptr CSviInterpolatedSmileSection -> IO b) -> IO b
withSviInterpolatedSmileSection = Standalone CSviInterpolatedSmileSection
-> (Ptr CSviInterpolatedSmileSection -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CSviInterpolatedSmileSection
 -> (Ptr CSviInterpolatedSmileSection -> IO b) -> IO b)
-> (SviInterpolatedSmileSection
    -> Standalone CSviInterpolatedSmileSection)
-> SviInterpolatedSmileSection
-> (Ptr CSviInterpolatedSmileSection -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SviInterpolatedSmileSection
-> Standalone CSviInterpolatedSmileSection
getCSviInterpolatedSmileSection

-- |a dedicated leaf, same reasoning and 'SmileSection' escape hatch as 'CSabrInterpolatedSmileSection'
-- above -- see 'QuantLib.TermStructure.Volatility.noArbSabrInterpolatedSmileSection'\/
-- 'QuantLib.TermStructure.Volatility.noArbSabrAsSmileSection'.
data CNoArbSabrInterpolatedSmileSection
newtype NoArbSabrInterpolatedSmileSection = NoArbSabrInterpolatedSmileSection {NoArbSabrInterpolatedSmileSection
-> Standalone CNoArbSabrInterpolatedSmileSection
getCNoArbSabrInterpolatedSmileSection :: Standalone CNoArbSabrInterpolatedSmileSection}
foreign import ccall unsafe "ql.h &qlFreeNoArbSabrInterpolatedSmileSection" qlFreeNoArbSabrInterpolatedSmileSection :: FinalizerPtr CNoArbSabrInterpolatedSmileSection
instance Finalizable CNoArbSabrInterpolatedSmileSection where finalize :: FinalizerPtr CNoArbSabrInterpolatedSmileSection
finalize = FinalizerPtr CNoArbSabrInterpolatedSmileSection
qlFreeNoArbSabrInterpolatedSmileSection
peekNoArbSabrInterpolatedSmileSection :: Ptr CNoArbSabrInterpolatedSmileSection -> IO NoArbSabrInterpolatedSmileSection
peekNoArbSabrInterpolatedSmileSection :: Ptr CNoArbSabrInterpolatedSmileSection
-> IO NoArbSabrInterpolatedSmileSection
peekNoArbSabrInterpolatedSmileSection = Standalone CNoArbSabrInterpolatedSmileSection
-> NoArbSabrInterpolatedSmileSection
NoArbSabrInterpolatedSmileSection (Standalone CNoArbSabrInterpolatedSmileSection
 -> NoArbSabrInterpolatedSmileSection)
-> (Ptr CNoArbSabrInterpolatedSmileSection
    -> IO (Standalone CNoArbSabrInterpolatedSmileSection))
-> Ptr CNoArbSabrInterpolatedSmileSection
-> IO NoArbSabrInterpolatedSmileSection
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CNoArbSabrInterpolatedSmileSection
-> IO (Standalone CNoArbSabrInterpolatedSmileSection)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withNoArbSabrInterpolatedSmileSection :: NoArbSabrInterpolatedSmileSection -> (Ptr CNoArbSabrInterpolatedSmileSection -> IO b) -> IO b
withNoArbSabrInterpolatedSmileSection :: forall b.
NoArbSabrInterpolatedSmileSection
-> (Ptr CNoArbSabrInterpolatedSmileSection -> IO b) -> IO b
withNoArbSabrInterpolatedSmileSection = Standalone CNoArbSabrInterpolatedSmileSection
-> (Ptr CNoArbSabrInterpolatedSmileSection -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CNoArbSabrInterpolatedSmileSection
 -> (Ptr CNoArbSabrInterpolatedSmileSection -> IO b) -> IO b)
-> (NoArbSabrInterpolatedSmileSection
    -> Standalone CNoArbSabrInterpolatedSmileSection)
-> NoArbSabrInterpolatedSmileSection
-> (Ptr CNoArbSabrInterpolatedSmileSection -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NoArbSabrInterpolatedSmileSection
-> Standalone CNoArbSabrInterpolatedSmileSection
getCNoArbSabrInterpolatedSmileSection

-- |a dedicated leaf, same reasoning and 'SmileSection' escape hatch as 'CSabrInterpolatedSmileSection'
-- above -- see 'QuantLib.TermStructure.Volatility.zabrInterpolatedSmileSection'\/
-- 'QuantLib.TermStructure.Volatility.zabrInterpolatedAsSmileSection'. Wraps a
-- @ZabrInterpolatedSmileSectionHandle@ on the C++ side, not the templated
-- @ZabrInterpolatedSmileSection\<Evaluation\>@ itself directly -- see the handle's own comment
-- in @cbits\/qlTermStructureAux.h@ for why.
data CZabrInterpolatedSmileSection
newtype ZabrInterpolatedSmileSection = ZabrInterpolatedSmileSection {ZabrInterpolatedSmileSection
-> Standalone CZabrInterpolatedSmileSection
getCZabrInterpolatedSmileSection :: Standalone CZabrInterpolatedSmileSection}
foreign import ccall unsafe "ql.h &qlFreeZabrInterpolatedSmileSection" qlFreeZabrInterpolatedSmileSection :: FinalizerPtr CZabrInterpolatedSmileSection
instance Finalizable CZabrInterpolatedSmileSection where finalize :: FinalizerPtr CZabrInterpolatedSmileSection
finalize = FinalizerPtr CZabrInterpolatedSmileSection
qlFreeZabrInterpolatedSmileSection
peekZabrInterpolatedSmileSection :: Ptr CZabrInterpolatedSmileSection -> IO ZabrInterpolatedSmileSection
peekZabrInterpolatedSmileSection :: Ptr CZabrInterpolatedSmileSection
-> IO ZabrInterpolatedSmileSection
peekZabrInterpolatedSmileSection = Standalone CZabrInterpolatedSmileSection
-> ZabrInterpolatedSmileSection
ZabrInterpolatedSmileSection (Standalone CZabrInterpolatedSmileSection
 -> ZabrInterpolatedSmileSection)
-> (Ptr CZabrInterpolatedSmileSection
    -> IO (Standalone CZabrInterpolatedSmileSection))
-> Ptr CZabrInterpolatedSmileSection
-> IO ZabrInterpolatedSmileSection
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CZabrInterpolatedSmileSection
-> IO (Standalone CZabrInterpolatedSmileSection)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withZabrInterpolatedSmileSection :: ZabrInterpolatedSmileSection -> (Ptr CZabrInterpolatedSmileSection -> IO b) -> IO b
withZabrInterpolatedSmileSection :: forall b.
ZabrInterpolatedSmileSection
-> (Ptr CZabrInterpolatedSmileSection -> IO b) -> IO b
withZabrInterpolatedSmileSection = Standalone CZabrInterpolatedSmileSection
-> (Ptr CZabrInterpolatedSmileSection -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CZabrInterpolatedSmileSection
 -> (Ptr CZabrInterpolatedSmileSection -> IO b) -> IO b)
-> (ZabrInterpolatedSmileSection
    -> Standalone CZabrInterpolatedSmileSection)
-> ZabrInterpolatedSmileSection
-> (Ptr CZabrInterpolatedSmileSection -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ZabrInterpolatedSmileSection
-> Standalone CZabrInterpolatedSmileSection
getCZabrInterpolatedSmileSection

-- |a dedicated leaf, not a downcast target: 'QuantLib.TermStructure.Volatility.optionletStripperWithAtm'
-- fuses construction of an 'OptionletStripper1' underneath (never exposed to Haskell, mirroring
-- 'QuantLib.TermStructure.Volatility.optionletStripper') and stores the resulting
-- @OptionletStripper2@ itself, so its own diagnostic getters (atmCapFloorStrikes\/atmCapFloorPrices\/
-- spreadsVol) need no runtime cast. Use
-- 'QuantLib.TermStructure.Volatility.asOptionletVolatilityStructure' to pass one
-- into anything that wants the generic 'OptionletVolatilityStructure' interface.
data COptionletStripper2
newtype OptionletStripper2 = OptionletStripper2 {OptionletStripper2 -> Standalone COptionletStripper2
getCOptionletStripper2 :: Standalone COptionletStripper2}
foreign import ccall unsafe "ql.h &qlFreeOptionletStripper2" qlFreeOptionletStripper2 :: FinalizerPtr COptionletStripper2
instance Finalizable COptionletStripper2 where finalize :: FinalizerPtr COptionletStripper2
finalize = FinalizerPtr COptionletStripper2
qlFreeOptionletStripper2
peekOptionletStripper2 :: Ptr COptionletStripper2 -> IO OptionletStripper2
peekOptionletStripper2 :: Ptr COptionletStripper2 -> IO OptionletStripper2
peekOptionletStripper2 = Standalone COptionletStripper2 -> OptionletStripper2
OptionletStripper2 (Standalone COptionletStripper2 -> OptionletStripper2)
-> (Ptr COptionletStripper2 -> IO (Standalone COptionletStripper2))
-> Ptr COptionletStripper2
-> IO OptionletStripper2
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr COptionletStripper2 -> IO (Standalone COptionletStripper2)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withOptionletStripper2 :: OptionletStripper2 -> (Ptr COptionletStripper2 -> IO b) -> IO b
withOptionletStripper2 :: forall b.
OptionletStripper2 -> (Ptr COptionletStripper2 -> IO b) -> IO b
withOptionletStripper2 = Standalone COptionletStripper2
-> (Ptr COptionletStripper2 -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone COptionletStripper2
 -> (Ptr COptionletStripper2 -> IO b) -> IO b)
-> (OptionletStripper2 -> Standalone COptionletStripper2)
-> OptionletStripper2
-> (Ptr COptionletStripper2 -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OptionletStripper2 -> Standalone COptionletStripper2
getCOptionletStripper2

data CPricingEngine
newtype PricingEngine = PricingEngine {PricingEngine -> Standalone CPricingEngine
getCPricingEngine :: Standalone CPricingEngine}
foreign import ccall unsafe "ql.h &qlFreePricingEngine" qlFreePricingEngine :: FinalizerPtr CPricingEngine
instance Finalizable CPricingEngine where finalize :: FinalizerPtr CPricingEngine
finalize = FinalizerPtr CPricingEngine
qlFreePricingEngine
peekPricingEngine :: Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine :: Ptr CPricingEngine -> IO PricingEngine
peekPricingEngine = Standalone CPricingEngine -> PricingEngine
PricingEngine (Standalone CPricingEngine -> PricingEngine)
-> (Ptr CPricingEngine -> IO (Standalone CPricingEngine))
-> Ptr CPricingEngine
-> IO PricingEngine
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CPricingEngine -> IO (Standalone CPricingEngine)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withPricingEngine :: PricingEngine -> (Ptr CPricingEngine -> IO b) -> IO b
withPricingEngine :: forall b. PricingEngine -> (Ptr CPricingEngine -> IO b) -> IO b
withPricingEngine = Standalone CPricingEngine -> (Ptr CPricingEngine -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CPricingEngine -> (Ptr CPricingEngine -> IO b) -> IO b)
-> (PricingEngine -> Standalone CPricingEngine)
-> PricingEngine
-> (Ptr CPricingEngine -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PricingEngine -> Standalone CPricingEngine
getCPricingEngine

data CBlackDeltaCalculator
newtype BlackDeltaCalculator = BlackDeltaCalculator {BlackDeltaCalculator -> Standalone CBlackDeltaCalculator
getCBlackDeltaCalculator :: Standalone CBlackDeltaCalculator}
foreign import ccall unsafe "ql.h &qlFreeBlackDeltaCalculator" qlFreeBlackDeltaCalculator :: FinalizerPtr CBlackDeltaCalculator
instance Finalizable CBlackDeltaCalculator where finalize :: FinalizerPtr CBlackDeltaCalculator
finalize = FinalizerPtr CBlackDeltaCalculator
qlFreeBlackDeltaCalculator
peekBlackDeltaCalculator :: Ptr CBlackDeltaCalculator -> IO BlackDeltaCalculator
peekBlackDeltaCalculator :: Ptr CBlackDeltaCalculator -> IO BlackDeltaCalculator
peekBlackDeltaCalculator = Standalone CBlackDeltaCalculator -> BlackDeltaCalculator
BlackDeltaCalculator (Standalone CBlackDeltaCalculator -> BlackDeltaCalculator)
-> (Ptr CBlackDeltaCalculator
    -> IO (Standalone CBlackDeltaCalculator))
-> Ptr CBlackDeltaCalculator
-> IO BlackDeltaCalculator
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CBlackDeltaCalculator -> IO (Standalone CBlackDeltaCalculator)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withBlackDeltaCalculator :: BlackDeltaCalculator -> (Ptr CBlackDeltaCalculator -> IO b) -> IO b
withBlackDeltaCalculator :: forall b.
BlackDeltaCalculator -> (Ptr CBlackDeltaCalculator -> IO b) -> IO b
withBlackDeltaCalculator = Standalone CBlackDeltaCalculator
-> (Ptr CBlackDeltaCalculator -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CBlackDeltaCalculator
 -> (Ptr CBlackDeltaCalculator -> IO b) -> IO b)
-> (BlackDeltaCalculator -> Standalone CBlackDeltaCalculator)
-> BlackDeltaCalculator
-> (Ptr CBlackDeltaCalculator -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlackDeltaCalculator -> Standalone CBlackDeltaCalculator
getCBlackDeltaCalculator

-- Generic floating-rate coupon pricer; CMS pricers retain a concrete subtype.
data CFloatingRateCouponPricer'

-- | > FloatingRateCouponPricer
-- >   CmsCouponPricer
newtype GenFloatingRateCouponPricer frcp = GenFloatingRateCouponPricer {forall frcp.
GenFloatingRateCouponPricer frcp
-> GenForeignPtr frcp CFloatingRateCouponPricer'
getFloatingRateCouponPricer :: GenForeignPtr frcp CFloatingRateCouponPricer'}
type CFloatingRateCouponPricer = ForeignPtr CFloatingRateCouponPricer'
-- |The root of the hierarchy shown under t'GenFloatingRateCouponPricer'.
type FloatingRateCouponPricer = GenFloatingRateCouponPricer CFloatingRateCouponPricer
foreign import ccall unsafe "ql.h &qlFreeFloatingCouponPricer" qlFreeFloatingRateCouponPricer :: FinalizerPtr CFloatingRateCouponPricer'
instance Finalizable CFloatingRateCouponPricer' where finalize :: FinalizerPtr CFloatingRateCouponPricer'
finalize = FinalizerPtr CFloatingRateCouponPricer'
qlFreeFloatingRateCouponPricer
asFloatingRateCouponPricer :: GenFloatingRateCouponPricer frcp -> IO FloatingRateCouponPricer
asFloatingRateCouponPricer :: forall frcp.
GenFloatingRateCouponPricer frcp -> IO FloatingRateCouponPricer
asFloatingRateCouponPricer = (Ptr CFloatingRateCouponPricer' -> IO FloatingRateCouponPricer)
-> GenForeignPtr frcp CFloatingRateCouponPricer'
-> IO FloatingRateCouponPricer
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CFloatingRateCouponPricer' -> IO FloatingRateCouponPricer
peekFloatingRateCouponPricer (GenForeignPtr frcp CFloatingRateCouponPricer'
 -> IO FloatingRateCouponPricer)
-> (GenFloatingRateCouponPricer frcp
    -> GenForeignPtr frcp CFloatingRateCouponPricer')
-> GenFloatingRateCouponPricer frcp
-> IO FloatingRateCouponPricer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenFloatingRateCouponPricer frcp
-> GenForeignPtr frcp CFloatingRateCouponPricer'
forall frcp.
GenFloatingRateCouponPricer frcp
-> GenForeignPtr frcp CFloatingRateCouponPricer'
getFloatingRateCouponPricer
peekFloatingRateCouponPricer :: Ptr CFloatingRateCouponPricer' -> IO FloatingRateCouponPricer
peekFloatingRateCouponPricer :: Ptr CFloatingRateCouponPricer' -> IO FloatingRateCouponPricer
peekFloatingRateCouponPricer = GenForeignPtr CFloatingRateCouponPricer CFloatingRateCouponPricer'
-> FloatingRateCouponPricer
forall frcp.
GenForeignPtr frcp CFloatingRateCouponPricer'
-> GenFloatingRateCouponPricer frcp
GenFloatingRateCouponPricer (GenForeignPtr CFloatingRateCouponPricer CFloatingRateCouponPricer'
 -> FloatingRateCouponPricer)
-> (Ptr CFloatingRateCouponPricer'
    -> IO
         (GenForeignPtr
            CFloatingRateCouponPricer CFloatingRateCouponPricer'))
-> Ptr CFloatingRateCouponPricer'
-> IO FloatingRateCouponPricer
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CFloatingRateCouponPricer'
-> IO
     (GenForeignPtr
        CFloatingRateCouponPricer CFloatingRateCouponPricer')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr
withFloatingRateCouponPricer :: GenFloatingRateCouponPricer frcp -> (Ptr CFloatingRateCouponPricer' -> IO b) -> IO b
withFloatingRateCouponPricer :: forall frcp b.
GenFloatingRateCouponPricer frcp
-> (Ptr CFloatingRateCouponPricer' -> IO b) -> IO b
withFloatingRateCouponPricer = GenForeignPtr frcp CFloatingRateCouponPricer'
-> (Ptr CFloatingRateCouponPricer' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr frcp CFloatingRateCouponPricer'
 -> (Ptr CFloatingRateCouponPricer' -> IO b) -> IO b)
-> (GenFloatingRateCouponPricer frcp
    -> GenForeignPtr frcp CFloatingRateCouponPricer')
-> GenFloatingRateCouponPricer frcp
-> (Ptr CFloatingRateCouponPricer' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenFloatingRateCouponPricer frcp
-> GenForeignPtr frcp CFloatingRateCouponPricer'
forall frcp.
GenFloatingRateCouponPricer frcp
-> GenForeignPtr frcp CFloatingRateCouponPricer'
getFloatingRateCouponPricer
withFloatingRateCouponPricerArray :: [GenFloatingRateCouponPricer frcp] -> ((CUInt, Ptr (Ptr CFloatingRateCouponPricer')) -> IO b) -> IO b
withFloatingRateCouponPricerArray :: forall frcp b.
[GenFloatingRateCouponPricer frcp]
-> ((CUInt, Ptr (Ptr CFloatingRateCouponPricer')) -> IO b) -> IO b
withFloatingRateCouponPricerArray = (GenFloatingRateCouponPricer frcp
 -> (Ptr CFloatingRateCouponPricer' -> IO b) -> IO b)
-> [GenFloatingRateCouponPricer frcp]
-> ((CUInt, Ptr (Ptr CFloatingRateCouponPricer')) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray GenFloatingRateCouponPricer frcp
-> (Ptr CFloatingRateCouponPricer' -> IO b) -> IO b
forall frcp b.
GenFloatingRateCouponPricer frcp
-> (Ptr CFloatingRateCouponPricer' -> IO b) -> IO b
withFloatingRateCouponPricer
withMaybeFloatingRateCouponPricer :: Maybe FloatingRateCouponPricer -> (Ptr CFloatingRateCouponPricer' -> IO b) -> IO b
withMaybeFloatingRateCouponPricer :: forall b.
Maybe FloatingRateCouponPricer
-> (Ptr CFloatingRateCouponPricer' -> IO b) -> IO b
withMaybeFloatingRateCouponPricer = ((Ptr CFloatingRateCouponPricer' -> IO b) -> IO b)
-> (FloatingRateCouponPricer
    -> (Ptr CFloatingRateCouponPricer' -> IO b) -> IO b)
-> Maybe FloatingRateCouponPricer
-> (Ptr CFloatingRateCouponPricer' -> IO b)
-> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe ((Ptr CFloatingRateCouponPricer' -> IO b)
-> Ptr CFloatingRateCouponPricer' -> IO b
forall a b. (a -> b) -> a -> b
$ Ptr CFloatingRateCouponPricer'
forall a. Ptr a
nullPtr) FloatingRateCouponPricer
-> (Ptr CFloatingRateCouponPricer' -> IO b) -> IO b
forall frcp b.
GenFloatingRateCouponPricer frcp
-> (Ptr CFloatingRateCouponPricer' -> IO b) -> IO b
withFloatingRateCouponPricer

-- |CMS coupon-pricer subtype required by CMS consumers.
data CCmsCouponPricer'
type CCmsCouponPricer = ForeignPtr CCmsCouponPricer'
-- |A 'FloatingRateCouponPricer'; see the hierarchy under t'GenFloatingRateCouponPricer'.
type CmsCouponPricer = GenFloatingRateCouponPricer CCmsCouponPricer
foreign import ccall unsafe "ql.h &qlFreeCmsCouponPricer" qlFreeCmsCouponPricer :: FinalizerPtr CCmsCouponPricer'
instance Finalizable CCmsCouponPricer' where finalize :: FinalizerPtr CCmsCouponPricer'
finalize = FinalizerPtr CCmsCouponPricer'
qlFreeCmsCouponPricer
foreign import ccall "ql.h qlCmsCouponPricerAsFloatingRateCouponPricer" qlCmsCouponPricerAsFloatingRateCouponPricer :: Ptr CCmsCouponPricer' -> IO (Ptr CFloatingRateCouponPricer')
instance Upcastable CCmsCouponPricer' where {type Base CCmsCouponPricer' = CFloatingRateCouponPricer'; upcast :: Ptr CCmsCouponPricer' -> IO (Ptr (Base CCmsCouponPricer'))
upcast = Ptr CCmsCouponPricer' -> IO (Ptr (Base CCmsCouponPricer'))
Ptr CCmsCouponPricer' -> IO (Ptr CFloatingRateCouponPricer')
qlCmsCouponPricerAsFloatingRateCouponPricer}
peekCmsCouponPricer :: Ptr CCmsCouponPricer' -> IO CmsCouponPricer
peekCmsCouponPricer :: Ptr CCmsCouponPricer' -> IO CmsCouponPricer
peekCmsCouponPricer = GenForeignPtr CCmsCouponPricer CFloatingRateCouponPricer'
-> CmsCouponPricer
forall frcp.
GenForeignPtr frcp CFloatingRateCouponPricer'
-> GenFloatingRateCouponPricer frcp
GenFloatingRateCouponPricer (GenForeignPtr CCmsCouponPricer CFloatingRateCouponPricer'
 -> CmsCouponPricer)
-> (Ptr CCmsCouponPricer'
    -> IO (GenForeignPtr CCmsCouponPricer CFloatingRateCouponPricer'))
-> Ptr CCmsCouponPricer'
-> IO CmsCouponPricer
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCmsCouponPricer'
-> IO (GenForeignPtr CCmsCouponPricer (Base CCmsCouponPricer'))
Ptr CCmsCouponPricer'
-> IO (GenForeignPtr CCmsCouponPricer CFloatingRateCouponPricer')
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
withCmsCouponPricer :: CmsCouponPricer -> (Ptr CCmsCouponPricer' -> IO b) -> IO b
withCmsCouponPricer :: forall b.
CmsCouponPricer -> (Ptr CCmsCouponPricer' -> IO b) -> IO b
withCmsCouponPricer = CCmsCouponPricer -> (Ptr CCmsCouponPricer' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (CCmsCouponPricer -> (Ptr CCmsCouponPricer' -> IO b) -> IO b)
-> (CmsCouponPricer -> CCmsCouponPricer)
-> CmsCouponPricer
-> (Ptr CCmsCouponPricer' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr CCmsCouponPricer CFloatingRateCouponPricer'
-> CCmsCouponPricer
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr CCmsCouponPricer CFloatingRateCouponPricer'
 -> CCmsCouponPricer)
-> (CmsCouponPricer
    -> GenForeignPtr CCmsCouponPricer CFloatingRateCouponPricer')
-> CmsCouponPricer
-> CCmsCouponPricer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CmsCouponPricer
-> GenForeignPtr CCmsCouponPricer CFloatingRateCouponPricer'
forall frcp.
GenFloatingRateCouponPricer frcp
-> GenForeignPtr frcp CFloatingRateCouponPricer'
getFloatingRateCouponPricer

-- |A 'FloatingRateCoupon' or one of its leaves; see the hierarchy under t'GenCashFlow'.
type GenFloatingRateCoupon frc = GenCoupon (AnyOf CFloatingRateCoupon' frc)
data CFloatingRateCoupon'
type CFloatingRateCoupon = ForeignPtr CFloatingRateCoupon'
-- |A 'Coupon'; see the hierarchy under t'GenCashFlow'.
type FloatingRateCoupon = GenFloatingRateCoupon CFloatingRateCoupon
foreign import ccall unsafe "ql.h &qlFreeFloatingRateCoupon" qlFreeFloatingRateCoupon :: FinalizerPtr CFloatingRateCoupon'
instance Finalizable CFloatingRateCoupon' where finalize :: FinalizerPtr CFloatingRateCoupon'
finalize = FinalizerPtr CFloatingRateCoupon'
qlFreeFloatingRateCoupon
foreign import ccall "ql.h qlFloatingRateCouponAsCoupon" qlFloatingRateCouponAsCoupon :: Ptr CFloatingRateCoupon' -> IO (Ptr CCoupon')
instance Upcastable CFloatingRateCoupon' where {type Base CFloatingRateCoupon' = CCoupon'; upcast :: Ptr CFloatingRateCoupon' -> IO (Ptr (Base CFloatingRateCoupon'))
upcast = Ptr CFloatingRateCoupon' -> IO (Ptr CCoupon')
Ptr CFloatingRateCoupon' -> IO (Ptr (Base CFloatingRateCoupon'))
qlFloatingRateCouponAsCoupon}
asFloatingRateCoupon :: GenFloatingRateCoupon frc -> IO FloatingRateCoupon
asFloatingRateCoupon :: forall frc. GenFloatingRateCoupon frc -> IO FloatingRateCoupon
asFloatingRateCoupon = (Ptr CFloatingRateCoupon' -> IO FloatingRateCoupon)
-> GenForeignPtr frc CFloatingRateCoupon' -> IO FloatingRateCoupon
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CFloatingRateCoupon' -> IO FloatingRateCoupon
peekFloatingRateCoupon (GenForeignPtr frc CFloatingRateCoupon' -> IO FloatingRateCoupon)
-> (GenFloatingRateCoupon frc
    -> GenForeignPtr frc CFloatingRateCoupon')
-> GenFloatingRateCoupon frc
-> IO FloatingRateCoupon
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon'
-> GenForeignPtr frc CFloatingRateCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon'
 -> GenForeignPtr frc CFloatingRateCoupon')
-> (GenFloatingRateCoupon frc
    -> GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon')
-> GenFloatingRateCoupon frc
-> GenForeignPtr frc CFloatingRateCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) CCashFlow'
-> GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) CCashFlow'
 -> GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon')
-> (GenFloatingRateCoupon frc
    -> GenForeignPtr
         (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) CCashFlow')
-> GenFloatingRateCoupon frc
-> GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenFloatingRateCoupon frc
-> GenForeignPtr
     (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow
peekFloatingRateCoupon :: Ptr CFloatingRateCoupon' -> IO FloatingRateCoupon
peekFloatingRateCoupon :: Ptr CFloatingRateCoupon' -> IO FloatingRateCoupon
peekFloatingRateCoupon = Ptr CFloatingRateCoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr CFloatingRateCoupon') CFloatingRateCoupon')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CFloatingRateCoupon'
 -> IO
      (GenForeignPtr
         (ForeignPtr CFloatingRateCoupon') CFloatingRateCoupon'))
-> (GenForeignPtr
      (ForeignPtr CFloatingRateCoupon') CFloatingRateCoupon'
    -> IO FloatingRateCoupon)
-> Ptr CFloatingRateCoupon'
-> IO FloatingRateCoupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CFloatingRateCoupon') CFloatingRateCoupon'
-> IO FloatingRateCoupon
forall frc.
GenForeignPtr frc CFloatingRateCoupon'
-> IO (GenFloatingRateCoupon frc)
newGenFloatingRateCoupon
newGenFloatingRateCoupon :: GenForeignPtr frc CFloatingRateCoupon' -> IO (GenFloatingRateCoupon frc)
newGenFloatingRateCoupon :: forall frc.
GenForeignPtr frc CFloatingRateCoupon'
-> IO (GenFloatingRateCoupon frc)
newGenFloatingRateCoupon = GenFloatingRateCoupon frc -> IO (GenFloatingRateCoupon frc)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenFloatingRateCoupon frc -> IO (GenFloatingRateCoupon frc))
-> (GenForeignPtr frc CFloatingRateCoupon'
    -> GenFloatingRateCoupon frc)
-> GenForeignPtr frc CFloatingRateCoupon'
-> IO (GenFloatingRateCoupon frc)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) CCashFlow'
-> GenFloatingRateCoupon frc
forall cf. GenForeignPtr cf CCashFlow' -> GenCashFlow cf
GenCashFlow (GenForeignPtr
   (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) CCashFlow'
 -> GenFloatingRateCoupon frc)
-> (GenForeignPtr frc CFloatingRateCoupon'
    -> GenForeignPtr
         (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) CCashFlow')
-> GenForeignPtr frc CFloatingRateCoupon'
-> GenFloatingRateCoupon frc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon'
-> GenForeignPtr
     (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) CCashFlow'
GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon'
-> GenForeignPtr
     (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) (Base CCoupon')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon'
 -> GenForeignPtr
      (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) CCashFlow')
-> (GenForeignPtr frc CFloatingRateCoupon'
    -> GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon')
-> GenForeignPtr frc CFloatingRateCoupon'
-> GenForeignPtr
     (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) CCashFlow'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr frc CFloatingRateCoupon'
-> GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon'
GenForeignPtr frc CFloatingRateCoupon'
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' frc) (Base CFloatingRateCoupon')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
withFloatingRateCoupon :: GenFloatingRateCoupon frc -> (Ptr CFloatingRateCoupon' -> IO b) -> IO b
withFloatingRateCoupon :: forall frc b.
GenFloatingRateCoupon frc
-> (Ptr CFloatingRateCoupon' -> IO b) -> IO b
withFloatingRateCoupon = GenForeignPtr frc CFloatingRateCoupon'
-> (Ptr CFloatingRateCoupon' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr frc CFloatingRateCoupon'
 -> (Ptr CFloatingRateCoupon' -> IO b) -> IO b)
-> (GenFloatingRateCoupon frc
    -> GenForeignPtr frc CFloatingRateCoupon')
-> GenFloatingRateCoupon frc
-> (Ptr CFloatingRateCoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon'
-> GenForeignPtr frc CFloatingRateCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon'
 -> GenForeignPtr frc CFloatingRateCoupon')
-> (GenFloatingRateCoupon frc
    -> GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon')
-> GenFloatingRateCoupon frc
-> GenForeignPtr frc CFloatingRateCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) CCashFlow'
-> GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) CCashFlow'
 -> GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon')
-> (GenFloatingRateCoupon frc
    -> GenForeignPtr
         (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) CCashFlow')
-> GenFloatingRateCoupon frc
-> GenForeignPtr (AnyOf CFloatingRateCoupon' frc) CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenFloatingRateCoupon frc
-> GenForeignPtr
     (AnyOf CCoupon' (AnyOf CFloatingRateCoupon' frc)) CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

data CCmsCoupon'
type CCmsCoupon = ForeignPtr CCmsCoupon'
-- |A 'FloatingRateCoupon'; see the hierarchy under t'GenCashFlow'.
type CmsCoupon = GenFloatingRateCoupon CCmsCoupon
foreign import ccall unsafe "ql.h &qlFreeCmsCoupon" qlFreeCmsCoupon :: FinalizerPtr CCmsCoupon'
instance Finalizable CCmsCoupon' where finalize :: FinalizerPtr CCmsCoupon'
finalize = FinalizerPtr CCmsCoupon'
qlFreeCmsCoupon
foreign import ccall "ql.h qlCmsCouponAsFloatingRateCoupon" qlCmsCouponAsFloatingRateCoupon :: Ptr CCmsCoupon' -> IO (Ptr CFloatingRateCoupon')
instance Upcastable CCmsCoupon' where {type Base CCmsCoupon' = CFloatingRateCoupon'; upcast :: Ptr CCmsCoupon' -> IO (Ptr (Base CCmsCoupon'))
upcast = Ptr CCmsCoupon' -> IO (Ptr (Base CCmsCoupon'))
Ptr CCmsCoupon' -> IO (Ptr CFloatingRateCoupon')
qlCmsCouponAsFloatingRateCoupon}
peekCmsCoupon :: Ptr CCmsCoupon' -> IO CmsCoupon
peekCmsCoupon :: Ptr CCmsCoupon' -> IO CmsCoupon
peekCmsCoupon = Ptr CCmsCoupon'
-> IO (GenForeignPtr (ForeignPtr CCmsCoupon') (Base CCmsCoupon'))
Ptr CCmsCoupon'
-> IO (GenForeignPtr (ForeignPtr CCmsCoupon') CFloatingRateCoupon')
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CCmsCoupon'
 -> IO
      (GenForeignPtr (ForeignPtr CCmsCoupon') CFloatingRateCoupon'))
-> (GenForeignPtr (ForeignPtr CCmsCoupon') CFloatingRateCoupon'
    -> IO CmsCoupon)
-> Ptr CCmsCoupon'
-> IO CmsCoupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CCmsCoupon') CFloatingRateCoupon'
-> IO CmsCoupon
forall frc.
GenForeignPtr frc CFloatingRateCoupon'
-> IO (GenFloatingRateCoupon frc)
newGenFloatingRateCoupon
withCmsCoupon :: CmsCoupon -> (Ptr CCmsCoupon' -> IO b) -> IO b
withCmsCoupon :: forall b. CmsCoupon -> (Ptr CCmsCoupon' -> IO b) -> IO b
withCmsCoupon = ForeignPtr CCmsCoupon' -> (Ptr CCmsCoupon' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CCmsCoupon' -> (Ptr CCmsCoupon' -> IO b) -> IO b)
-> (CmsCoupon -> ForeignPtr CCmsCoupon')
-> CmsCoupon
-> (Ptr CCmsCoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CCmsCoupon') CFloatingRateCoupon'
-> ForeignPtr CCmsCoupon'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CCmsCoupon') CFloatingRateCoupon'
 -> ForeignPtr CCmsCoupon')
-> (CmsCoupon
    -> GenForeignPtr (ForeignPtr CCmsCoupon') CFloatingRateCoupon')
-> CmsCoupon
-> ForeignPtr CCmsCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CFloatingRateCoupon' (ForeignPtr CCmsCoupon')) CCoupon'
-> GenForeignPtr (ForeignPtr CCmsCoupon') CFloatingRateCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CFloatingRateCoupon' (ForeignPtr CCmsCoupon')) CCoupon'
 -> GenForeignPtr (ForeignPtr CCmsCoupon') CFloatingRateCoupon')
-> (CmsCoupon
    -> GenForeignPtr
         (AnyOf CFloatingRateCoupon' (ForeignPtr CCmsCoupon')) CCoupon')
-> CmsCoupon
-> GenForeignPtr (ForeignPtr CCmsCoupon') CFloatingRateCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCoupon' (AnyOf CFloatingRateCoupon' (ForeignPtr CCmsCoupon')))
  CCashFlow'
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (ForeignPtr CCmsCoupon')) CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCoupon' (AnyOf CFloatingRateCoupon' (ForeignPtr CCmsCoupon')))
   CCashFlow'
 -> GenForeignPtr
      (AnyOf CFloatingRateCoupon' (ForeignPtr CCmsCoupon')) CCoupon')
-> (CmsCoupon
    -> GenForeignPtr
         (AnyOf
            CCoupon' (AnyOf CFloatingRateCoupon' (ForeignPtr CCmsCoupon')))
         CCashFlow')
-> CmsCoupon
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (ForeignPtr CCmsCoupon')) CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CmsCoupon
-> GenForeignPtr
     (AnyOf
        CCoupon' (AnyOf CFloatingRateCoupon' (ForeignPtr CCmsCoupon')))
     CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

-- |Concrete Ibor coupon required by subtype-specific constructors.
data CIborCoupon'
type CIborCoupon = ForeignPtr CIborCoupon'
-- |A 'FloatingRateCoupon'; see the hierarchy under t'GenCashFlow'.
type IborCoupon = GenFloatingRateCoupon CIborCoupon
foreign import ccall unsafe "ql.h &qlFreeIborCoupon" qlFreeIborCoupon :: FinalizerPtr CIborCoupon'
instance Finalizable CIborCoupon' where finalize :: FinalizerPtr CIborCoupon'
finalize = FinalizerPtr CIborCoupon'
qlFreeIborCoupon
foreign import ccall "ql.h qlIborCouponAsFloatingRateCoupon" qlIborCouponAsFloatingRateCoupon :: Ptr CIborCoupon' -> IO (Ptr CFloatingRateCoupon')
instance Upcastable CIborCoupon' where {type Base CIborCoupon' = CFloatingRateCoupon'; upcast :: Ptr CIborCoupon' -> IO (Ptr (Base CIborCoupon'))
upcast = Ptr CIborCoupon' -> IO (Ptr (Base CIborCoupon'))
Ptr CIborCoupon' -> IO (Ptr CFloatingRateCoupon')
qlIborCouponAsFloatingRateCoupon}
peekIborCoupon :: Ptr CIborCoupon' -> IO IborCoupon
peekIborCoupon :: Ptr CIborCoupon' -> IO IborCoupon
peekIborCoupon = Ptr CIborCoupon'
-> IO (GenForeignPtr (ForeignPtr CIborCoupon') (Base CIborCoupon'))
Ptr CIborCoupon'
-> IO
     (GenForeignPtr (ForeignPtr CIborCoupon') CFloatingRateCoupon')
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CIborCoupon'
 -> IO
      (GenForeignPtr (ForeignPtr CIborCoupon') CFloatingRateCoupon'))
-> (GenForeignPtr (ForeignPtr CIborCoupon') CFloatingRateCoupon'
    -> IO IborCoupon)
-> Ptr CIborCoupon'
-> IO IborCoupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CIborCoupon') CFloatingRateCoupon'
-> IO IborCoupon
forall frc.
GenForeignPtr frc CFloatingRateCoupon'
-> IO (GenFloatingRateCoupon frc)
newGenFloatingRateCoupon
withIborCoupon :: IborCoupon -> (Ptr CIborCoupon' -> IO b) -> IO b
withIborCoupon :: forall b. IborCoupon -> (Ptr CIborCoupon' -> IO b) -> IO b
withIborCoupon = ForeignPtr CIborCoupon' -> (Ptr CIborCoupon' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CIborCoupon' -> (Ptr CIborCoupon' -> IO b) -> IO b)
-> (IborCoupon -> ForeignPtr CIborCoupon')
-> IborCoupon
-> (Ptr CIborCoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CIborCoupon') CFloatingRateCoupon'
-> ForeignPtr CIborCoupon'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CIborCoupon') CFloatingRateCoupon'
 -> ForeignPtr CIborCoupon')
-> (IborCoupon
    -> GenForeignPtr (ForeignPtr CIborCoupon') CFloatingRateCoupon')
-> IborCoupon
-> ForeignPtr CIborCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CFloatingRateCoupon' (ForeignPtr CIborCoupon')) CCoupon'
-> GenForeignPtr (ForeignPtr CIborCoupon') CFloatingRateCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CFloatingRateCoupon' (ForeignPtr CIborCoupon')) CCoupon'
 -> GenForeignPtr (ForeignPtr CIborCoupon') CFloatingRateCoupon')
-> (IborCoupon
    -> GenForeignPtr
         (AnyOf CFloatingRateCoupon' (ForeignPtr CIborCoupon')) CCoupon')
-> IborCoupon
-> GenForeignPtr (ForeignPtr CIborCoupon') CFloatingRateCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCoupon' (AnyOf CFloatingRateCoupon' (ForeignPtr CIborCoupon')))
  CCashFlow'
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (ForeignPtr CIborCoupon')) CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCoupon' (AnyOf CFloatingRateCoupon' (ForeignPtr CIborCoupon')))
   CCashFlow'
 -> GenForeignPtr
      (AnyOf CFloatingRateCoupon' (ForeignPtr CIborCoupon')) CCoupon')
-> (IborCoupon
    -> GenForeignPtr
         (AnyOf
            CCoupon' (AnyOf CFloatingRateCoupon' (ForeignPtr CIborCoupon')))
         CCashFlow')
-> IborCoupon
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (ForeignPtr CIborCoupon')) CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IborCoupon
-> GenForeignPtr
     (AnyOf
        CCoupon' (AnyOf CFloatingRateCoupon' (ForeignPtr CIborCoupon')))
     CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

data COvernightIndexedCoupon'
type COvernightIndexedCoupon = ForeignPtr COvernightIndexedCoupon'
-- |A 'FloatingRateCoupon'; see the hierarchy under t'GenCashFlow'.
type OvernightIndexedCoupon = GenFloatingRateCoupon COvernightIndexedCoupon
foreign import ccall unsafe "ql.h &qlFreeOvernightIndexedCoupon" qlFreeOvernightIndexedCoupon :: FinalizerPtr COvernightIndexedCoupon'
instance Finalizable COvernightIndexedCoupon' where finalize :: FinalizerPtr COvernightIndexedCoupon'
finalize = FinalizerPtr COvernightIndexedCoupon'
qlFreeOvernightIndexedCoupon
foreign import ccall "ql.h qlOvernightIndexedCouponAsFloatingRateCoupon" qlOvernightIndexedCouponAsFloatingRateCoupon :: Ptr COvernightIndexedCoupon' -> IO (Ptr CFloatingRateCoupon')
instance Upcastable COvernightIndexedCoupon' where {type Base COvernightIndexedCoupon' = CFloatingRateCoupon'; upcast :: Ptr COvernightIndexedCoupon'
-> IO (Ptr (Base COvernightIndexedCoupon'))
upcast = Ptr COvernightIndexedCoupon'
-> IO (Ptr (Base COvernightIndexedCoupon'))
Ptr COvernightIndexedCoupon' -> IO (Ptr CFloatingRateCoupon')
qlOvernightIndexedCouponAsFloatingRateCoupon}
peekOvernightIndexedCoupon :: Ptr COvernightIndexedCoupon' -> IO OvernightIndexedCoupon
peekOvernightIndexedCoupon :: Ptr COvernightIndexedCoupon' -> IO OvernightIndexedCoupon
peekOvernightIndexedCoupon = Ptr COvernightIndexedCoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr COvernightIndexedCoupon')
        (Base COvernightIndexedCoupon'))
Ptr COvernightIndexedCoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr COvernightIndexedCoupon') CFloatingRateCoupon')
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr COvernightIndexedCoupon'
 -> IO
      (GenForeignPtr
         (ForeignPtr COvernightIndexedCoupon') CFloatingRateCoupon'))
-> (GenForeignPtr
      (ForeignPtr COvernightIndexedCoupon') CFloatingRateCoupon'
    -> IO OvernightIndexedCoupon)
-> Ptr COvernightIndexedCoupon'
-> IO OvernightIndexedCoupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr COvernightIndexedCoupon') CFloatingRateCoupon'
-> IO OvernightIndexedCoupon
forall frc.
GenForeignPtr frc CFloatingRateCoupon'
-> IO (GenFloatingRateCoupon frc)
newGenFloatingRateCoupon
withOvernightIndexedCoupon :: OvernightIndexedCoupon -> (Ptr COvernightIndexedCoupon' -> IO b) -> IO b
withOvernightIndexedCoupon :: forall b.
OvernightIndexedCoupon
-> (Ptr COvernightIndexedCoupon' -> IO b) -> IO b
withOvernightIndexedCoupon = ForeignPtr COvernightIndexedCoupon'
-> (Ptr COvernightIndexedCoupon' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr COvernightIndexedCoupon'
 -> (Ptr COvernightIndexedCoupon' -> IO b) -> IO b)
-> (OvernightIndexedCoupon -> ForeignPtr COvernightIndexedCoupon')
-> OvernightIndexedCoupon
-> (Ptr COvernightIndexedCoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr COvernightIndexedCoupon') CFloatingRateCoupon'
-> ForeignPtr COvernightIndexedCoupon'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr COvernightIndexedCoupon') CFloatingRateCoupon'
 -> ForeignPtr COvernightIndexedCoupon')
-> (OvernightIndexedCoupon
    -> GenForeignPtr
         (ForeignPtr COvernightIndexedCoupon') CFloatingRateCoupon')
-> OvernightIndexedCoupon
-> ForeignPtr COvernightIndexedCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CFloatingRateCoupon' (ForeignPtr COvernightIndexedCoupon'))
  CCoupon'
-> GenForeignPtr
     (ForeignPtr COvernightIndexedCoupon') CFloatingRateCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CFloatingRateCoupon' (ForeignPtr COvernightIndexedCoupon'))
   CCoupon'
 -> GenForeignPtr
      (ForeignPtr COvernightIndexedCoupon') CFloatingRateCoupon')
-> (OvernightIndexedCoupon
    -> GenForeignPtr
         (AnyOf CFloatingRateCoupon' (ForeignPtr COvernightIndexedCoupon'))
         CCoupon')
-> OvernightIndexedCoupon
-> GenForeignPtr
     (ForeignPtr COvernightIndexedCoupon') CFloatingRateCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCoupon'
     (AnyOf CFloatingRateCoupon' (ForeignPtr COvernightIndexedCoupon')))
  CCashFlow'
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (ForeignPtr COvernightIndexedCoupon'))
     CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCoupon'
      (AnyOf CFloatingRateCoupon' (ForeignPtr COvernightIndexedCoupon')))
   CCashFlow'
 -> GenForeignPtr
      (AnyOf CFloatingRateCoupon' (ForeignPtr COvernightIndexedCoupon'))
      CCoupon')
-> (OvernightIndexedCoupon
    -> GenForeignPtr
         (AnyOf
            CCoupon'
            (AnyOf CFloatingRateCoupon' (ForeignPtr COvernightIndexedCoupon')))
         CCashFlow')
-> OvernightIndexedCoupon
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (ForeignPtr COvernightIndexedCoupon'))
     CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OvernightIndexedCoupon
-> GenForeignPtr
     (AnyOf
        CCoupon'
        (AnyOf CFloatingRateCoupon' (ForeignPtr COvernightIndexedCoupon')))
     CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow
data CAverageBMACoupon'
type CAverageBMACoupon = ForeignPtr CAverageBMACoupon'
-- |A 'FloatingRateCoupon'; see the hierarchy under t'GenCashFlow'.
type AverageBMACoupon = GenFloatingRateCoupon CAverageBMACoupon
foreign import ccall unsafe "ql.h &qlFreeAverageBMACoupon" qlFreeAverageBMACoupon :: FinalizerPtr CAverageBMACoupon'
instance Finalizable CAverageBMACoupon' where finalize :: FinalizerPtr CAverageBMACoupon'
finalize = FinalizerPtr CAverageBMACoupon'
qlFreeAverageBMACoupon
foreign import ccall "ql.h qlAverageBMACouponAsFloatingRateCoupon" qlAverageBMACouponAsFloatingRateCoupon :: Ptr CAverageBMACoupon' -> IO (Ptr CFloatingRateCoupon')
instance Upcastable CAverageBMACoupon' where {type Base CAverageBMACoupon' = CFloatingRateCoupon'; upcast :: Ptr CAverageBMACoupon' -> IO (Ptr (Base CAverageBMACoupon'))
upcast = Ptr CAverageBMACoupon' -> IO (Ptr (Base CAverageBMACoupon'))
Ptr CAverageBMACoupon' -> IO (Ptr CFloatingRateCoupon')
qlAverageBMACouponAsFloatingRateCoupon}
peekAverageBMACoupon :: Ptr CAverageBMACoupon' -> IO AverageBMACoupon
peekAverageBMACoupon :: Ptr CAverageBMACoupon' -> IO AverageBMACoupon
peekAverageBMACoupon = Ptr CAverageBMACoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr CAverageBMACoupon') (Base CAverageBMACoupon'))
Ptr CAverageBMACoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr CAverageBMACoupon') CFloatingRateCoupon')
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CAverageBMACoupon'
 -> IO
      (GenForeignPtr
         (ForeignPtr CAverageBMACoupon') CFloatingRateCoupon'))
-> (GenForeignPtr
      (ForeignPtr CAverageBMACoupon') CFloatingRateCoupon'
    -> IO AverageBMACoupon)
-> Ptr CAverageBMACoupon'
-> IO AverageBMACoupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CAverageBMACoupon') CFloatingRateCoupon'
-> IO AverageBMACoupon
forall frc.
GenForeignPtr frc CFloatingRateCoupon'
-> IO (GenFloatingRateCoupon frc)
newGenFloatingRateCoupon
withAverageBMACoupon :: AverageBMACoupon -> (Ptr CAverageBMACoupon' -> IO b) -> IO b
withAverageBMACoupon :: forall b.
AverageBMACoupon -> (Ptr CAverageBMACoupon' -> IO b) -> IO b
withAverageBMACoupon = ForeignPtr CAverageBMACoupon'
-> (Ptr CAverageBMACoupon' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CAverageBMACoupon'
 -> (Ptr CAverageBMACoupon' -> IO b) -> IO b)
-> (AverageBMACoupon -> ForeignPtr CAverageBMACoupon')
-> AverageBMACoupon
-> (Ptr CAverageBMACoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CAverageBMACoupon') CFloatingRateCoupon'
-> ForeignPtr CAverageBMACoupon'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CAverageBMACoupon') CFloatingRateCoupon'
 -> ForeignPtr CAverageBMACoupon')
-> (AverageBMACoupon
    -> GenForeignPtr
         (ForeignPtr CAverageBMACoupon') CFloatingRateCoupon')
-> AverageBMACoupon
-> ForeignPtr CAverageBMACoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CFloatingRateCoupon' (ForeignPtr CAverageBMACoupon'))
  CCoupon'
-> GenForeignPtr
     (ForeignPtr CAverageBMACoupon') CFloatingRateCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CFloatingRateCoupon' (ForeignPtr CAverageBMACoupon'))
   CCoupon'
 -> GenForeignPtr
      (ForeignPtr CAverageBMACoupon') CFloatingRateCoupon')
-> (AverageBMACoupon
    -> GenForeignPtr
         (AnyOf CFloatingRateCoupon' (ForeignPtr CAverageBMACoupon'))
         CCoupon')
-> AverageBMACoupon
-> GenForeignPtr
     (ForeignPtr CAverageBMACoupon') CFloatingRateCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCoupon'
     (AnyOf CFloatingRateCoupon' (ForeignPtr CAverageBMACoupon')))
  CCashFlow'
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (ForeignPtr CAverageBMACoupon'))
     CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCoupon'
      (AnyOf CFloatingRateCoupon' (ForeignPtr CAverageBMACoupon')))
   CCashFlow'
 -> GenForeignPtr
      (AnyOf CFloatingRateCoupon' (ForeignPtr CAverageBMACoupon'))
      CCoupon')
-> (AverageBMACoupon
    -> GenForeignPtr
         (AnyOf
            CCoupon'
            (AnyOf CFloatingRateCoupon' (ForeignPtr CAverageBMACoupon')))
         CCashFlow')
-> AverageBMACoupon
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (ForeignPtr CAverageBMACoupon'))
     CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AverageBMACoupon
-> GenForeignPtr
     (AnyOf
        CCoupon'
        (AnyOf CFloatingRateCoupon' (ForeignPtr CAverageBMACoupon')))
     CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow
data CMultipleResetsCoupon'
type CMultipleResetsCoupon = ForeignPtr CMultipleResetsCoupon'
-- |A 'FloatingRateCoupon'; see the hierarchy under t'GenCashFlow'.
type MultipleResetsCoupon = GenFloatingRateCoupon CMultipleResetsCoupon
foreign import ccall unsafe "ql.h &qlFreeMultipleResetsCoupon" qlFreeMultipleResetsCoupon :: FinalizerPtr CMultipleResetsCoupon'
instance Finalizable CMultipleResetsCoupon' where finalize :: FinalizerPtr CMultipleResetsCoupon'
finalize = FinalizerPtr CMultipleResetsCoupon'
qlFreeMultipleResetsCoupon
foreign import ccall "ql.h qlMultipleResetsCouponAsFloatingRateCoupon" qlMultipleResetsCouponAsFloatingRateCoupon :: Ptr CMultipleResetsCoupon' -> IO (Ptr CFloatingRateCoupon')
instance Upcastable CMultipleResetsCoupon' where {type Base CMultipleResetsCoupon' = CFloatingRateCoupon'; upcast :: Ptr CMultipleResetsCoupon'
-> IO (Ptr (Base CMultipleResetsCoupon'))
upcast = Ptr CMultipleResetsCoupon'
-> IO (Ptr (Base CMultipleResetsCoupon'))
Ptr CMultipleResetsCoupon' -> IO (Ptr CFloatingRateCoupon')
qlMultipleResetsCouponAsFloatingRateCoupon}
peekMultipleResetsCoupon :: Ptr CMultipleResetsCoupon' -> IO MultipleResetsCoupon
peekMultipleResetsCoupon :: Ptr CMultipleResetsCoupon' -> IO MultipleResetsCoupon
peekMultipleResetsCoupon = Ptr CMultipleResetsCoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr CMultipleResetsCoupon') (Base CMultipleResetsCoupon'))
Ptr CMultipleResetsCoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr CMultipleResetsCoupon') CFloatingRateCoupon')
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CMultipleResetsCoupon'
 -> IO
      (GenForeignPtr
         (ForeignPtr CMultipleResetsCoupon') CFloatingRateCoupon'))
-> (GenForeignPtr
      (ForeignPtr CMultipleResetsCoupon') CFloatingRateCoupon'
    -> IO MultipleResetsCoupon)
-> Ptr CMultipleResetsCoupon'
-> IO MultipleResetsCoupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CMultipleResetsCoupon') CFloatingRateCoupon'
-> IO MultipleResetsCoupon
forall frc.
GenForeignPtr frc CFloatingRateCoupon'
-> IO (GenFloatingRateCoupon frc)
newGenFloatingRateCoupon
withMultipleResetsCoupon :: MultipleResetsCoupon -> (Ptr CMultipleResetsCoupon' -> IO b) -> IO b
withMultipleResetsCoupon :: forall b.
MultipleResetsCoupon
-> (Ptr CMultipleResetsCoupon' -> IO b) -> IO b
withMultipleResetsCoupon = ForeignPtr CMultipleResetsCoupon'
-> (Ptr CMultipleResetsCoupon' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CMultipleResetsCoupon'
 -> (Ptr CMultipleResetsCoupon' -> IO b) -> IO b)
-> (MultipleResetsCoupon -> ForeignPtr CMultipleResetsCoupon')
-> MultipleResetsCoupon
-> (Ptr CMultipleResetsCoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CMultipleResetsCoupon') CFloatingRateCoupon'
-> ForeignPtr CMultipleResetsCoupon'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CMultipleResetsCoupon') CFloatingRateCoupon'
 -> ForeignPtr CMultipleResetsCoupon')
-> (MultipleResetsCoupon
    -> GenForeignPtr
         (ForeignPtr CMultipleResetsCoupon') CFloatingRateCoupon')
-> MultipleResetsCoupon
-> ForeignPtr CMultipleResetsCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CFloatingRateCoupon' (ForeignPtr CMultipleResetsCoupon'))
  CCoupon'
-> GenForeignPtr
     (ForeignPtr CMultipleResetsCoupon') CFloatingRateCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CFloatingRateCoupon' (ForeignPtr CMultipleResetsCoupon'))
   CCoupon'
 -> GenForeignPtr
      (ForeignPtr CMultipleResetsCoupon') CFloatingRateCoupon')
-> (MultipleResetsCoupon
    -> GenForeignPtr
         (AnyOf CFloatingRateCoupon' (ForeignPtr CMultipleResetsCoupon'))
         CCoupon')
-> MultipleResetsCoupon
-> GenForeignPtr
     (ForeignPtr CMultipleResetsCoupon') CFloatingRateCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCoupon'
     (AnyOf CFloatingRateCoupon' (ForeignPtr CMultipleResetsCoupon')))
  CCashFlow'
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (ForeignPtr CMultipleResetsCoupon'))
     CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCoupon'
      (AnyOf CFloatingRateCoupon' (ForeignPtr CMultipleResetsCoupon')))
   CCashFlow'
 -> GenForeignPtr
      (AnyOf CFloatingRateCoupon' (ForeignPtr CMultipleResetsCoupon'))
      CCoupon')
-> (MultipleResetsCoupon
    -> GenForeignPtr
         (AnyOf
            CCoupon'
            (AnyOf CFloatingRateCoupon' (ForeignPtr CMultipleResetsCoupon')))
         CCashFlow')
-> MultipleResetsCoupon
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (ForeignPtr CMultipleResetsCoupon'))
     CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. MultipleResetsCoupon
-> GenForeignPtr
     (AnyOf
        CCoupon'
        (AnyOf CFloatingRateCoupon' (ForeignPtr CMultipleResetsCoupon')))
     CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

data CCPICoupon'
type CCPICoupon = ForeignPtr CCPICoupon'
-- |A 'Coupon'; see the hierarchy under t'GenCashFlow'.
type CPICoupon = GenCoupon CCPICoupon
foreign import ccall unsafe "ql.h &qlFreeCPICoupon" qlFreeCPICoupon :: FinalizerPtr CCPICoupon'
instance Finalizable CCPICoupon' where finalize :: FinalizerPtr CCPICoupon'
finalize = FinalizerPtr CCPICoupon'
qlFreeCPICoupon
foreign import ccall "ql.h qlCPICouponAsCoupon" qlCPICouponAsCoupon :: Ptr CCPICoupon' -> IO (Ptr CCoupon')
instance Upcastable CCPICoupon' where {type Base CCPICoupon' = CCoupon'; upcast :: Ptr CCPICoupon' -> IO (Ptr (Base CCPICoupon'))
upcast = Ptr CCPICoupon' -> IO (Ptr CCoupon')
Ptr CCPICoupon' -> IO (Ptr (Base CCPICoupon'))
qlCPICouponAsCoupon}
peekCPICoupon :: Ptr CCPICoupon' -> IO CPICoupon
peekCPICoupon :: Ptr CCPICoupon' -> IO CPICoupon
peekCPICoupon = Ptr CCPICoupon'
-> IO (GenForeignPtr (ForeignPtr CCPICoupon') CCoupon')
Ptr CCPICoupon'
-> IO (GenForeignPtr (ForeignPtr CCPICoupon') (Base CCPICoupon'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CCPICoupon'
 -> IO (GenForeignPtr (ForeignPtr CCPICoupon') CCoupon'))
-> (GenForeignPtr (ForeignPtr CCPICoupon') CCoupon'
    -> IO CPICoupon)
-> Ptr CCPICoupon'
-> IO CPICoupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CCPICoupon') CCoupon' -> IO CPICoupon
forall c. GenForeignPtr c CCoupon' -> IO (GenCoupon c)
newGenCoupon
withCPICoupon :: CPICoupon -> (Ptr CCPICoupon' -> IO b) -> IO b
withCPICoupon :: forall b. CPICoupon -> (Ptr CCPICoupon' -> IO b) -> IO b
withCPICoupon = ForeignPtr CCPICoupon' -> (Ptr CCPICoupon' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CCPICoupon' -> (Ptr CCPICoupon' -> IO b) -> IO b)
-> (CPICoupon -> ForeignPtr CCPICoupon')
-> CPICoupon
-> (Ptr CCPICoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CCPICoupon') CCoupon'
-> ForeignPtr CCPICoupon'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CCPICoupon') CCoupon'
 -> ForeignPtr CCPICoupon')
-> (CPICoupon -> GenForeignPtr (ForeignPtr CCPICoupon') CCoupon')
-> CPICoupon
-> ForeignPtr CCPICoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CCoupon' (ForeignPtr CCPICoupon')) CCashFlow'
-> GenForeignPtr (ForeignPtr CCPICoupon') CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CCoupon' (ForeignPtr CCPICoupon')) CCashFlow'
 -> GenForeignPtr (ForeignPtr CCPICoupon') CCoupon')
-> (CPICoupon
    -> GenForeignPtr
         (AnyOf CCoupon' (ForeignPtr CCPICoupon')) CCashFlow')
-> CPICoupon
-> GenForeignPtr (ForeignPtr CCPICoupon') CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CPICoupon
-> GenForeignPtr
     (AnyOf CCoupon' (ForeignPtr CCPICoupon')) CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

data CCPICouponPricer
newtype CPICouponPricer = CPICouponPricer {CPICouponPricer -> Standalone CCPICouponPricer
getCCPICouponPricer :: Standalone CCPICouponPricer}
foreign import ccall unsafe "ql.h &qlFreeCPICouponPricer" qlFreeCPICouponPricer :: FinalizerPtr CCPICouponPricer
instance Finalizable CCPICouponPricer where finalize :: FinalizerPtr CCPICouponPricer
finalize = FinalizerPtr CCPICouponPricer
qlFreeCPICouponPricer
peekCPICouponPricer :: Ptr CCPICouponPricer -> IO CPICouponPricer
peekCPICouponPricer :: Ptr CCPICouponPricer -> IO CPICouponPricer
peekCPICouponPricer = Standalone CCPICouponPricer -> CPICouponPricer
CPICouponPricer (Standalone CCPICouponPricer -> CPICouponPricer)
-> (Ptr CCPICouponPricer -> IO (Standalone CCPICouponPricer))
-> Ptr CCPICouponPricer
-> IO CPICouponPricer
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCPICouponPricer -> IO (Standalone CCPICouponPricer)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withCPICouponPricer :: CPICouponPricer -> (Ptr CCPICouponPricer -> IO b) -> IO b
withCPICouponPricer :: forall b. CPICouponPricer -> (Ptr CCPICouponPricer -> IO b) -> IO b
withCPICouponPricer = Standalone CCPICouponPricer
-> (Ptr CCPICouponPricer -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CCPICouponPricer
 -> (Ptr CCPICouponPricer -> IO b) -> IO b)
-> (CPICouponPricer -> Standalone CCPICouponPricer)
-> CPICouponPricer
-> (Ptr CCPICouponPricer -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CPICouponPricer -> Standalone CCPICouponPricer
getCCPICouponPricer

data CDigitalReplication
newtype DigitalReplication = DigitalReplication {DigitalReplication -> Standalone CDigitalReplication
getCDigitalReplication :: Standalone CDigitalReplication}
foreign import ccall unsafe "ql.h &qlFreeDigitalReplication" qlFreeDigitalReplication :: FinalizerPtr CDigitalReplication
instance Finalizable CDigitalReplication where finalize :: FinalizerPtr CDigitalReplication
finalize = FinalizerPtr CDigitalReplication
qlFreeDigitalReplication
peekDigitalReplication :: Ptr CDigitalReplication -> IO DigitalReplication
peekDigitalReplication :: Ptr CDigitalReplication -> IO DigitalReplication
peekDigitalReplication = Standalone CDigitalReplication -> DigitalReplication
DigitalReplication (Standalone CDigitalReplication -> DigitalReplication)
-> (Ptr CDigitalReplication -> IO (Standalone CDigitalReplication))
-> Ptr CDigitalReplication
-> IO DigitalReplication
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CDigitalReplication -> IO (Standalone CDigitalReplication)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withDigitalReplication :: DigitalReplication -> (Ptr CDigitalReplication -> IO b) -> IO b
withDigitalReplication :: forall b.
DigitalReplication -> (Ptr CDigitalReplication -> IO b) -> IO b
withDigitalReplication = Standalone CDigitalReplication
-> (Ptr CDigitalReplication -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CDigitalReplication
 -> (Ptr CDigitalReplication -> IO b) -> IO b)
-> (DigitalReplication -> Standalone CDigitalReplication)
-> DigitalReplication
-> (Ptr CDigitalReplication -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DigitalReplication -> Standalone CDigitalReplication
getCDigitalReplication
withMaybeDigitalReplication :: Maybe DigitalReplication -> (Ptr CDigitalReplication -> IO b) -> IO b
withMaybeDigitalReplication :: forall b.
Maybe DigitalReplication
-> (Ptr CDigitalReplication -> IO b) -> IO b
withMaybeDigitalReplication = ((Ptr CDigitalReplication -> IO b) -> IO b)
-> (DigitalReplication
    -> (Ptr CDigitalReplication -> IO b) -> IO b)
-> Maybe DigitalReplication
-> (Ptr CDigitalReplication -> IO b)
-> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe ((Ptr CDigitalReplication -> IO b)
-> Ptr CDigitalReplication -> IO b
forall a b. (a -> b) -> a -> b
$ Ptr CDigitalReplication
forall a. Ptr a
nullPtr) DigitalReplication -> (Ptr CDigitalReplication -> IO b) -> IO b
forall b.
DigitalReplication -> (Ptr CDigitalReplication -> IO b) -> IO b
withDigitalReplication

data CDigitalCmsCoupon'
type CDigitalCmsCoupon = ForeignPtr CDigitalCmsCoupon'
-- |A 'DigitalCoupon'; see the hierarchy under t'GenCashFlow'.
type DigitalCmsCoupon = GenDigitalCoupon CDigitalCmsCoupon
foreign import ccall unsafe "ql.h &qlFreeDigitalCmsCoupon" qlFreeDigitalCmsCoupon :: FinalizerPtr CDigitalCmsCoupon'
instance Finalizable CDigitalCmsCoupon' where finalize :: FinalizerPtr CDigitalCmsCoupon'
finalize = FinalizerPtr CDigitalCmsCoupon'
qlFreeDigitalCmsCoupon
foreign import ccall "ql.h qlDigitalCmsCouponAsDigitalCoupon" qlDigitalCmsCouponAsDigitalCoupon :: Ptr CDigitalCmsCoupon' -> IO (Ptr CDigitalCoupon')
instance Upcastable CDigitalCmsCoupon' where {type Base CDigitalCmsCoupon' = CDigitalCoupon'; upcast :: Ptr CDigitalCmsCoupon' -> IO (Ptr (Base CDigitalCmsCoupon'))
upcast = Ptr CDigitalCmsCoupon' -> IO (Ptr (Base CDigitalCmsCoupon'))
Ptr CDigitalCmsCoupon' -> IO (Ptr CDigitalCoupon')
qlDigitalCmsCouponAsDigitalCoupon}
peekDigitalCmsCoupon :: Ptr CDigitalCmsCoupon' -> IO DigitalCmsCoupon
peekDigitalCmsCoupon :: Ptr CDigitalCmsCoupon' -> IO DigitalCmsCoupon
peekDigitalCmsCoupon = Ptr CDigitalCmsCoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr CDigitalCmsCoupon') (Base CDigitalCmsCoupon'))
Ptr CDigitalCmsCoupon'
-> IO
     (GenForeignPtr (ForeignPtr CDigitalCmsCoupon') CDigitalCoupon')
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CDigitalCmsCoupon'
 -> IO
      (GenForeignPtr (ForeignPtr CDigitalCmsCoupon') CDigitalCoupon'))
-> (GenForeignPtr (ForeignPtr CDigitalCmsCoupon') CDigitalCoupon'
    -> IO DigitalCmsCoupon)
-> Ptr CDigitalCmsCoupon'
-> IO DigitalCmsCoupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CDigitalCmsCoupon') CDigitalCoupon'
-> IO DigitalCmsCoupon
forall dc.
GenForeignPtr dc CDigitalCoupon' -> IO (GenDigitalCoupon dc)
newGenDigitalCoupon
withDigitalCmsCoupon :: DigitalCmsCoupon -> (Ptr CDigitalCmsCoupon' -> IO b) -> IO b
withDigitalCmsCoupon :: forall b.
DigitalCmsCoupon -> (Ptr CDigitalCmsCoupon' -> IO b) -> IO b
withDigitalCmsCoupon = ForeignPtr CDigitalCmsCoupon'
-> (Ptr CDigitalCmsCoupon' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CDigitalCmsCoupon'
 -> (Ptr CDigitalCmsCoupon' -> IO b) -> IO b)
-> (DigitalCmsCoupon -> ForeignPtr CDigitalCmsCoupon')
-> DigitalCmsCoupon
-> (Ptr CDigitalCmsCoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CDigitalCmsCoupon') CDigitalCoupon'
-> ForeignPtr CDigitalCmsCoupon'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CDigitalCmsCoupon') CDigitalCoupon'
 -> ForeignPtr CDigitalCmsCoupon')
-> (DigitalCmsCoupon
    -> GenForeignPtr (ForeignPtr CDigitalCmsCoupon') CDigitalCoupon')
-> DigitalCmsCoupon
-> ForeignPtr CDigitalCmsCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon'))
  CFloatingRateCoupon'
-> GenForeignPtr (ForeignPtr CDigitalCmsCoupon') CDigitalCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon'))
   CFloatingRateCoupon'
 -> GenForeignPtr (ForeignPtr CDigitalCmsCoupon') CDigitalCoupon')
-> (DigitalCmsCoupon
    -> GenForeignPtr
         (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon'))
         CFloatingRateCoupon')
-> DigitalCmsCoupon
-> GenForeignPtr (ForeignPtr CDigitalCmsCoupon') CDigitalCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CFloatingRateCoupon'
     (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon')))
  CCoupon'
-> GenForeignPtr
     (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon'))
     CFloatingRateCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CFloatingRateCoupon'
      (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon')))
   CCoupon'
 -> GenForeignPtr
      (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon'))
      CFloatingRateCoupon')
-> (DigitalCmsCoupon
    -> GenForeignPtr
         (AnyOf
            CFloatingRateCoupon'
            (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon')))
         CCoupon')
-> DigitalCmsCoupon
-> GenForeignPtr
     (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon'))
     CFloatingRateCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCoupon'
     (AnyOf
        CFloatingRateCoupon'
        (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon'))))
  CCashFlow'
-> GenForeignPtr
     (AnyOf
        CFloatingRateCoupon'
        (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon')))
     CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCoupon'
      (AnyOf
         CFloatingRateCoupon'
         (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon'))))
   CCashFlow'
 -> GenForeignPtr
      (AnyOf
         CFloatingRateCoupon'
         (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon')))
      CCoupon')
-> (DigitalCmsCoupon
    -> GenForeignPtr
         (AnyOf
            CCoupon'
            (AnyOf
               CFloatingRateCoupon'
               (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon'))))
         CCashFlow')
-> DigitalCmsCoupon
-> GenForeignPtr
     (AnyOf
        CFloatingRateCoupon'
        (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon')))
     CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DigitalCmsCoupon
-> GenForeignPtr
     (AnyOf
        CCoupon'
        (AnyOf
           CFloatingRateCoupon'
           (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsCoupon'))))
     CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

data CDigitalCmsSpreadCoupon'
type CDigitalCmsSpreadCoupon = ForeignPtr CDigitalCmsSpreadCoupon'
-- |A 'DigitalCoupon'; see the hierarchy under t'GenCashFlow'.
type DigitalCmsSpreadCoupon = GenDigitalCoupon CDigitalCmsSpreadCoupon
foreign import ccall unsafe "ql.h &qlFreeDigitalCmsSpreadCoupon" qlFreeDigitalCmsSpreadCoupon :: FinalizerPtr CDigitalCmsSpreadCoupon'
instance Finalizable CDigitalCmsSpreadCoupon' where finalize :: FinalizerPtr CDigitalCmsSpreadCoupon'
finalize = FinalizerPtr CDigitalCmsSpreadCoupon'
qlFreeDigitalCmsSpreadCoupon
foreign import ccall "ql.h qlDigitalCmsSpreadCouponAsDigitalCoupon" qlDigitalCmsSpreadCouponAsDigitalCoupon :: Ptr CDigitalCmsSpreadCoupon' -> IO (Ptr CDigitalCoupon')
instance Upcastable CDigitalCmsSpreadCoupon' where {type Base CDigitalCmsSpreadCoupon' = CDigitalCoupon'; upcast :: Ptr CDigitalCmsSpreadCoupon'
-> IO (Ptr (Base CDigitalCmsSpreadCoupon'))
upcast = Ptr CDigitalCmsSpreadCoupon'
-> IO (Ptr (Base CDigitalCmsSpreadCoupon'))
Ptr CDigitalCmsSpreadCoupon' -> IO (Ptr CDigitalCoupon')
qlDigitalCmsSpreadCouponAsDigitalCoupon}
peekDigitalCmsSpreadCoupon :: Ptr CDigitalCmsSpreadCoupon' -> IO DigitalCmsSpreadCoupon
peekDigitalCmsSpreadCoupon :: Ptr CDigitalCmsSpreadCoupon' -> IO DigitalCmsSpreadCoupon
peekDigitalCmsSpreadCoupon = Ptr CDigitalCmsSpreadCoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr CDigitalCmsSpreadCoupon')
        (Base CDigitalCmsSpreadCoupon'))
Ptr CDigitalCmsSpreadCoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr CDigitalCmsSpreadCoupon') CDigitalCoupon')
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CDigitalCmsSpreadCoupon'
 -> IO
      (GenForeignPtr
         (ForeignPtr CDigitalCmsSpreadCoupon') CDigitalCoupon'))
-> (GenForeignPtr
      (ForeignPtr CDigitalCmsSpreadCoupon') CDigitalCoupon'
    -> IO DigitalCmsSpreadCoupon)
-> Ptr CDigitalCmsSpreadCoupon'
-> IO DigitalCmsSpreadCoupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CDigitalCmsSpreadCoupon') CDigitalCoupon'
-> IO DigitalCmsSpreadCoupon
forall dc.
GenForeignPtr dc CDigitalCoupon' -> IO (GenDigitalCoupon dc)
newGenDigitalCoupon
withDigitalCmsSpreadCoupon :: DigitalCmsSpreadCoupon -> (Ptr CDigitalCmsSpreadCoupon' -> IO b) -> IO b
withDigitalCmsSpreadCoupon :: forall b.
DigitalCmsSpreadCoupon
-> (Ptr CDigitalCmsSpreadCoupon' -> IO b) -> IO b
withDigitalCmsSpreadCoupon = ForeignPtr CDigitalCmsSpreadCoupon'
-> (Ptr CDigitalCmsSpreadCoupon' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CDigitalCmsSpreadCoupon'
 -> (Ptr CDigitalCmsSpreadCoupon' -> IO b) -> IO b)
-> (DigitalCmsSpreadCoupon -> ForeignPtr CDigitalCmsSpreadCoupon')
-> DigitalCmsSpreadCoupon
-> (Ptr CDigitalCmsSpreadCoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CDigitalCmsSpreadCoupon') CDigitalCoupon'
-> ForeignPtr CDigitalCmsSpreadCoupon'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CDigitalCmsSpreadCoupon') CDigitalCoupon'
 -> ForeignPtr CDigitalCmsSpreadCoupon')
-> (DigitalCmsSpreadCoupon
    -> GenForeignPtr
         (ForeignPtr CDigitalCmsSpreadCoupon') CDigitalCoupon')
-> DigitalCmsSpreadCoupon
-> ForeignPtr CDigitalCmsSpreadCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon'))
  CFloatingRateCoupon'
-> GenForeignPtr
     (ForeignPtr CDigitalCmsSpreadCoupon') CDigitalCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon'))
   CFloatingRateCoupon'
 -> GenForeignPtr
      (ForeignPtr CDigitalCmsSpreadCoupon') CDigitalCoupon')
-> (DigitalCmsSpreadCoupon
    -> GenForeignPtr
         (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon'))
         CFloatingRateCoupon')
-> DigitalCmsSpreadCoupon
-> GenForeignPtr
     (ForeignPtr CDigitalCmsSpreadCoupon') CDigitalCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CFloatingRateCoupon'
     (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon')))
  CCoupon'
-> GenForeignPtr
     (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon'))
     CFloatingRateCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CFloatingRateCoupon'
      (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon')))
   CCoupon'
 -> GenForeignPtr
      (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon'))
      CFloatingRateCoupon')
-> (DigitalCmsSpreadCoupon
    -> GenForeignPtr
         (AnyOf
            CFloatingRateCoupon'
            (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon')))
         CCoupon')
-> DigitalCmsSpreadCoupon
-> GenForeignPtr
     (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon'))
     CFloatingRateCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCoupon'
     (AnyOf
        CFloatingRateCoupon'
        (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon'))))
  CCashFlow'
-> GenForeignPtr
     (AnyOf
        CFloatingRateCoupon'
        (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon')))
     CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCoupon'
      (AnyOf
         CFloatingRateCoupon'
         (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon'))))
   CCashFlow'
 -> GenForeignPtr
      (AnyOf
         CFloatingRateCoupon'
         (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon')))
      CCoupon')
-> (DigitalCmsSpreadCoupon
    -> GenForeignPtr
         (AnyOf
            CCoupon'
            (AnyOf
               CFloatingRateCoupon'
               (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon'))))
         CCashFlow')
-> DigitalCmsSpreadCoupon
-> GenForeignPtr
     (AnyOf
        CFloatingRateCoupon'
        (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon')))
     CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DigitalCmsSpreadCoupon
-> GenForeignPtr
     (AnyOf
        CCoupon'
        (AnyOf
           CFloatingRateCoupon'
           (AnyOf CDigitalCoupon' (ForeignPtr CDigitalCmsSpreadCoupon'))))
     CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

data CStrippedCappedFlooredCoupon'
type CStrippedCappedFlooredCoupon = ForeignPtr CStrippedCappedFlooredCoupon'
-- |A 'FloatingRateCoupon'; see the hierarchy under t'GenCashFlow'.
type StrippedCappedFlooredCoupon = GenFloatingRateCoupon CStrippedCappedFlooredCoupon
foreign import ccall unsafe "ql.h &qlFreeStrippedCappedFlooredCoupon" qlFreeStrippedCappedFlooredCoupon :: FinalizerPtr CStrippedCappedFlooredCoupon'
instance Finalizable CStrippedCappedFlooredCoupon' where finalize :: FinalizerPtr CStrippedCappedFlooredCoupon'
finalize = FinalizerPtr CStrippedCappedFlooredCoupon'
qlFreeStrippedCappedFlooredCoupon
foreign import ccall "ql.h qlStrippedCappedFlooredCouponAsFloatingRateCoupon" qlStrippedCappedFlooredCouponAsFloatingRateCoupon :: Ptr CStrippedCappedFlooredCoupon' -> IO (Ptr CFloatingRateCoupon')
instance Upcastable CStrippedCappedFlooredCoupon' where {type Base CStrippedCappedFlooredCoupon' = CFloatingRateCoupon'; upcast :: Ptr CStrippedCappedFlooredCoupon'
-> IO (Ptr (Base CStrippedCappedFlooredCoupon'))
upcast = Ptr CStrippedCappedFlooredCoupon'
-> IO (Ptr (Base CStrippedCappedFlooredCoupon'))
Ptr CStrippedCappedFlooredCoupon' -> IO (Ptr CFloatingRateCoupon')
qlStrippedCappedFlooredCouponAsFloatingRateCoupon}
peekStrippedCappedFlooredCoupon :: Ptr CStrippedCappedFlooredCoupon' -> IO StrippedCappedFlooredCoupon
peekStrippedCappedFlooredCoupon :: Ptr CStrippedCappedFlooredCoupon' -> IO StrippedCappedFlooredCoupon
peekStrippedCappedFlooredCoupon = Ptr CStrippedCappedFlooredCoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr CStrippedCappedFlooredCoupon')
        (Base CStrippedCappedFlooredCoupon'))
Ptr CStrippedCappedFlooredCoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr CStrippedCappedFlooredCoupon') CFloatingRateCoupon')
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CStrippedCappedFlooredCoupon'
 -> IO
      (GenForeignPtr
         (ForeignPtr CStrippedCappedFlooredCoupon') CFloatingRateCoupon'))
-> (GenForeignPtr
      (ForeignPtr CStrippedCappedFlooredCoupon') CFloatingRateCoupon'
    -> IO StrippedCappedFlooredCoupon)
-> Ptr CStrippedCappedFlooredCoupon'
-> IO StrippedCappedFlooredCoupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CStrippedCappedFlooredCoupon') CFloatingRateCoupon'
-> IO StrippedCappedFlooredCoupon
forall frc.
GenForeignPtr frc CFloatingRateCoupon'
-> IO (GenFloatingRateCoupon frc)
newGenFloatingRateCoupon
withStrippedCappedFlooredCoupon :: StrippedCappedFlooredCoupon -> (Ptr CStrippedCappedFlooredCoupon' -> IO b) -> IO b
withStrippedCappedFlooredCoupon :: forall b.
StrippedCappedFlooredCoupon
-> (Ptr CStrippedCappedFlooredCoupon' -> IO b) -> IO b
withStrippedCappedFlooredCoupon = ForeignPtr CStrippedCappedFlooredCoupon'
-> (Ptr CStrippedCappedFlooredCoupon' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CStrippedCappedFlooredCoupon'
 -> (Ptr CStrippedCappedFlooredCoupon' -> IO b) -> IO b)
-> (StrippedCappedFlooredCoupon
    -> ForeignPtr CStrippedCappedFlooredCoupon')
-> StrippedCappedFlooredCoupon
-> (Ptr CStrippedCappedFlooredCoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CStrippedCappedFlooredCoupon') CFloatingRateCoupon'
-> ForeignPtr CStrippedCappedFlooredCoupon'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CStrippedCappedFlooredCoupon') CFloatingRateCoupon'
 -> ForeignPtr CStrippedCappedFlooredCoupon')
-> (StrippedCappedFlooredCoupon
    -> GenForeignPtr
         (ForeignPtr CStrippedCappedFlooredCoupon') CFloatingRateCoupon')
-> StrippedCappedFlooredCoupon
-> ForeignPtr CStrippedCappedFlooredCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CFloatingRateCoupon' (ForeignPtr CStrippedCappedFlooredCoupon'))
  CCoupon'
-> GenForeignPtr
     (ForeignPtr CStrippedCappedFlooredCoupon') CFloatingRateCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CFloatingRateCoupon' (ForeignPtr CStrippedCappedFlooredCoupon'))
   CCoupon'
 -> GenForeignPtr
      (ForeignPtr CStrippedCappedFlooredCoupon') CFloatingRateCoupon')
-> (StrippedCappedFlooredCoupon
    -> GenForeignPtr
         (AnyOf
            CFloatingRateCoupon' (ForeignPtr CStrippedCappedFlooredCoupon'))
         CCoupon')
-> StrippedCappedFlooredCoupon
-> GenForeignPtr
     (ForeignPtr CStrippedCappedFlooredCoupon') CFloatingRateCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCoupon'
     (AnyOf
        CFloatingRateCoupon' (ForeignPtr CStrippedCappedFlooredCoupon')))
  CCashFlow'
-> GenForeignPtr
     (AnyOf
        CFloatingRateCoupon' (ForeignPtr CStrippedCappedFlooredCoupon'))
     CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCoupon'
      (AnyOf
         CFloatingRateCoupon' (ForeignPtr CStrippedCappedFlooredCoupon')))
   CCashFlow'
 -> GenForeignPtr
      (AnyOf
         CFloatingRateCoupon' (ForeignPtr CStrippedCappedFlooredCoupon'))
      CCoupon')
-> (StrippedCappedFlooredCoupon
    -> GenForeignPtr
         (AnyOf
            CCoupon'
            (AnyOf
               CFloatingRateCoupon' (ForeignPtr CStrippedCappedFlooredCoupon')))
         CCashFlow')
-> StrippedCappedFlooredCoupon
-> GenForeignPtr
     (AnyOf
        CFloatingRateCoupon' (ForeignPtr CStrippedCappedFlooredCoupon'))
     CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StrippedCappedFlooredCoupon
-> GenForeignPtr
     (AnyOf
        CCoupon'
        (AnyOf
           CFloatingRateCoupon' (ForeignPtr CStrippedCappedFlooredCoupon')))
     CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

data CDigitalCoupon'
-- |A 'DigitalCoupon' or one of its leaves; see the hierarchy under t'GenCashFlow'.
type GenDigitalCoupon dc = GenFloatingRateCoupon (AnyOf CDigitalCoupon' dc)
type CDigitalCoupon = ForeignPtr CDigitalCoupon'
-- |A 'FloatingRateCoupon'; see the hierarchy under t'GenCashFlow'.
type DigitalCoupon = GenDigitalCoupon CDigitalCoupon
foreign import ccall unsafe "ql.h &qlFreeDigitalCoupon" qlFreeDigitalCoupon :: FinalizerPtr CDigitalCoupon'
instance Finalizable CDigitalCoupon' where finalize :: FinalizerPtr CDigitalCoupon'
finalize = FinalizerPtr CDigitalCoupon'
qlFreeDigitalCoupon
foreign import ccall "ql.h qlDigitalCouponAsFloatingRateCoupon" qlDigitalCouponAsFloatingRateCoupon :: Ptr CDigitalCoupon' -> IO (Ptr CFloatingRateCoupon')
instance Upcastable CDigitalCoupon' where {type Base CDigitalCoupon' = CFloatingRateCoupon'; upcast :: Ptr CDigitalCoupon' -> IO (Ptr (Base CDigitalCoupon'))
upcast = Ptr CDigitalCoupon' -> IO (Ptr (Base CDigitalCoupon'))
Ptr CDigitalCoupon' -> IO (Ptr CFloatingRateCoupon')
qlDigitalCouponAsFloatingRateCoupon}
peekDigitalCoupon :: Ptr CDigitalCoupon' -> IO DigitalCoupon
peekDigitalCoupon :: Ptr CDigitalCoupon' -> IO DigitalCoupon
peekDigitalCoupon = Ptr CDigitalCoupon'
-> IO (GenForeignPtr (ForeignPtr CDigitalCoupon') CDigitalCoupon')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CDigitalCoupon'
 -> IO (GenForeignPtr (ForeignPtr CDigitalCoupon') CDigitalCoupon'))
-> (GenForeignPtr (ForeignPtr CDigitalCoupon') CDigitalCoupon'
    -> IO DigitalCoupon)
-> Ptr CDigitalCoupon'
-> IO DigitalCoupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CDigitalCoupon') CDigitalCoupon'
-> IO DigitalCoupon
forall dc.
GenForeignPtr dc CDigitalCoupon' -> IO (GenDigitalCoupon dc)
newGenDigitalCoupon
newGenDigitalCoupon :: GenForeignPtr dc CDigitalCoupon' -> IO (GenDigitalCoupon dc)
newGenDigitalCoupon :: forall dc.
GenForeignPtr dc CDigitalCoupon' -> IO (GenDigitalCoupon dc)
newGenDigitalCoupon = GenDigitalCoupon dc -> IO (GenDigitalCoupon dc)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenDigitalCoupon dc -> IO (GenDigitalCoupon dc))
-> (GenForeignPtr dc CDigitalCoupon' -> GenDigitalCoupon dc)
-> GenForeignPtr dc CDigitalCoupon'
-> IO (GenDigitalCoupon dc)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCoupon' (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)))
  CCashFlow'
-> GenDigitalCoupon dc
forall cf. GenForeignPtr cf CCashFlow' -> GenCashFlow cf
GenCashFlow (GenForeignPtr
   (AnyOf
      CCoupon' (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)))
   CCashFlow'
 -> GenDigitalCoupon dc)
-> (GenForeignPtr dc CDigitalCoupon'
    -> GenForeignPtr
         (AnyOf
            CCoupon' (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)))
         CCashFlow')
-> GenForeignPtr dc CDigitalCoupon'
-> GenDigitalCoupon dc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)) CCoupon'
-> GenForeignPtr
     (AnyOf
        CCoupon' (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)))
     CCashFlow'
GenForeignPtr
  (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)) CCoupon'
-> GenForeignPtr
     (AnyOf
        CCoupon' (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)))
     (Base CCoupon')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr
   (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)) CCoupon'
 -> GenForeignPtr
      (AnyOf
         CCoupon' (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)))
      CCashFlow')
-> (GenForeignPtr dc CDigitalCoupon'
    -> GenForeignPtr
         (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)) CCoupon')
-> GenForeignPtr dc CDigitalCoupon'
-> GenForeignPtr
     (AnyOf
        CCoupon' (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)))
     CCashFlow'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CDigitalCoupon' dc) CFloatingRateCoupon'
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)) CCoupon'
GenForeignPtr (AnyOf CDigitalCoupon' dc) CFloatingRateCoupon'
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc))
     (Base CFloatingRateCoupon')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CDigitalCoupon' dc) CFloatingRateCoupon'
 -> GenForeignPtr
      (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)) CCoupon')
-> (GenForeignPtr dc CDigitalCoupon'
    -> GenForeignPtr (AnyOf CDigitalCoupon' dc) CFloatingRateCoupon')
-> GenForeignPtr dc CDigitalCoupon'
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)) CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr dc CDigitalCoupon'
-> GenForeignPtr (AnyOf CDigitalCoupon' dc) (Base CDigitalCoupon')
GenForeignPtr dc CDigitalCoupon'
-> GenForeignPtr (AnyOf CDigitalCoupon' dc) CFloatingRateCoupon'
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
withDigitalCoupon :: GenDigitalCoupon dc -> (Ptr CDigitalCoupon' -> IO b) -> IO b
withDigitalCoupon :: forall dc b.
GenDigitalCoupon dc -> (Ptr CDigitalCoupon' -> IO b) -> IO b
withDigitalCoupon = GenForeignPtr dc CDigitalCoupon'
-> (Ptr CDigitalCoupon' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr dc CDigitalCoupon'
 -> (Ptr CDigitalCoupon' -> IO b) -> IO b)
-> (GenDigitalCoupon dc -> GenForeignPtr dc CDigitalCoupon')
-> GenDigitalCoupon dc
-> (Ptr CDigitalCoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CDigitalCoupon' dc) CFloatingRateCoupon'
-> GenForeignPtr dc CDigitalCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CDigitalCoupon' dc) CFloatingRateCoupon'
 -> GenForeignPtr dc CDigitalCoupon')
-> (GenDigitalCoupon dc
    -> GenForeignPtr (AnyOf CDigitalCoupon' dc) CFloatingRateCoupon')
-> GenDigitalCoupon dc
-> GenForeignPtr dc CDigitalCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)) CCoupon'
-> GenForeignPtr (AnyOf CDigitalCoupon' dc) CFloatingRateCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)) CCoupon'
 -> GenForeignPtr (AnyOf CDigitalCoupon' dc) CFloatingRateCoupon')
-> (GenDigitalCoupon dc
    -> GenForeignPtr
         (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)) CCoupon')
-> GenDigitalCoupon dc
-> GenForeignPtr (AnyOf CDigitalCoupon' dc) CFloatingRateCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCoupon' (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)))
  CCashFlow'
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)) CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCoupon' (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)))
   CCashFlow'
 -> GenForeignPtr
      (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)) CCoupon')
-> (GenDigitalCoupon dc
    -> GenForeignPtr
         (AnyOf
            CCoupon' (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)))
         CCashFlow')
-> GenDigitalCoupon dc
-> GenForeignPtr
     (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)) CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenDigitalCoupon dc
-> GenForeignPtr
     (AnyOf
        CCoupon' (AnyOf CFloatingRateCoupon' (AnyOf CDigitalCoupon' dc)))
     CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

-- | A range-accrual coupon is concrete for its no-optionality price helper.
data CRangeAccrualFloatersCoupon'
type CRangeAccrualFloatersCoupon = ForeignPtr CRangeAccrualFloatersCoupon'
-- |A 'FloatingRateCoupon'; see the hierarchy under t'GenCashFlow'.
type RangeAccrualFloatersCoupon = GenFloatingRateCoupon CRangeAccrualFloatersCoupon
foreign import ccall unsafe "ql.h &qlFreeRangeAccrualFloatersCoupon" qlFreeRangeAccrualFloatersCoupon :: FinalizerPtr CRangeAccrualFloatersCoupon'
instance Finalizable CRangeAccrualFloatersCoupon' where finalize :: FinalizerPtr CRangeAccrualFloatersCoupon'
finalize = FinalizerPtr CRangeAccrualFloatersCoupon'
qlFreeRangeAccrualFloatersCoupon
foreign import ccall "ql.h qlRangeAccrualFloatersCouponAsFloatingRateCoupon" qlRangeAccrualFloatersCouponAsFloatingRateCoupon :: Ptr CRangeAccrualFloatersCoupon' -> IO (Ptr CFloatingRateCoupon')
instance Upcastable CRangeAccrualFloatersCoupon' where {type Base CRangeAccrualFloatersCoupon' = CFloatingRateCoupon'; upcast :: Ptr CRangeAccrualFloatersCoupon'
-> IO (Ptr (Base CRangeAccrualFloatersCoupon'))
upcast = Ptr CRangeAccrualFloatersCoupon'
-> IO (Ptr (Base CRangeAccrualFloatersCoupon'))
Ptr CRangeAccrualFloatersCoupon' -> IO (Ptr CFloatingRateCoupon')
qlRangeAccrualFloatersCouponAsFloatingRateCoupon}
peekRangeAccrualFloatersCoupon :: Ptr CRangeAccrualFloatersCoupon' -> IO RangeAccrualFloatersCoupon
peekRangeAccrualFloatersCoupon :: Ptr CRangeAccrualFloatersCoupon' -> IO RangeAccrualFloatersCoupon
peekRangeAccrualFloatersCoupon = Ptr CRangeAccrualFloatersCoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr CRangeAccrualFloatersCoupon')
        (Base CRangeAccrualFloatersCoupon'))
Ptr CRangeAccrualFloatersCoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr CRangeAccrualFloatersCoupon') CFloatingRateCoupon')
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CRangeAccrualFloatersCoupon'
 -> IO
      (GenForeignPtr
         (ForeignPtr CRangeAccrualFloatersCoupon') CFloatingRateCoupon'))
-> (GenForeignPtr
      (ForeignPtr CRangeAccrualFloatersCoupon') CFloatingRateCoupon'
    -> IO RangeAccrualFloatersCoupon)
-> Ptr CRangeAccrualFloatersCoupon'
-> IO RangeAccrualFloatersCoupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CRangeAccrualFloatersCoupon') CFloatingRateCoupon'
-> IO RangeAccrualFloatersCoupon
forall frc.
GenForeignPtr frc CFloatingRateCoupon'
-> IO (GenFloatingRateCoupon frc)
newGenFloatingRateCoupon
withRangeAccrualFloatersCoupon :: RangeAccrualFloatersCoupon -> (Ptr CRangeAccrualFloatersCoupon' -> IO b) -> IO b
withRangeAccrualFloatersCoupon :: forall b.
RangeAccrualFloatersCoupon
-> (Ptr CRangeAccrualFloatersCoupon' -> IO b) -> IO b
withRangeAccrualFloatersCoupon = ForeignPtr CRangeAccrualFloatersCoupon'
-> (Ptr CRangeAccrualFloatersCoupon' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CRangeAccrualFloatersCoupon'
 -> (Ptr CRangeAccrualFloatersCoupon' -> IO b) -> IO b)
-> (RangeAccrualFloatersCoupon
    -> ForeignPtr CRangeAccrualFloatersCoupon')
-> RangeAccrualFloatersCoupon
-> (Ptr CRangeAccrualFloatersCoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CRangeAccrualFloatersCoupon') CFloatingRateCoupon'
-> ForeignPtr CRangeAccrualFloatersCoupon'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CRangeAccrualFloatersCoupon') CFloatingRateCoupon'
 -> ForeignPtr CRangeAccrualFloatersCoupon')
-> (RangeAccrualFloatersCoupon
    -> GenForeignPtr
         (ForeignPtr CRangeAccrualFloatersCoupon') CFloatingRateCoupon')
-> RangeAccrualFloatersCoupon
-> ForeignPtr CRangeAccrualFloatersCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CFloatingRateCoupon' (ForeignPtr CRangeAccrualFloatersCoupon'))
  CCoupon'
-> GenForeignPtr
     (ForeignPtr CRangeAccrualFloatersCoupon') CFloatingRateCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CFloatingRateCoupon' (ForeignPtr CRangeAccrualFloatersCoupon'))
   CCoupon'
 -> GenForeignPtr
      (ForeignPtr CRangeAccrualFloatersCoupon') CFloatingRateCoupon')
-> (RangeAccrualFloatersCoupon
    -> GenForeignPtr
         (AnyOf
            CFloatingRateCoupon' (ForeignPtr CRangeAccrualFloatersCoupon'))
         CCoupon')
-> RangeAccrualFloatersCoupon
-> GenForeignPtr
     (ForeignPtr CRangeAccrualFloatersCoupon') CFloatingRateCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCoupon'
     (AnyOf
        CFloatingRateCoupon' (ForeignPtr CRangeAccrualFloatersCoupon')))
  CCashFlow'
-> GenForeignPtr
     (AnyOf
        CFloatingRateCoupon' (ForeignPtr CRangeAccrualFloatersCoupon'))
     CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCoupon'
      (AnyOf
         CFloatingRateCoupon' (ForeignPtr CRangeAccrualFloatersCoupon')))
   CCashFlow'
 -> GenForeignPtr
      (AnyOf
         CFloatingRateCoupon' (ForeignPtr CRangeAccrualFloatersCoupon'))
      CCoupon')
-> (RangeAccrualFloatersCoupon
    -> GenForeignPtr
         (AnyOf
            CCoupon'
            (AnyOf
               CFloatingRateCoupon' (ForeignPtr CRangeAccrualFloatersCoupon')))
         CCashFlow')
-> RangeAccrualFloatersCoupon
-> GenForeignPtr
     (AnyOf
        CFloatingRateCoupon' (ForeignPtr CRangeAccrualFloatersCoupon'))
     CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RangeAccrualFloatersCoupon
-> GenForeignPtr
     (AnyOf
        CCoupon'
        (AnyOf
           CFloatingRateCoupon' (ForeignPtr CRangeAccrualFloatersCoupon')))
     CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

data CYoYInflationCoupon'
type CYoYInflationCoupon = ForeignPtr CYoYInflationCoupon'
-- |A 'Coupon'; see the hierarchy under t'GenCashFlow'.
type YoYInflationCoupon = GenCoupon CYoYInflationCoupon
foreign import ccall unsafe "ql.h &qlFreeYoYInflationCoupon" qlFreeYoYInflationCoupon :: FinalizerPtr CYoYInflationCoupon'
instance Finalizable CYoYInflationCoupon' where finalize :: FinalizerPtr CYoYInflationCoupon'
finalize = FinalizerPtr CYoYInflationCoupon'
qlFreeYoYInflationCoupon
foreign import ccall "ql.h qlYoYInflationCouponAsCoupon" qlYoYInflationCouponAsCoupon :: Ptr CYoYInflationCoupon' -> IO (Ptr CCoupon')
instance Upcastable CYoYInflationCoupon' where {type Base CYoYInflationCoupon' = CCoupon'; upcast :: Ptr CYoYInflationCoupon' -> IO (Ptr (Base CYoYInflationCoupon'))
upcast = Ptr CYoYInflationCoupon' -> IO (Ptr CCoupon')
Ptr CYoYInflationCoupon' -> IO (Ptr (Base CYoYInflationCoupon'))
qlYoYInflationCouponAsCoupon}
peekYoYInflationCoupon :: Ptr CYoYInflationCoupon' -> IO YoYInflationCoupon
peekYoYInflationCoupon :: Ptr CYoYInflationCoupon' -> IO YoYInflationCoupon
peekYoYInflationCoupon = Ptr CYoYInflationCoupon'
-> IO (GenForeignPtr (ForeignPtr CYoYInflationCoupon') CCoupon')
Ptr CYoYInflationCoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr CYoYInflationCoupon') (Base CYoYInflationCoupon'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CYoYInflationCoupon'
 -> IO (GenForeignPtr (ForeignPtr CYoYInflationCoupon') CCoupon'))
-> (GenForeignPtr (ForeignPtr CYoYInflationCoupon') CCoupon'
    -> IO YoYInflationCoupon)
-> Ptr CYoYInflationCoupon'
-> IO YoYInflationCoupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CYoYInflationCoupon') CCoupon'
-> IO YoYInflationCoupon
forall c. GenForeignPtr c CCoupon' -> IO (GenCoupon c)
newGenCoupon
withYoYInflationCoupon :: YoYInflationCoupon -> (Ptr CYoYInflationCoupon' -> IO b) -> IO b
withYoYInflationCoupon :: forall b.
YoYInflationCoupon -> (Ptr CYoYInflationCoupon' -> IO b) -> IO b
withYoYInflationCoupon = ForeignPtr CYoYInflationCoupon'
-> (Ptr CYoYInflationCoupon' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CYoYInflationCoupon'
 -> (Ptr CYoYInflationCoupon' -> IO b) -> IO b)
-> (YoYInflationCoupon -> ForeignPtr CYoYInflationCoupon')
-> YoYInflationCoupon
-> (Ptr CYoYInflationCoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CYoYInflationCoupon') CCoupon'
-> ForeignPtr CYoYInflationCoupon'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CYoYInflationCoupon') CCoupon'
 -> ForeignPtr CYoYInflationCoupon')
-> (YoYInflationCoupon
    -> GenForeignPtr (ForeignPtr CYoYInflationCoupon') CCoupon')
-> YoYInflationCoupon
-> ForeignPtr CYoYInflationCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CCoupon' (ForeignPtr CYoYInflationCoupon')) CCashFlow'
-> GenForeignPtr (ForeignPtr CYoYInflationCoupon') CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CCoupon' (ForeignPtr CYoYInflationCoupon')) CCashFlow'
 -> GenForeignPtr (ForeignPtr CYoYInflationCoupon') CCoupon')
-> (YoYInflationCoupon
    -> GenForeignPtr
         (AnyOf CCoupon' (ForeignPtr CYoYInflationCoupon')) CCashFlow')
-> YoYInflationCoupon
-> GenForeignPtr (ForeignPtr CYoYInflationCoupon') CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. YoYInflationCoupon
-> GenForeignPtr
     (AnyOf CCoupon' (ForeignPtr CYoYInflationCoupon')) CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

data CEquityCashFlowPricer
newtype EquityCashFlowPricer = EquityCashFlowPricer {EquityCashFlowPricer -> Standalone CEquityCashFlowPricer
getCEquityCashFlowPricer :: Standalone CEquityCashFlowPricer}
foreign import ccall unsafe "ql.h &qlFreeEquityCashFlowPricer" qlFreeEquityCashFlowPricer :: FinalizerPtr CEquityCashFlowPricer
instance Finalizable CEquityCashFlowPricer where finalize :: FinalizerPtr CEquityCashFlowPricer
finalize = FinalizerPtr CEquityCashFlowPricer
qlFreeEquityCashFlowPricer
peekEquityCashFlowPricer :: Ptr CEquityCashFlowPricer -> IO EquityCashFlowPricer
peekEquityCashFlowPricer :: Ptr CEquityCashFlowPricer -> IO EquityCashFlowPricer
peekEquityCashFlowPricer = Standalone CEquityCashFlowPricer -> EquityCashFlowPricer
EquityCashFlowPricer (Standalone CEquityCashFlowPricer -> EquityCashFlowPricer)
-> (Ptr CEquityCashFlowPricer
    -> IO (Standalone CEquityCashFlowPricer))
-> Ptr CEquityCashFlowPricer
-> IO EquityCashFlowPricer
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CEquityCashFlowPricer -> IO (Standalone CEquityCashFlowPricer)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withEquityCashFlowPricer :: EquityCashFlowPricer -> (Ptr CEquityCashFlowPricer -> IO b) -> IO b
withEquityCashFlowPricer :: forall b.
EquityCashFlowPricer -> (Ptr CEquityCashFlowPricer -> IO b) -> IO b
withEquityCashFlowPricer = Standalone CEquityCashFlowPricer
-> (Ptr CEquityCashFlowPricer -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CEquityCashFlowPricer
 -> (Ptr CEquityCashFlowPricer -> IO b) -> IO b)
-> (EquityCashFlowPricer -> Standalone CEquityCashFlowPricer)
-> EquityCashFlowPricer
-> (Ptr CEquityCashFlowPricer -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EquityCashFlowPricer -> Standalone CEquityCashFlowPricer
getCEquityCashFlowPricer

data CYoYInflationCouponPricer
-- | Pricer for capped\/floored 'QuantLib.CashFlow.yoyInflationLeg' coupons. All 3 concrete
-- upstream pricers (Black\/UnitDisplacedBlack\/Bachelier) share one ctor shape and are bound as
-- constructors of this single type, mirroring 'FloatingRateCouponPricer'\/'EquityCashFlowPricer'
-- (a standalone pricer type, not part of any @GenX@ hierarchy).
newtype YoYInflationCouponPricer = YoYInflationCouponPricer {YoYInflationCouponPricer -> Standalone CYoYInflationCouponPricer
getCYoYInflationCouponPricer :: Standalone CYoYInflationCouponPricer}
foreign import ccall unsafe "ql.h &qlFreeYoYInflationCouponPricer" qlFreeYoYInflationCouponPricer :: FinalizerPtr CYoYInflationCouponPricer
instance Finalizable CYoYInflationCouponPricer where finalize :: FinalizerPtr CYoYInflationCouponPricer
finalize = FinalizerPtr CYoYInflationCouponPricer
qlFreeYoYInflationCouponPricer
peekYoYInflationCouponPricer :: Ptr CYoYInflationCouponPricer -> IO YoYInflationCouponPricer
peekYoYInflationCouponPricer :: Ptr CYoYInflationCouponPricer -> IO YoYInflationCouponPricer
peekYoYInflationCouponPricer = Standalone CYoYInflationCouponPricer -> YoYInflationCouponPricer
YoYInflationCouponPricer (Standalone CYoYInflationCouponPricer -> YoYInflationCouponPricer)
-> (Ptr CYoYInflationCouponPricer
    -> IO (Standalone CYoYInflationCouponPricer))
-> Ptr CYoYInflationCouponPricer
-> IO YoYInflationCouponPricer
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CYoYInflationCouponPricer
-> IO (Standalone CYoYInflationCouponPricer)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withYoYInflationCouponPricer :: YoYInflationCouponPricer -> (Ptr CYoYInflationCouponPricer -> IO b) -> IO b
withYoYInflationCouponPricer :: forall b.
YoYInflationCouponPricer
-> (Ptr CYoYInflationCouponPricer -> IO b) -> IO b
withYoYInflationCouponPricer = Standalone CYoYInflationCouponPricer
-> (Ptr CYoYInflationCouponPricer -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CYoYInflationCouponPricer
 -> (Ptr CYoYInflationCouponPricer -> IO b) -> IO b)
-> (YoYInflationCouponPricer
    -> Standalone CYoYInflationCouponPricer)
-> YoYInflationCouponPricer
-> (Ptr CYoYInflationCouponPricer -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. YoYInflationCouponPricer -> Standalone CYoYInflationCouponPricer
getCYoYInflationCouponPricer

data CDefaultProbabilityHelper
newtype DefaultProbabilityHelper = DefaultProbabilityHelper {DefaultProbabilityHelper -> Standalone CDefaultProbabilityHelper
getCDefaultProbabilityHelper :: Standalone CDefaultProbabilityHelper}
foreign import ccall unsafe "ql.h &qlFreeDefaultProbabilityHelper" qlFreeDefaultProbabilityHelper :: FinalizerPtr CDefaultProbabilityHelper
instance Finalizable CDefaultProbabilityHelper where finalize :: FinalizerPtr CDefaultProbabilityHelper
finalize = FinalizerPtr CDefaultProbabilityHelper
qlFreeDefaultProbabilityHelper
peekDefaultProbabilityHelper :: Ptr CDefaultProbabilityHelper -> IO DefaultProbabilityHelper
peekDefaultProbabilityHelper :: Ptr CDefaultProbabilityHelper -> IO DefaultProbabilityHelper
peekDefaultProbabilityHelper = Standalone CDefaultProbabilityHelper -> DefaultProbabilityHelper
DefaultProbabilityHelper (Standalone CDefaultProbabilityHelper -> DefaultProbabilityHelper)
-> (Ptr CDefaultProbabilityHelper
    -> IO (Standalone CDefaultProbabilityHelper))
-> Ptr CDefaultProbabilityHelper
-> IO DefaultProbabilityHelper
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CDefaultProbabilityHelper
-> IO (Standalone CDefaultProbabilityHelper)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withDefaultProbabilityHelper :: DefaultProbabilityHelper -> (Ptr CDefaultProbabilityHelper -> IO b) -> IO b
withDefaultProbabilityHelper :: forall b.
DefaultProbabilityHelper
-> (Ptr CDefaultProbabilityHelper -> IO b) -> IO b
withDefaultProbabilityHelper = Standalone CDefaultProbabilityHelper
-> (Ptr CDefaultProbabilityHelper -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CDefaultProbabilityHelper
 -> (Ptr CDefaultProbabilityHelper -> IO b) -> IO b)
-> (DefaultProbabilityHelper
    -> Standalone CDefaultProbabilityHelper)
-> DefaultProbabilityHelper
-> (Ptr CDefaultProbabilityHelper -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DefaultProbabilityHelper -> Standalone CDefaultProbabilityHelper
getCDefaultProbabilityHelper
withDefaultProbabilityHelperArray :: [DefaultProbabilityHelper] -> ((CUInt, Ptr (Ptr CDefaultProbabilityHelper)) -> IO b) -> IO b
withDefaultProbabilityHelperArray :: forall b.
[DefaultProbabilityHelper]
-> ((CUInt, Ptr (Ptr CDefaultProbabilityHelper)) -> IO b) -> IO b
withDefaultProbabilityHelperArray = (DefaultProbabilityHelper -> Standalone CDefaultProbabilityHelper)
-> [DefaultProbabilityHelper]
-> ((CUInt, Ptr (Ptr CDefaultProbabilityHelper)) -> IO b)
-> IO b
forall t a b.
(t -> Standalone a)
-> [t] -> ((CUInt, Ptr (Ptr a)) -> IO b) -> IO b
withStandaloneArray DefaultProbabilityHelper -> Standalone CDefaultProbabilityHelper
getCDefaultProbabilityHelper

data CZeroCouponInflationSwapHelper
newtype ZeroCouponInflationSwapHelper = ZeroCouponInflationSwapHelper {ZeroCouponInflationSwapHelper
-> Standalone CZeroCouponInflationSwapHelper
getCZeroCouponInflationSwapHelper :: Standalone CZeroCouponInflationSwapHelper}
foreign import ccall unsafe "ql.h &qlFreeZeroCouponInflationSwapHelper" qlFreeZeroCouponInflationSwapHelper :: FinalizerPtr CZeroCouponInflationSwapHelper
instance Finalizable CZeroCouponInflationSwapHelper where finalize :: FinalizerPtr CZeroCouponInflationSwapHelper
finalize = FinalizerPtr CZeroCouponInflationSwapHelper
qlFreeZeroCouponInflationSwapHelper
peekZeroCouponInflationSwapHelper :: Ptr CZeroCouponInflationSwapHelper -> IO ZeroCouponInflationSwapHelper
peekZeroCouponInflationSwapHelper :: Ptr CZeroCouponInflationSwapHelper
-> IO ZeroCouponInflationSwapHelper
peekZeroCouponInflationSwapHelper = Standalone CZeroCouponInflationSwapHelper
-> ZeroCouponInflationSwapHelper
ZeroCouponInflationSwapHelper (Standalone CZeroCouponInflationSwapHelper
 -> ZeroCouponInflationSwapHelper)
-> (Ptr CZeroCouponInflationSwapHelper
    -> IO (Standalone CZeroCouponInflationSwapHelper))
-> Ptr CZeroCouponInflationSwapHelper
-> IO ZeroCouponInflationSwapHelper
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CZeroCouponInflationSwapHelper
-> IO (Standalone CZeroCouponInflationSwapHelper)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withZeroCouponInflationSwapHelper :: ZeroCouponInflationSwapHelper -> (Ptr CZeroCouponInflationSwapHelper -> IO b) -> IO b
withZeroCouponInflationSwapHelper :: forall b.
ZeroCouponInflationSwapHelper
-> (Ptr CZeroCouponInflationSwapHelper -> IO b) -> IO b
withZeroCouponInflationSwapHelper = Standalone CZeroCouponInflationSwapHelper
-> (Ptr CZeroCouponInflationSwapHelper -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CZeroCouponInflationSwapHelper
 -> (Ptr CZeroCouponInflationSwapHelper -> IO b) -> IO b)
-> (ZeroCouponInflationSwapHelper
    -> Standalone CZeroCouponInflationSwapHelper)
-> ZeroCouponInflationSwapHelper
-> (Ptr CZeroCouponInflationSwapHelper -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ZeroCouponInflationSwapHelper
-> Standalone CZeroCouponInflationSwapHelper
getCZeroCouponInflationSwapHelper
withZeroCouponInflationSwapHelperArray :: [ZeroCouponInflationSwapHelper] -> ((CUInt, Ptr (Ptr CZeroCouponInflationSwapHelper)) -> IO b) -> IO b
withZeroCouponInflationSwapHelperArray :: forall b.
[ZeroCouponInflationSwapHelper]
-> ((CUInt, Ptr (Ptr CZeroCouponInflationSwapHelper)) -> IO b)
-> IO b
withZeroCouponInflationSwapHelperArray = (ZeroCouponInflationSwapHelper
 -> Standalone CZeroCouponInflationSwapHelper)
-> [ZeroCouponInflationSwapHelper]
-> ((CUInt, Ptr (Ptr CZeroCouponInflationSwapHelper)) -> IO b)
-> IO b
forall t a b.
(t -> Standalone a)
-> [t] -> ((CUInt, Ptr (Ptr a)) -> IO b) -> IO b
withStandaloneArray ZeroCouponInflationSwapHelper
-> Standalone CZeroCouponInflationSwapHelper
getCZeroCouponInflationSwapHelper

data CYearOnYearInflationSwapHelper
newtype YearOnYearInflationSwapHelper = YearOnYearInflationSwapHelper {YearOnYearInflationSwapHelper
-> Standalone CYearOnYearInflationSwapHelper
getCYearOnYearInflationSwapHelper :: Standalone CYearOnYearInflationSwapHelper}
foreign import ccall unsafe "ql.h &qlFreeYearOnYearInflationSwapHelper" qlFreeYearOnYearInflationSwapHelper :: FinalizerPtr CYearOnYearInflationSwapHelper
instance Finalizable CYearOnYearInflationSwapHelper where finalize :: FinalizerPtr CYearOnYearInflationSwapHelper
finalize = FinalizerPtr CYearOnYearInflationSwapHelper
qlFreeYearOnYearInflationSwapHelper
peekYearOnYearInflationSwapHelper :: Ptr CYearOnYearInflationSwapHelper -> IO YearOnYearInflationSwapHelper
peekYearOnYearInflationSwapHelper :: Ptr CYearOnYearInflationSwapHelper
-> IO YearOnYearInflationSwapHelper
peekYearOnYearInflationSwapHelper = Standalone CYearOnYearInflationSwapHelper
-> YearOnYearInflationSwapHelper
YearOnYearInflationSwapHelper (Standalone CYearOnYearInflationSwapHelper
 -> YearOnYearInflationSwapHelper)
-> (Ptr CYearOnYearInflationSwapHelper
    -> IO (Standalone CYearOnYearInflationSwapHelper))
-> Ptr CYearOnYearInflationSwapHelper
-> IO YearOnYearInflationSwapHelper
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CYearOnYearInflationSwapHelper
-> IO (Standalone CYearOnYearInflationSwapHelper)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withYearOnYearInflationSwapHelper :: YearOnYearInflationSwapHelper -> (Ptr CYearOnYearInflationSwapHelper -> IO b) -> IO b
withYearOnYearInflationSwapHelper :: forall b.
YearOnYearInflationSwapHelper
-> (Ptr CYearOnYearInflationSwapHelper -> IO b) -> IO b
withYearOnYearInflationSwapHelper = Standalone CYearOnYearInflationSwapHelper
-> (Ptr CYearOnYearInflationSwapHelper -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CYearOnYearInflationSwapHelper
 -> (Ptr CYearOnYearInflationSwapHelper -> IO b) -> IO b)
-> (YearOnYearInflationSwapHelper
    -> Standalone CYearOnYearInflationSwapHelper)
-> YearOnYearInflationSwapHelper
-> (Ptr CYearOnYearInflationSwapHelper -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. YearOnYearInflationSwapHelper
-> Standalone CYearOnYearInflationSwapHelper
getCYearOnYearInflationSwapHelper
withYearOnYearInflationSwapHelperArray :: [YearOnYearInflationSwapHelper] -> ((CUInt, Ptr (Ptr CYearOnYearInflationSwapHelper)) -> IO b) -> IO b
withYearOnYearInflationSwapHelperArray :: forall b.
[YearOnYearInflationSwapHelper]
-> ((CUInt, Ptr (Ptr CYearOnYearInflationSwapHelper)) -> IO b)
-> IO b
withYearOnYearInflationSwapHelperArray = (YearOnYearInflationSwapHelper
 -> Standalone CYearOnYearInflationSwapHelper)
-> [YearOnYearInflationSwapHelper]
-> ((CUInt, Ptr (Ptr CYearOnYearInflationSwapHelper)) -> IO b)
-> IO b
forall t a b.
(t -> Standalone a)
-> [t] -> ((CUInt, Ptr (Ptr a)) -> IO b) -> IO b
withStandaloneArray YearOnYearInflationSwapHelper
-> Standalone CYearOnYearInflationSwapHelper
getCYearOnYearInflationSwapHelper

data CPathGenerator
newtype PathGenerator = PathGenerator {PathGenerator -> Standalone CPathGenerator
getCPathGenerator :: Standalone CPathGenerator}
foreign import ccall unsafe "ql.h &qlFreePathGenerator" qlFreePathGenerator :: FinalizerPtr CPathGenerator
instance Finalizable CPathGenerator where finalize :: FinalizerPtr CPathGenerator
finalize = FinalizerPtr CPathGenerator
qlFreePathGenerator
peekPathGenerator :: Ptr CPathGenerator -> IO PathGenerator
peekPathGenerator :: Ptr CPathGenerator -> IO PathGenerator
peekPathGenerator = Standalone CPathGenerator -> PathGenerator
PathGenerator (Standalone CPathGenerator -> PathGenerator)
-> (Ptr CPathGenerator -> IO (Standalone CPathGenerator))
-> Ptr CPathGenerator
-> IO PathGenerator
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CPathGenerator -> IO (Standalone CPathGenerator)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withPathGenerator :: PathGenerator -> (Ptr CPathGenerator -> IO b) -> IO b
withPathGenerator :: forall b. PathGenerator -> (Ptr CPathGenerator -> IO b) -> IO b
withPathGenerator = Standalone CPathGenerator -> (Ptr CPathGenerator -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CPathGenerator -> (Ptr CPathGenerator -> IO b) -> IO b)
-> (PathGenerator -> Standalone CPathGenerator)
-> PathGenerator
-> (Ptr CPathGenerator -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PathGenerator -> Standalone CPathGenerator
getCPathGenerator

data CSamplePath
newtype SamplePath = SamplePath {SamplePath -> Standalone CSamplePath
getCSamplePath :: Standalone CSamplePath}
foreign import ccall unsafe "ql.h &qlFreeSamplePath" qlFreeSamplePath :: FinalizerPtr CSamplePath
instance Finalizable CSamplePath where finalize :: FinalizerPtr CSamplePath
finalize = FinalizerPtr CSamplePath
qlFreeSamplePath
peekSamplePath :: Ptr CSamplePath -> IO SamplePath
peekSamplePath :: Ptr CSamplePath -> IO SamplePath
peekSamplePath = Standalone CSamplePath -> SamplePath
SamplePath (Standalone CSamplePath -> SamplePath)
-> (Ptr CSamplePath -> IO (Standalone CSamplePath))
-> Ptr CSamplePath
-> IO SamplePath
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CSamplePath -> IO (Standalone CSamplePath)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withSamplePath :: SamplePath -> (Ptr CSamplePath -> IO b) -> IO b
withSamplePath :: forall b. SamplePath -> (Ptr CSamplePath -> IO b) -> IO b
withSamplePath = Standalone CSamplePath -> (Ptr CSamplePath -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CSamplePath -> (Ptr CSamplePath -> IO b) -> IO b)
-> (SamplePath -> Standalone CSamplePath)
-> SamplePath
-> (Ptr CSamplePath -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SamplePath -> Standalone CSamplePath
getCSamplePath

-- The gaussian sequence generator a 'PathGenerator' consumes internally, exposed on its own so a
-- Haskell-defined SDE can be evolved without a per-timestep callback -- see
-- 'QuantLib.Method.gaussianRsg'. A plain standalone object like 'PathGenerator', not a hierarchy
-- root: it has no bound subtypes and is never an argument type elsewhere.
data CGaussianRsg
newtype GaussianRsg = GaussianRsg {GaussianRsg -> Standalone CGaussianRsg
getCGaussianRsg :: Standalone CGaussianRsg}
foreign import ccall unsafe "ql.h &qlFreeGaussianRsg" qlFreeGaussianRsg :: FinalizerPtr CGaussianRsg
instance Finalizable CGaussianRsg where finalize :: FinalizerPtr CGaussianRsg
finalize = FinalizerPtr CGaussianRsg
qlFreeGaussianRsg
peekGaussianRsg :: Ptr CGaussianRsg -> IO GaussianRsg
peekGaussianRsg :: Ptr CGaussianRsg -> IO GaussianRsg
peekGaussianRsg = Standalone CGaussianRsg -> GaussianRsg
GaussianRsg (Standalone CGaussianRsg -> GaussianRsg)
-> (Ptr CGaussianRsg -> IO (Standalone CGaussianRsg))
-> Ptr CGaussianRsg
-> IO GaussianRsg
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CGaussianRsg -> IO (Standalone CGaussianRsg)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withGaussianRsg :: GaussianRsg -> (Ptr CGaussianRsg -> IO b) -> IO b
withGaussianRsg :: forall b. GaussianRsg -> (Ptr CGaussianRsg -> IO b) -> IO b
withGaussianRsg = Standalone CGaussianRsg -> (Ptr CGaussianRsg -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CGaussianRsg -> (Ptr CGaussianRsg -> IO b) -> IO b)
-> (GaussianRsg -> Standalone CGaussianRsg)
-> GaussianRsg
-> (Ptr CGaussianRsg -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GaussianRsg -> Standalone CGaussianRsg
getCGaussianRsg

-- MultiCurve is enable_shared_from_this upstream ("This must be a shared pointer") and builds a
-- set of curves that form a genuine dependency cycle; bound as a standalone leaf, not part of
-- the TermStructure hierarchy (it isn't a TermStructure itself), mirroring PricingEngine above.
data CMultiCurve
newtype MultiCurve = MultiCurve {MultiCurve -> Standalone CMultiCurve
getCMultiCurve :: Standalone CMultiCurve}
foreign import ccall unsafe "ql.h &qlFreeMultiCurve" qlFreeMultiCurve :: FinalizerPtr CMultiCurve
instance Finalizable CMultiCurve where finalize :: FinalizerPtr CMultiCurve
finalize = FinalizerPtr CMultiCurve
qlFreeMultiCurve
peekMultiCurve :: Ptr CMultiCurve -> IO MultiCurve
peekMultiCurve :: Ptr CMultiCurve -> IO MultiCurve
peekMultiCurve = Standalone CMultiCurve -> MultiCurve
MultiCurve (Standalone CMultiCurve -> MultiCurve)
-> (Ptr CMultiCurve -> IO (Standalone CMultiCurve))
-> Ptr CMultiCurve
-> IO MultiCurve
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CMultiCurve -> IO (Standalone CMultiCurve)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withMultiCurve :: MultiCurve -> (Ptr CMultiCurve -> IO b) -> IO b
withMultiCurve :: forall b. MultiCurve -> (Ptr CMultiCurve -> IO b) -> IO b
withMultiCurve = Standalone CMultiCurve -> (Ptr CMultiCurve -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CMultiCurve -> (Ptr CMultiCurve -> IO b) -> IO b)
-> (MultiCurve -> Standalone CMultiCurve)
-> MultiCurve
-> (Ptr CMultiCurve -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. MultiCurve -> Standalone CMultiCurve
getCMultiCurve

-- special cases: those types will be represented as enums so no need to wrap them
data CQlClaim
type QlClaim = Standalone CQlClaim
foreign import ccall unsafe "ql.h &qlFreeClaim" qlFreeClaim :: FinalizerPtr CQlClaim
instance Finalizable CQlClaim where finalize :: FinalizerPtr CQlClaim
finalize = FinalizerPtr CQlClaim
qlFreeClaim
peekClaim :: Ptr CQlClaim -> IO (Standalone CQlClaim)
peekClaim :: Ptr CQlClaim -> IO (Standalone CQlClaim)
peekClaim = Ptr CQlClaim -> IO (Standalone CQlClaim)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone

data CQlCallability
type QlCallability = Standalone CQlCallability
foreign import ccall unsafe "ql.h &qlFreeCallability" qlFreeCallability :: FinalizerPtr CQlCallability
instance Finalizable CQlCallability where finalize :: FinalizerPtr CQlCallability
finalize = FinalizerPtr CQlCallability
qlFreeCallability
peekCallability :: Ptr CQlCallability -> IO (Standalone CQlCallability)
peekCallability :: Ptr CQlCallability -> IO (Standalone CQlCallability)
peekCallability = Ptr CQlCallability -> IO (Standalone CQlCallability)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone

data CConstraint
type QlConstraint = Standalone CConstraint
foreign import ccall unsafe "ql.h &qlFreeConstraint" qlFreeConstraint :: FinalizerPtr CConstraint
instance Finalizable CConstraint where finalize :: FinalizerPtr CConstraint
finalize = FinalizerPtr CConstraint
qlFreeConstraint
peekConstraint :: Ptr CConstraint -> IO (Standalone CConstraint)
peekConstraint :: Ptr CConstraint -> IO (Standalone CConstraint)
peekConstraint = Ptr CConstraint -> IO (Standalone CConstraint)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone

data CEndCriteria
type QlEndCriteria = Standalone CEndCriteria
foreign import ccall unsafe "ql.h &qlFreeEndCriteria" qlFreeEndCriteria :: FinalizerPtr CEndCriteria
instance Finalizable CEndCriteria where finalize :: FinalizerPtr CEndCriteria
finalize = FinalizerPtr CEndCriteria
qlFreeEndCriteria
peekEndCriteria :: Ptr CEndCriteria -> IO (Standalone CEndCriteria)
peekEndCriteria :: Ptr CEndCriteria -> IO (Standalone CEndCriteria)
peekEndCriteria = Ptr CEndCriteria -> IO (Standalone CEndCriteria)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone

data CFdmSchemeDesc
type QlFdmSchemeDesc = Standalone CFdmSchemeDesc
foreign import ccall unsafe "ql.h &qlFreeFdmSchemeDesc" qlFreeFdmSchemeDesc :: FinalizerPtr CFdmSchemeDesc
instance Finalizable CFdmSchemeDesc where finalize :: FinalizerPtr CFdmSchemeDesc
finalize = FinalizerPtr CFdmSchemeDesc
qlFreeFdmSchemeDesc
peekFdmSchemeDesc :: Ptr CFdmSchemeDesc -> IO (Standalone CFdmSchemeDesc)
peekFdmSchemeDesc :: Ptr CFdmSchemeDesc -> IO (Standalone CFdmSchemeDesc)
peekFdmSchemeDesc = Ptr CFdmSchemeDesc -> IO (Standalone CFdmSchemeDesc)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone

data CFittedBondDiscountCurveFittingMethod
type QlFittedBondDiscountCurveFittingMethod = Standalone CFittedBondDiscountCurveFittingMethod
foreign import ccall unsafe "ql.h &qlFreeFittedBondDiscountCurveFittingMethod" qlFreeFittedBondDiscountCurveFittingMethod :: FinalizerPtr CFittedBondDiscountCurveFittingMethod
instance Finalizable CFittedBondDiscountCurveFittingMethod where finalize :: FinalizerPtr CFittedBondDiscountCurveFittingMethod
finalize = FinalizerPtr CFittedBondDiscountCurveFittingMethod
qlFreeFittedBondDiscountCurveFittingMethod
peekFittedBondDiscountCurveFittingMethod :: Ptr CFittedBondDiscountCurveFittingMethod -> IO (Standalone CFittedBondDiscountCurveFittingMethod)
peekFittedBondDiscountCurveFittingMethod :: Ptr CFittedBondDiscountCurveFittingMethod
-> IO (Standalone CFittedBondDiscountCurveFittingMethod)
peekFittedBondDiscountCurveFittingMethod = Ptr CFittedBondDiscountCurveFittingMethod
-> IO (Standalone CFittedBondDiscountCurveFittingMethod)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone

data COptimizationMethod
type QlOptimizationMethod = Standalone COptimizationMethod
foreign import ccall unsafe "ql.h &qlFreeOptimizationMethod" qlFreeOptimizationMethod :: FinalizerPtr COptimizationMethod
instance Finalizable COptimizationMethod where finalize :: FinalizerPtr COptimizationMethod
finalize = FinalizerPtr COptimizationMethod
qlFreeOptimizationMethod
peekOptimizationMethod :: Ptr COptimizationMethod -> IO (Standalone COptimizationMethod)
peekOptimizationMethod :: Ptr COptimizationMethod -> IO (Standalone COptimizationMethod)
peekOptimizationMethod = Ptr COptimizationMethod -> IO (Standalone COptimizationMethod)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone

data CRounding
type QlRounding = Standalone CRounding
foreign import ccall unsafe "ql.h &qlFreeRounding" qlFreeRounding :: FinalizerPtr CRounding
instance Finalizable CRounding where finalize :: FinalizerPtr CRounding
finalize = FinalizerPtr CRounding
qlFreeRounding
peekRounding :: Ptr CRounding -> IO (Standalone CRounding)
peekRounding :: Ptr CRounding -> IO (Standalone CRounding)
peekRounding = Ptr CRounding -> IO (Standalone CRounding)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone

data CLmCorrelationModel
type QlLmCorrelationModel = Standalone CLmCorrelationModel
foreign import ccall unsafe "ql.h &qlFreeLmCorrelationModel" qlFreeLmCorrelationModel :: FinalizerPtr CLmCorrelationModel
instance Finalizable CLmCorrelationModel where finalize :: FinalizerPtr CLmCorrelationModel
finalize = FinalizerPtr CLmCorrelationModel
qlFreeLmCorrelationModel
peekLmCorrelationModel :: Ptr CLmCorrelationModel -> IO (Standalone CLmCorrelationModel)
peekLmCorrelationModel :: Ptr CLmCorrelationModel -> IO (Standalone CLmCorrelationModel)
peekLmCorrelationModel = Ptr CLmCorrelationModel -> IO (Standalone CLmCorrelationModel)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone

data CLmVolatilityModel
type QlLmVolatilityModel = Standalone CLmVolatilityModel
foreign import ccall unsafe "ql.h &qlFreeLmVolatilityModel" qlFreeLmVolatilityModel :: FinalizerPtr CLmVolatilityModel
instance Finalizable CLmVolatilityModel where finalize :: FinalizerPtr CLmVolatilityModel
finalize = FinalizerPtr CLmVolatilityModel
qlFreeLmVolatilityModel
peekLmVolatilityModel :: Ptr CLmVolatilityModel -> IO (Standalone CLmVolatilityModel)
peekLmVolatilityModel :: Ptr CLmVolatilityModel -> IO (Standalone CLmVolatilityModel)
peekLmVolatilityModel = Ptr CLmVolatilityModel -> IO (Standalone CLmVolatilityModel)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone

data CLfmHullWhiteParameterization
type QlLfmHullWhiteParameterization = Standalone CLfmHullWhiteParameterization
type LfmHullWhiteParameterization = QlLfmHullWhiteParameterization
foreign import ccall unsafe "ql.h &qlFreeLfmHullWhiteParameterization" qlFreeLfmHullWhiteParameterization :: FinalizerPtr CLfmHullWhiteParameterization
instance Finalizable CLfmHullWhiteParameterization where finalize :: FinalizerPtr CLfmHullWhiteParameterization
finalize = FinalizerPtr CLfmHullWhiteParameterization
qlFreeLfmHullWhiteParameterization
peekLfmHullWhiteParameterization :: Ptr CLfmHullWhiteParameterization -> IO (Standalone CLfmHullWhiteParameterization)
peekLfmHullWhiteParameterization :: Ptr CLfmHullWhiteParameterization
-> IO (Standalone CLfmHullWhiteParameterization)
peekLfmHullWhiteParameterization = Ptr CLfmHullWhiteParameterization
-> IO (Standalone CLfmHullWhiteParameterization)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone

-- TYPE HIERARCHIES
--
-- Each hierarchy root below carries a haddock tree listing every member. Notation:
--   indentation  parent/child
--   `X*'         abstract *here*: hasquant binds no constructor returning an X, you only
--                obtain one by upcasting. This is not the same as C++ abstractness and
--                cannot be derived from it -- Option and Swap are concrete classes
--                upstream but unconstructible here, while Quote/Index/TermStructure are
--                pure-virtual upstream yet routinely returned by bindings. Marks are
--                added where established; an unmarked node is not a claim of the opposite.
--   `X + Y'      X also reaches secondary interface Y, via the standalone qlXAsY shim,
--                materialized eagerly into a `Standalone Y' value by a per-leaf `xAsY'
--                function (see CAffineModel' below), not via Upcastable.
--   X (CFoo')    X's C type, given only where it is not the expected C<X>'.
-- Payoff and Exercise are documented in the files that define them, not here.
-- the original pointer to `a' with a way to marshal it to `b'
-- The access/free pair IS derivable from the structure of `a' (each nested AnyOf layer is
-- one upcast; the innermost ForeignPtr is identity or one upcast). It stays a stored
-- dictionary because the alternative -- an `Access a b' class -- becomes a constraint at
-- every polymorphic use site, and c2hs emits an explicit signature for every {#fun#}: 363
-- of 880 hooks take a polymorphic `GenX a' and would each need a hand-written context,
-- which would also leak into public API signatures. It buys no correctness -- the smart
-- constructors below are already pinned by their result types.
data GenForeignPtr a b = GenForeignPtr {
  forall a b. GenForeignPtr a b -> a
ptr :: !a
  , forall a b.
GenForeignPtr a b -> forall r. a -> (Ptr b -> IO r) -> IO r
_access :: !(forall r. a -> (Ptr b -> IO r) -> IO r)
  , forall a b. GenForeignPtr a b -> Maybe (Ptr b -> IO ())
_mayFree :: !(Maybe (Ptr b -> IO ())) -- `free' after upcast is needed
}

freeUpcast :: Finalizable b => Ptr b -> IO ()
freeUpcast :: forall b. Finalizable b => Ptr b -> IO ()
freeUpcast = FinalizerPtr b -> Ptr b -> IO ()
forall a. FinalizerPtr a -> Ptr a -> IO ()
callFinalizer FinalizerPtr b
forall a. Finalizable a => FinalizerPtr a
finalize

newtype AnyOf b a = AnyOf { forall b a. AnyOf b a -> GenForeignPtr a b
getAnyOf :: GenForeignPtr a b }
newAnyOf :: (Upcastable b, Finalizable (Base b)) => GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf :: forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf GenForeignPtr a b
x = AnyOf b a
-> (forall r. AnyOf b a -> (Ptr (Base b) -> IO r) -> IO r)
-> Maybe (Ptr (Base b) -> IO ())
-> GenForeignPtr (AnyOf b a) (Base b)
forall a b.
a
-> (forall r. a -> (Ptr b -> IO r) -> IO r)
-> Maybe (Ptr b -> IO ())
-> GenForeignPtr a b
GenForeignPtr (GenForeignPtr a b -> AnyOf b a
forall b a. GenForeignPtr a b -> AnyOf b a
AnyOf GenForeignPtr a b
x)
  (\(AnyOf GenForeignPtr a b
i) Ptr (Base b) -> IO r
f -> GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr GenForeignPtr a b
i (Ptr b -> IO (Ptr (Base b))
forall a. Upcastable a => Ptr a -> IO (Ptr (Base a))
upcast (Ptr b -> IO (Ptr (Base b)))
-> (Ptr (Base b) -> IO r) -> Ptr b -> IO r
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> Ptr (Base b) -> IO r
f))
  ((Ptr (Base b) -> IO ()) -> Maybe (Ptr (Base b) -> IO ())
forall a. a -> Maybe a
Just Ptr (Base b) -> IO ()
forall b. Finalizable b => Ptr b -> IO ()
freeUpcast)

class Upcastable a where
  type Base a
  upcast :: Ptr a -> IO (Ptr (Base a))

newGenForeignPtr :: (Finalizable a, Upcastable a, Finalizable (Base a)) => Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr :: forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr Ptr a
x = do
  fp <- FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FinalizerPtr a
forall a. Finalizable a => FinalizerPtr a
finalize Ptr a
x
  pure $ GenForeignPtr fp (\ForeignPtr a
a Ptr (Base a) -> IO r
f -> ForeignPtr a -> (Ptr a -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr a
a (Ptr a -> IO (Ptr (Base a))
forall a. Upcastable a => Ptr a -> IO (Ptr (Base a))
upcast (Ptr a -> IO (Ptr (Base a)))
-> (Ptr (Base a) -> IO r) -> Ptr a -> IO r
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> Ptr (Base a) -> IO r
f)) (Just freeUpcast)

newCastForeignPtr :: Finalizable a => Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr :: forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr Ptr a
x = do
  fp <- FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
forall a. FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
newForeignPtr FinalizerPtr a
forall a. Finalizable a => FinalizerPtr a
finalize Ptr a
x
  pure $ GenForeignPtr fp withForeignPtr Nothing

-- `access' performs the upcast, which allocates a fresh handle that `mfree' must release, so
-- acquiring it and installing the handler have to be atomic -- `mask' covers the upcast
-- happening inside `access', and `restore' hands `f' back the caller's masking state. This
-- is `bracket' semantics expressed around a continuation that
-- allocates internally. Nesting is fine: an inner level's `restore' only wraps the
-- continuation that contains the outer `restore', so `f' still runs unmasked.
withGenForeignPtr :: GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr :: forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr a
p forall r. a -> (Ptr b -> IO r) -> IO r
access Maybe (Ptr b -> IO ())
Nothing) Ptr b -> IO r
f = a -> (Ptr b -> IO r) -> IO r
forall r. a -> (Ptr b -> IO r) -> IO r
access a
p Ptr b -> IO r
f
withGenForeignPtr (GenForeignPtr a
p forall r. a -> (Ptr b -> IO r) -> IO r
access (Just Ptr b -> IO ()
free)) Ptr b -> IO r
f =
  ((forall a. IO a -> IO a) -> IO r) -> IO r
forall b. ((forall a. IO a -> IO a) -> IO b) -> IO b
mask (((forall a. IO a -> IO a) -> IO r) -> IO r)
-> ((forall a. IO a -> IO a) -> IO r) -> IO r
forall a b. (a -> b) -> a -> b
$ \forall a. IO a -> IO a
restore -> a -> (Ptr b -> IO r) -> IO r
forall r. a -> (Ptr b -> IO r) -> IO r
access a
p ((Ptr b -> IO r) -> IO r) -> (Ptr b -> IO r) -> IO r
forall a b. (a -> b) -> a -> b
$ \Ptr b
bp -> IO r -> IO r
forall a. IO a -> IO a
restore (Ptr b -> IO r
f Ptr b
bp) IO r -> IO () -> IO r
forall a b. IO a -> IO b -> IO a
`finally` Ptr b -> IO ()
free Ptr b
bp

transferGenForeignPtr :: (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr :: forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr b -> IO r
f (GenForeignPtr a
p forall r. a -> (Ptr b -> IO r) -> IO r
access Maybe (Ptr b -> IO ())
_) = a -> (Ptr b -> IO r) -> IO r
forall r. a -> (Ptr b -> IO r) -> IO r
access a
p Ptr b -> IO r
f

withGenArray :: (a -> (Ptr c -> IO r) -> IO r) -> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray :: forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray a -> (Ptr c -> IO r) -> IO r
m [a]
x (CUInt, Ptr (Ptr c)) -> IO r
f = (a -> (Ptr c -> IO r) -> IO r) -> [a] -> ([Ptr c] -> IO r) -> IO r
forall a b res.
(a -> (b -> res) -> res) -> [a] -> ([b] -> res) -> res
withMany a -> (Ptr c -> IO r) -> IO r
m [a]
x ([Ptr c] -> (Ptr (Ptr c) -> IO r) -> IO r
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
`withArray` (\Ptr (Ptr c)
p -> (CUInt, Ptr (Ptr c)) -> IO r
f (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> Int -> CUInt
forall a b. (a -> b) -> a -> b
$ [a] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [a]
x, Ptr (Ptr c)
p)))

peel :: GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel :: forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel = AnyOf b a -> GenForeignPtr a b
forall b a. AnyOf b a -> GenForeignPtr a b
getAnyOf (AnyOf b a -> GenForeignPtr a b)
-> (GenForeignPtr (AnyOf b a) c -> AnyOf b a)
-> GenForeignPtr (AnyOf b a) c
-> GenForeignPtr a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf b a) c -> AnyOf b a
forall a b. GenForeignPtr a b -> a
ptr

-- |Arrays of 'CommodityType'\/'UnitOfMeasure' values, first needed by 'QuantLib.Instrument.Energy'
-- for marshalling a 'QuantLib.Commodity.PricingPeriods' list to\/from its C-side
-- structure-of-parallel-arrays representation (@Quantity@'s @CommodityType@\/@UnitOfMeasure@
-- component, split out one array per field, alongside 'QuantLib.Internal.withDayArray'\/'peekDayArray'
-- for the date fields and 'QuantLib.Internal.withDoubleArray'\/'peekDoubleArray' for the amount) --
-- reusing 'withGenArray'\/'peekPtrArray' exactly as 'withBlackCalibrationHelperArray' does.
withCommodityTypeArray :: [CommodityType] -> ((CUInt, Ptr (Ptr CCommodityType)) -> IO b) -> IO b
withCommodityTypeArray :: forall b.
[CommodityType]
-> ((CUInt, Ptr (Ptr CCommodityType)) -> IO b) -> IO b
withCommodityTypeArray = (CommodityType -> (Ptr CCommodityType -> IO b) -> IO b)
-> [CommodityType]
-> ((CUInt, Ptr (Ptr CCommodityType)) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray CommodityType -> (Ptr CCommodityType -> IO b) -> IO b
forall b. CommodityType -> (Ptr CCommodityType -> IO b) -> IO b
withCommodityType
-- |Output side, first needed by 'QuantLib.Instrument.Energy.createPricingPeriods' (the only
-- producer of a fresh 'QuantLib.Commodity.PricingPeriods' list -- every constructor instead
-- *consumes* one via 'withCommodityTypeArray').
peekCommodityTypeArray :: Ptr CUInt -> Ptr (Ptr (Ptr CCommodityType)) -> IO [CommodityType]
peekCommodityTypeArray :: Ptr CUInt -> Ptr (Ptr (Ptr CCommodityType)) -> IO [CommodityType]
peekCommodityTypeArray = (Ptr CCommodityType -> IO CommodityType)
-> Ptr CUInt
-> Ptr (Ptr (Ptr CCommodityType))
-> IO [CommodityType]
forall a b.
(Ptr a -> IO b) -> Ptr CUInt -> Ptr (Ptr (Ptr a)) -> IO [b]
peekPtrArray Ptr CCommodityType -> IO CommodityType
peekCommodityType

withUnitOfMeasureArray :: [UnitOfMeasure] -> ((CUInt, Ptr (Ptr CUnitOfMeasure)) -> IO b) -> IO b
withUnitOfMeasureArray :: forall b.
[UnitOfMeasure]
-> ((CUInt, Ptr (Ptr CUnitOfMeasure)) -> IO b) -> IO b
withUnitOfMeasureArray = (UnitOfMeasure -> (Ptr CUnitOfMeasure -> IO b) -> IO b)
-> [UnitOfMeasure]
-> ((CUInt, Ptr (Ptr CUnitOfMeasure)) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray UnitOfMeasure -> (Ptr CUnitOfMeasure -> IO b) -> IO b
forall b. UnitOfMeasure -> (Ptr CUnitOfMeasure -> IO b) -> IO b
withUnitOfMeasure
peekUnitOfMeasureArray :: Ptr CUInt -> Ptr (Ptr (Ptr CUnitOfMeasure)) -> IO [UnitOfMeasure]
peekUnitOfMeasureArray :: Ptr CUInt -> Ptr (Ptr (Ptr CUnitOfMeasure)) -> IO [UnitOfMeasure]
peekUnitOfMeasureArray = (Ptr CUnitOfMeasure -> IO UnitOfMeasure)
-> Ptr CUInt
-> Ptr (Ptr (Ptr CUnitOfMeasure))
-> IO [UnitOfMeasure]
forall a b.
(Ptr a -> IO b) -> Ptr CUInt -> Ptr (Ptr (Ptr a)) -> IO [b]
peekPtrArray Ptr CUnitOfMeasure -> IO UnitOfMeasure
peekUnitOfMeasure

-- |A nullable-per-entry array of 'UnitOfMeasure's -- @SecondaryCosts@' per-entry unit of measure,
-- present only for its @CommodityUnitCost@ alternative (null for its @Money@ alternative).
withMaybeUnitOfMeasureArray :: [Maybe UnitOfMeasure] -> ((CUInt, Ptr (Ptr CUnitOfMeasure)) -> IO b) -> IO b
withMaybeUnitOfMeasureArray :: forall b.
[Maybe UnitOfMeasure]
-> ((CUInt, Ptr (Ptr CUnitOfMeasure)) -> IO b) -> IO b
withMaybeUnitOfMeasureArray = (Maybe UnitOfMeasure -> (Ptr CUnitOfMeasure -> IO b) -> IO b)
-> [Maybe UnitOfMeasure]
-> ((CUInt, Ptr (Ptr CUnitOfMeasure)) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray Maybe UnitOfMeasure -> (Ptr CUnitOfMeasure -> IO b) -> IO b
forall b.
Maybe UnitOfMeasure -> (Ptr CUnitOfMeasure -> IO b) -> IO b
withMaybeUnitOfMeasure

-- |An array of 'Currency' values -- @SecondaryCosts@'\/@SecondaryCostAmounts@'s per-entry currency.
withCurrencyArray :: [Currency] -> ((CUInt, Ptr (Ptr CCurrency)) -> IO b) -> IO b
withCurrencyArray :: forall b.
[Currency] -> ((CUInt, Ptr (Ptr CCurrency)) -> IO b) -> IO b
withCurrencyArray = (Currency -> (Ptr CCurrency -> IO b) -> IO b)
-> [Currency] -> ((CUInt, Ptr (Ptr CCurrency)) -> IO b) -> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray Currency -> (Ptr CCurrency -> IO b) -> IO b
forall b. Currency -> (Ptr CCurrency -> IO b) -> IO b
withCurrency
peekCurrencyArray :: Ptr CUInt -> Ptr (Ptr (Ptr CCurrency)) -> IO [Currency]
peekCurrencyArray :: Ptr CUInt -> Ptr (Ptr (Ptr CCurrency)) -> IO [Currency]
peekCurrencyArray = (Ptr CCurrency -> IO Currency)
-> Ptr CUInt -> Ptr (Ptr (Ptr CCurrency)) -> IO [Currency]
forall a b.
(Ptr a -> IO b) -> Ptr CUInt -> Ptr (Ptr (Ptr a)) -> IO [b]
peekPtrArray Ptr CCurrency -> IO Currency
peekCurrency

-- |The root of the hierarchy shown under t'GenQuote'.
type Quote = GenQuote CQuote
data CQuote'
data CSimpleQuote'
data CDeltaVolQuote'
data CFuturesConvAdjustmentQuote'
data CRelinkableQuote'
-- | > Quote
-- >   SimpleQuote
-- >   DeltaVolQuote
-- >   FuturesConvAdjustmentQuote
-- >   RelinkableQuote
newtype GenQuote q = GenQuote {forall q. GenQuote q -> GenForeignPtr q CQuote'
getQuote :: GenForeignPtr q CQuote'}
type CQuote = ForeignPtr CQuote'
type CSimpleQuote = ForeignPtr CSimpleQuote'
-- |A 'Quote'; see the hierarchy under t'GenQuote'.
type SimpleQuote = GenQuote CSimpleQuote
type CDeltaVolQuote = ForeignPtr CDeltaVolQuote'
-- |A 'Quote'; see the hierarchy under t'GenQuote'.
type DeltaVolQuote = GenQuote CDeltaVolQuote
type CFuturesConvAdjustmentQuote = ForeignPtr CFuturesConvAdjustmentQuote'
-- |A 'Quote'; see the hierarchy under t'GenQuote'.
type FuturesConvAdjustmentQuote = GenQuote CFuturesConvAdjustmentQuote
type CRelinkableQuote = ForeignPtr CRelinkableQuote'
-- |A 'Quote'; see the hierarchy under t'GenQuote'.
type RelinkableQuote = GenQuote CRelinkableQuote
foreign import ccall unsafe "ql.h &qlFreeQuote" qlFreeQuote :: FinalizerPtr CQuote'
foreign import ccall unsafe "ql.h &qlFreeSimpleQuote" qlFreeSimpleQuote :: FinalizerPtr CSimpleQuote'
foreign import ccall unsafe "ql.h &qlFreeDeltaVolQuote" qlFreeDeltaVolQuote :: FinalizerPtr CDeltaVolQuote'
foreign import ccall unsafe "ql.h &qlFreeFuturesConvAdjustmentQuote" qlFreeFuturesConvAdjustmentQuote :: FinalizerPtr CFuturesConvAdjustmentQuote'
foreign import ccall unsafe "ql.h &qlFreeRelinkableQuote" qlFreeRelinkableQuote :: FinalizerPtr CRelinkableQuote'
instance Finalizable CQuote' where finalize :: FinalizerPtr CQuote'
finalize = FinalizerPtr CQuote'
qlFreeQuote
instance Finalizable CSimpleQuote' where finalize :: FinalizerPtr CSimpleQuote'
finalize = FinalizerPtr CSimpleQuote'
qlFreeSimpleQuote
instance Finalizable CDeltaVolQuote' where finalize :: FinalizerPtr CDeltaVolQuote'
finalize = FinalizerPtr CDeltaVolQuote'
qlFreeDeltaVolQuote
instance Finalizable CFuturesConvAdjustmentQuote' where finalize :: FinalizerPtr CFuturesConvAdjustmentQuote'
finalize = FinalizerPtr CFuturesConvAdjustmentQuote'
qlFreeFuturesConvAdjustmentQuote
instance Finalizable CRelinkableQuote' where finalize :: FinalizerPtr CRelinkableQuote'
finalize = FinalizerPtr CRelinkableQuote'
qlFreeRelinkableQuote
instance Upcastable CSimpleQuote' where {type Base CSimpleQuote' = CQuote'; upcast :: Ptr CSimpleQuote' -> IO (Ptr (Base CSimpleQuote'))
upcast = Ptr CSimpleQuote' -> IO (Ptr CQuote')
Ptr CSimpleQuote' -> IO (Ptr (Base CSimpleQuote'))
qlSimpleQuoteAsQuote}
instance Upcastable CDeltaVolQuote' where {type Base CDeltaVolQuote' = CQuote'; upcast :: Ptr CDeltaVolQuote' -> IO (Ptr (Base CDeltaVolQuote'))
upcast = Ptr CDeltaVolQuote' -> IO (Ptr CQuote')
Ptr CDeltaVolQuote' -> IO (Ptr (Base CDeltaVolQuote'))
qlDeltaVolQuoteAsQuote}
instance Upcastable CFuturesConvAdjustmentQuote' where {type Base CFuturesConvAdjustmentQuote' = CQuote'; upcast :: Ptr CFuturesConvAdjustmentQuote'
-> IO (Ptr (Base CFuturesConvAdjustmentQuote'))
upcast = Ptr CFuturesConvAdjustmentQuote' -> IO (Ptr CQuote')
Ptr CFuturesConvAdjustmentQuote'
-> IO (Ptr (Base CFuturesConvAdjustmentQuote'))
qlFuturesConvAdjustmentQuoteAsQuote}
instance Upcastable CRelinkableQuote' where {type Base CRelinkableQuote' = CQuote'; upcast :: Ptr CRelinkableQuote' -> IO (Ptr (Base CRelinkableQuote'))
upcast = Ptr CRelinkableQuote' -> IO (Ptr CQuote')
Ptr CRelinkableQuote' -> IO (Ptr (Base CRelinkableQuote'))
qlRelinkableQuoteAsQuote}
foreign import ccall "ql.h qlSimpleQuoteAsQuote" qlSimpleQuoteAsQuote :: Ptr CSimpleQuote' -> IO (Ptr CQuote')
foreign import ccall "ql.h qlDeltaVolQuoteAsQuote" qlDeltaVolQuoteAsQuote :: Ptr CDeltaVolQuote' -> IO (Ptr CQuote')
foreign import ccall "ql.h qlFuturesConvAdjustmentQuoteAsQuote" qlFuturesConvAdjustmentQuoteAsQuote :: Ptr CFuturesConvAdjustmentQuote' -> IO (Ptr CQuote')
foreign import ccall "ql.h qlRelinkableQuoteAsQuote" qlRelinkableQuoteAsQuote :: Ptr CRelinkableQuote' -> IO (Ptr CQuote')
-- Haskell does not allow function arguments like [forall q.GenQuote q]
-- let's at least provide a way to convert all quote classes to the most generic one
asQuote :: GenQuote q -> IO Quote
asQuote :: forall q. GenQuote q -> IO Quote
asQuote = (Ptr CQuote' -> IO Quote) -> GenForeignPtr q CQuote' -> IO Quote
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CQuote' -> IO Quote
peekQuote (GenForeignPtr q CQuote' -> IO Quote)
-> (GenQuote q -> GenForeignPtr q CQuote')
-> GenQuote q
-> IO Quote
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenQuote q -> GenForeignPtr q CQuote'
forall q. GenQuote q -> GenForeignPtr q CQuote'
getQuote
peekQuote :: Ptr CQuote' -> IO Quote
peekQuote :: Ptr CQuote' -> IO Quote
peekQuote = GenForeignPtr CQuote CQuote' -> Quote
forall q. GenForeignPtr q CQuote' -> GenQuote q
GenQuote (GenForeignPtr CQuote CQuote' -> Quote)
-> (Ptr CQuote' -> IO (GenForeignPtr CQuote CQuote'))
-> Ptr CQuote'
-> IO Quote
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CQuote' -> IO (GenForeignPtr CQuote CQuote')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr
withQuote :: GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote :: forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote = GenForeignPtr q CQuote' -> (Ptr CQuote' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr q CQuote' -> (Ptr CQuote' -> IO b) -> IO b)
-> (GenQuote q -> GenForeignPtr q CQuote')
-> GenQuote q
-> (Ptr CQuote' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenQuote q -> GenForeignPtr q CQuote'
forall q. GenQuote q -> GenForeignPtr q CQuote'
getQuote
withGenQuote :: GenQuote (ForeignPtr q) -> (Ptr q -> IO b) -> IO b
withGenQuote :: forall q b. GenQuote (ForeignPtr q) -> (Ptr q -> IO b) -> IO b
withGenQuote = ForeignPtr q -> (Ptr q -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr q -> (Ptr q -> IO b) -> IO b)
-> (GenQuote (ForeignPtr q) -> ForeignPtr q)
-> GenQuote (ForeignPtr q)
-> (Ptr q -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr q) CQuote' -> ForeignPtr q
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr q) CQuote' -> ForeignPtr q)
-> (GenQuote (ForeignPtr q)
    -> GenForeignPtr (ForeignPtr q) CQuote')
-> GenQuote (ForeignPtr q)
-> ForeignPtr q
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenQuote (ForeignPtr q) -> GenForeignPtr (ForeignPtr q) CQuote'
forall q. GenQuote q -> GenForeignPtr q CQuote'
getQuote
peekSimpleQuote :: Ptr CSimpleQuote' -> IO SimpleQuote
peekSimpleQuote :: Ptr CSimpleQuote' -> IO SimpleQuote
peekSimpleQuote = GenForeignPtr CSimpleQuote CQuote' -> SimpleQuote
forall q. GenForeignPtr q CQuote' -> GenQuote q
GenQuote (GenForeignPtr CSimpleQuote CQuote' -> SimpleQuote)
-> (Ptr CSimpleQuote' -> IO (GenForeignPtr CSimpleQuote CQuote'))
-> Ptr CSimpleQuote'
-> IO SimpleQuote
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CSimpleQuote' -> IO (GenForeignPtr CSimpleQuote CQuote')
Ptr CSimpleQuote'
-> IO (GenForeignPtr CSimpleQuote (Base CSimpleQuote'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekDeltaVolQuote :: Ptr CDeltaVolQuote' -> IO DeltaVolQuote
peekDeltaVolQuote :: Ptr CDeltaVolQuote' -> IO DeltaVolQuote
peekDeltaVolQuote = GenForeignPtr CDeltaVolQuote CQuote' -> DeltaVolQuote
forall q. GenForeignPtr q CQuote' -> GenQuote q
GenQuote (GenForeignPtr CDeltaVolQuote CQuote' -> DeltaVolQuote)
-> (Ptr CDeltaVolQuote'
    -> IO (GenForeignPtr CDeltaVolQuote CQuote'))
-> Ptr CDeltaVolQuote'
-> IO DeltaVolQuote
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CDeltaVolQuote' -> IO (GenForeignPtr CDeltaVolQuote CQuote')
Ptr CDeltaVolQuote'
-> IO (GenForeignPtr CDeltaVolQuote (Base CDeltaVolQuote'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekFuturesConvAdjustmentQuote :: Ptr CFuturesConvAdjustmentQuote' -> IO FuturesConvAdjustmentQuote
peekFuturesConvAdjustmentQuote :: Ptr CFuturesConvAdjustmentQuote' -> IO FuturesConvAdjustmentQuote
peekFuturesConvAdjustmentQuote = GenForeignPtr CFuturesConvAdjustmentQuote CQuote'
-> FuturesConvAdjustmentQuote
forall q. GenForeignPtr q CQuote' -> GenQuote q
GenQuote (GenForeignPtr CFuturesConvAdjustmentQuote CQuote'
 -> FuturesConvAdjustmentQuote)
-> (Ptr CFuturesConvAdjustmentQuote'
    -> IO (GenForeignPtr CFuturesConvAdjustmentQuote CQuote'))
-> Ptr CFuturesConvAdjustmentQuote'
-> IO FuturesConvAdjustmentQuote
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CFuturesConvAdjustmentQuote'
-> IO (GenForeignPtr CFuturesConvAdjustmentQuote CQuote')
Ptr CFuturesConvAdjustmentQuote'
-> IO
     (GenForeignPtr
        CFuturesConvAdjustmentQuote (Base CFuturesConvAdjustmentQuote'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekRelinkableQuote :: Ptr CRelinkableQuote' -> IO RelinkableQuote
peekRelinkableQuote :: Ptr CRelinkableQuote' -> IO RelinkableQuote
peekRelinkableQuote = GenForeignPtr CRelinkableQuote CQuote' -> RelinkableQuote
forall q. GenForeignPtr q CQuote' -> GenQuote q
GenQuote (GenForeignPtr CRelinkableQuote CQuote' -> RelinkableQuote)
-> (Ptr CRelinkableQuote'
    -> IO (GenForeignPtr CRelinkableQuote CQuote'))
-> Ptr CRelinkableQuote'
-> IO RelinkableQuote
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CRelinkableQuote'
-> IO (GenForeignPtr CRelinkableQuote CQuote')
Ptr CRelinkableQuote'
-> IO (GenForeignPtr CRelinkableQuote (Base CRelinkableQuote'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
withRelinkableQuote :: RelinkableQuote -> (Ptr CRelinkableQuote' -> IO b) -> IO b
withRelinkableQuote :: forall b.
RelinkableQuote -> (Ptr CRelinkableQuote' -> IO b) -> IO b
withRelinkableQuote = RelinkableQuote -> (Ptr CRelinkableQuote' -> IO b) -> IO b
forall q b. GenQuote (ForeignPtr q) -> (Ptr q -> IO b) -> IO b
withGenQuote
withMaybeQuote :: Maybe (GenQuote q) -> (Ptr CQuote' -> IO b) -> IO b
withMaybeQuote :: forall q b. Maybe (GenQuote q) -> (Ptr CQuote' -> IO b) -> IO b
withMaybeQuote Maybe (GenQuote q)
x Ptr CQuote' -> IO b
f = IO b -> (GenQuote q -> IO b) -> Maybe (GenQuote q) -> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Ptr CQuote' -> IO b
f Ptr CQuote'
forall a. Ptr a
nullPtr) (GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
`withQuote` Ptr CQuote' -> IO b
f) Maybe (GenQuote q)
x
withQuoteArray :: [GenQuote q] -> ((CUInt, Ptr (Ptr CQuote')) -> IO b) -> IO b
withQuoteArray :: forall q b.
[GenQuote q] -> ((CUInt, Ptr (Ptr CQuote')) -> IO b) -> IO b
withQuoteArray = (GenQuote q -> (Ptr CQuote' -> IO b) -> IO b)
-> [GenQuote q] -> ((CUInt, Ptr (Ptr CQuote')) -> IO b) -> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote
withQuoteArrayRaw :: [GenQuote q] -> (Ptr (Ptr CQuote') -> IO b) -> IO b
withQuoteArrayRaw :: forall q b. [GenQuote q] -> (Ptr (Ptr CQuote') -> IO b) -> IO b
withQuoteArrayRaw [GenQuote q]
x Ptr (Ptr CQuote') -> IO b
f = (GenQuote q -> (Ptr CQuote' -> IO b) -> IO b)
-> [GenQuote q] -> ([Ptr CQuote'] -> IO b) -> IO b
forall a b res.
(a -> (b -> res) -> res) -> [a] -> ([b] -> res) -> res
withMany GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
forall q b. GenQuote q -> (Ptr CQuote' -> IO b) -> IO b
withQuote [GenQuote q]
x ([Ptr CQuote'] -> (Ptr (Ptr CQuote') -> IO b) -> IO b
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
`withArray` Ptr (Ptr CQuote') -> IO b
f)

-- PAYOFF/EXERCISE upcast targets used by QuantLib.Internal.Common's Payoff/Exercise ADT dispatch
-- (the ADTs themselves stay in Enum.chs; only the pointer hierarchy plumbing lives here,
-- matching every other hierarchy in this module)
data CPayoff'
foreign import ccall unsafe "ql.h &qlFreePayoff" qlFreePayoff :: FinalizerPtr CPayoff'
instance Finalizable CPayoff' where finalize :: FinalizerPtr CPayoff'
finalize = FinalizerPtr CPayoff'
qlFreePayoff

data CBasketPayoff'
foreign import ccall unsafe "ql.h &qlFreeBasketPayoff" qlFreeBasketPayoff :: FinalizerPtr CBasketPayoff'
instance Finalizable CBasketPayoff' where finalize :: FinalizerPtr CBasketPayoff'
finalize = FinalizerPtr CBasketPayoff'
qlFreeBasketPayoff
instance Upcastable CBasketPayoff' where {type Base CBasketPayoff' = CPayoff'; upcast :: Ptr CBasketPayoff' -> IO (Ptr (Base CBasketPayoff'))
upcast = Ptr CBasketPayoff' -> IO (Ptr CPayoff')
Ptr CBasketPayoff' -> IO (Ptr (Base CBasketPayoff'))
qlBasketPayoffAsPayoff}
foreign import ccall "ql.h qlBasketPayoffAsPayoff" qlBasketPayoffAsPayoff :: Ptr CBasketPayoff' -> IO (Ptr CPayoff')

data CTypePayoff'
foreign import ccall unsafe "ql.h &qlFreeTypePayoff" qlFreeTypePayoff :: FinalizerPtr CTypePayoff'
instance Finalizable CTypePayoff' where finalize :: FinalizerPtr CTypePayoff'
finalize = FinalizerPtr CTypePayoff'
qlFreeTypePayoff
instance Upcastable CTypePayoff' where {type Base CTypePayoff' = CPayoff'; upcast :: Ptr CTypePayoff' -> IO (Ptr (Base CTypePayoff'))
upcast = Ptr CTypePayoff' -> IO (Ptr CPayoff')
Ptr CTypePayoff' -> IO (Ptr (Base CTypePayoff'))
qlTypePayoffAsPayoff}
foreign import ccall "ql.h qlTypePayoffAsPayoff" qlTypePayoffAsPayoff :: Ptr CTypePayoff' -> IO (Ptr CPayoff')

data CStrikedTypePayoff'
foreign import ccall unsafe "ql.h &qlFreeStrikedTypePayoff" qlFreeStrikedTypePayoff :: FinalizerPtr CStrikedTypePayoff'
instance Finalizable CStrikedTypePayoff' where finalize :: FinalizerPtr CStrikedTypePayoff'
finalize = FinalizerPtr CStrikedTypePayoff'
qlFreeStrikedTypePayoff
instance Upcastable CStrikedTypePayoff' where {type Base CStrikedTypePayoff' = CTypePayoff'; upcast :: Ptr CStrikedTypePayoff' -> IO (Ptr (Base CStrikedTypePayoff'))
upcast = Ptr CStrikedTypePayoff' -> IO (Ptr CTypePayoff')
Ptr CStrikedTypePayoff' -> IO (Ptr (Base CStrikedTypePayoff'))
qlStrikedTypePayoffAsTypePayoff}
foreign import ccall "ql.h qlStrikedTypePayoffAsTypePayoff" qlStrikedTypePayoffAsTypePayoff :: Ptr CStrikedTypePayoff' -> IO (Ptr CTypePayoff')

data CPercentageStrikePayoff'
foreign import ccall unsafe "ql.h &qlFreePercentageStrikePayoff" qlFreePercentageStrikePayoff :: FinalizerPtr CPercentageStrikePayoff'
instance Finalizable CPercentageStrikePayoff' where finalize :: FinalizerPtr CPercentageStrikePayoff'
finalize = FinalizerPtr CPercentageStrikePayoff'
qlFreePercentageStrikePayoff
instance Upcastable CPercentageStrikePayoff' where {type Base CPercentageStrikePayoff' = CStrikedTypePayoff'; upcast :: Ptr CPercentageStrikePayoff'
-> IO (Ptr (Base CPercentageStrikePayoff'))
upcast = Ptr CPercentageStrikePayoff' -> IO (Ptr CStrikedTypePayoff')
Ptr CPercentageStrikePayoff'
-> IO (Ptr (Base CPercentageStrikePayoff'))
qlPercentageStrikePayoffAsStrikedTypePayoff}
foreign import ccall "ql.h qlPercentageStrikePayoffAsStrikedTypePayoff" qlPercentageStrikePayoffAsStrikedTypePayoff :: Ptr CPercentageStrikePayoff' -> IO (Ptr CStrikedTypePayoff')

data CPlainVanillaPayoff'
foreign import ccall unsafe "ql.h &qlFreePlainVanillaPayoff" qlFreePlainVanillaPayoff :: FinalizerPtr CPlainVanillaPayoff'
instance Finalizable CPlainVanillaPayoff' where finalize :: FinalizerPtr CPlainVanillaPayoff'
finalize = FinalizerPtr CPlainVanillaPayoff'
qlFreePlainVanillaPayoff
instance Upcastable CPlainVanillaPayoff' where {type Base CPlainVanillaPayoff' = CStrikedTypePayoff'; upcast :: Ptr CPlainVanillaPayoff' -> IO (Ptr (Base CPlainVanillaPayoff'))
upcast = Ptr CPlainVanillaPayoff' -> IO (Ptr CStrikedTypePayoff')
Ptr CPlainVanillaPayoff' -> IO (Ptr (Base CPlainVanillaPayoff'))
qlPlainVanillaPayoffAsStrikedTypePayoff}
foreign import ccall "ql.h qlPlainVanillaPayoffAsStrikedTypePayoff" qlPlainVanillaPayoffAsStrikedTypePayoff :: Ptr CPlainVanillaPayoff' -> IO (Ptr CStrikedTypePayoff')

data CExercise'
foreign import ccall unsafe "ql.h &qlFreeExercise" qlFreeExercise :: FinalizerPtr CExercise'
instance Finalizable CExercise' where finalize :: FinalizerPtr CExercise'
finalize = FinalizerPtr CExercise'
qlFreeExercise

data CAmericanExercise'
foreign import ccall unsafe "ql.h &qlFreeAmericanExercise" qlFreeAmericanExercise :: FinalizerPtr CAmericanExercise'
instance Finalizable CAmericanExercise' where finalize :: FinalizerPtr CAmericanExercise'
finalize = FinalizerPtr CAmericanExercise'
qlFreeAmericanExercise
instance Upcastable CAmericanExercise' where {type Base CAmericanExercise' = CExercise'; upcast :: Ptr CAmericanExercise' -> IO (Ptr (Base CAmericanExercise'))
upcast = Ptr CAmericanExercise' -> IO (Ptr CExercise')
Ptr CAmericanExercise' -> IO (Ptr (Base CAmericanExercise'))
qlAmericanExerciseAsExercise}
foreign import ccall "ql.h qlAmericanExerciseAsExercise" qlAmericanExerciseAsExercise :: Ptr CAmericanExercise' -> IO (Ptr CExercise')

data CEuropeanExercise'
foreign import ccall unsafe "ql.h &qlFreeEuropeanExercise" qlFreeEuropeanExercise :: FinalizerPtr CEuropeanExercise'
instance Finalizable CEuropeanExercise' where finalize :: FinalizerPtr CEuropeanExercise'
finalize = FinalizerPtr CEuropeanExercise'
qlFreeEuropeanExercise
instance Upcastable CEuropeanExercise' where {type Base CEuropeanExercise' = CExercise'; upcast :: Ptr CEuropeanExercise' -> IO (Ptr (Base CEuropeanExercise'))
upcast = Ptr CEuropeanExercise' -> IO (Ptr CExercise')
Ptr CEuropeanExercise' -> IO (Ptr (Base CEuropeanExercise'))
qlEuropeanExerciseAsExercise}
foreign import ccall "ql.h qlEuropeanExerciseAsExercise" qlEuropeanExerciseAsExercise :: Ptr CEuropeanExercise' -> IO (Ptr CExercise')

data CBermudanExercise'
foreign import ccall unsafe "ql.h &qlFreeBermudanExercise" qlFreeBermudanExercise :: FinalizerPtr CBermudanExercise'
instance Finalizable CBermudanExercise' where finalize :: FinalizerPtr CBermudanExercise'
finalize = FinalizerPtr CBermudanExercise'
qlFreeBermudanExercise
instance Upcastable CBermudanExercise' where {type Base CBermudanExercise' = CExercise'; upcast :: Ptr CBermudanExercise' -> IO (Ptr (Base CBermudanExercise'))
upcast = Ptr CBermudanExercise' -> IO (Ptr CExercise')
Ptr CBermudanExercise' -> IO (Ptr (Base CBermudanExercise'))
qlBermudanExerciseAsExercise}
foreign import ccall "ql.h qlBermudanExerciseAsExercise" qlBermudanExerciseAsExercise :: Ptr CBermudanExercise' -> IO (Ptr CExercise')

data CSwingExercise'
foreign import ccall unsafe "ql.h &qlFreeSwingExercise" qlFreeSwingExercise :: FinalizerPtr CSwingExercise'
instance Finalizable CSwingExercise' where finalize :: FinalizerPtr CSwingExercise'
finalize = FinalizerPtr CSwingExercise'
qlFreeSwingExercise
instance Upcastable CSwingExercise' where {type Base CSwingExercise' = CBermudanExercise'; upcast :: Ptr CSwingExercise' -> IO (Ptr (Base CSwingExercise'))
upcast = Ptr CSwingExercise' -> IO (Ptr CBermudanExercise')
Ptr CSwingExercise' -> IO (Ptr (Base CSwingExercise'))
qlSwingExerciseAsBermudanExercise}
foreign import ccall "ql.h qlSwingExerciseAsBermudanExercise" qlSwingExerciseAsBermudanExercise :: Ptr CSwingExercise' -> IO (Ptr CBermudanExercise')

data CRebatedExercise'
foreign import ccall unsafe "ql.h &qlFreeRebatedExercise" qlFreeRebatedExercise :: FinalizerPtr CRebatedExercise'
instance Finalizable CRebatedExercise' where finalize :: FinalizerPtr CRebatedExercise'
finalize = FinalizerPtr CRebatedExercise'
qlFreeRebatedExercise
instance Upcastable CRebatedExercise' where {type Base CRebatedExercise' = CExercise'; upcast :: Ptr CRebatedExercise' -> IO (Ptr (Base CRebatedExercise'))
upcast = Ptr CRebatedExercise' -> IO (Ptr CExercise')
Ptr CRebatedExercise' -> IO (Ptr (Base CRebatedExercise'))
qlRebatedExerciseAsExercise}
foreign import ccall "ql.h qlRebatedExerciseAsExercise" qlRebatedExerciseAsExercise :: Ptr CRebatedExercise' -> IO (Ptr CExercise')

data CLeg'
data CCouponLeg'
-- Upstream's InflationCoupon, between Coupon and the two inflation coupons, is elided from the
-- hierarchy below: no bound API consumes it.
data CCashFlow'

-- | > CashFlow
-- >   Coupon
-- >     FixedRateCoupon
-- >     FloatingRateCoupon
-- >       AverageBMACoupon
-- >       CmsCoupon
-- >       DigitalCoupon
-- >         DigitalCmsCoupon
-- >         DigitalCmsSpreadCoupon
-- >       IborCoupon
-- >       MultipleResetsCoupon
-- >       OvernightIndexedCoupon
-- >       RangeAccrualFloatersCoupon
-- >       StrippedCappedFlooredCoupon
-- >     CPICoupon
-- >     YoYInflationCoupon
-- >   IndexedCashFlow
-- >     CPICashFlow
-- >     EquityCashFlow
-- >     ZeroInflationCashFlow
-- >   CommodityCashFlow
newtype GenCashFlow cf = GenCashFlow {forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow :: GenForeignPtr cf CCashFlow'}
type CCashFlow = ForeignPtr CCashFlow'
-- |The root of the hierarchy shown under t'GenCashFlow'.
type CashFlow = GenCashFlow CCashFlow
foreign import ccall unsafe "ql.h &qlFreeCashFlow" qlFreeCashFlow :: FinalizerPtr CCashFlow'
instance Finalizable CCashFlow' where finalize :: FinalizerPtr CCashFlow'
finalize = FinalizerPtr CCashFlow'
qlFreeCashFlow
asCashFlow :: GenCashFlow cf -> IO CashFlow
asCashFlow :: forall cf. GenCashFlow cf -> IO CashFlow
asCashFlow = (Ptr CCashFlow' -> IO CashFlow)
-> GenForeignPtr cf CCashFlow' -> IO CashFlow
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CCashFlow' -> IO CashFlow
peekCashFlow (GenForeignPtr cf CCashFlow' -> IO CashFlow)
-> (GenCashFlow cf -> GenForeignPtr cf CCashFlow')
-> GenCashFlow cf
-> IO CashFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow
peekCashFlow :: Ptr CCashFlow' -> IO CashFlow
peekCashFlow :: Ptr CCashFlow' -> IO CashFlow
peekCashFlow = GenForeignPtr CCashFlow CCashFlow' -> CashFlow
forall cf. GenForeignPtr cf CCashFlow' -> GenCashFlow cf
GenCashFlow (GenForeignPtr CCashFlow CCashFlow' -> CashFlow)
-> (Ptr CCashFlow' -> IO (GenForeignPtr CCashFlow CCashFlow'))
-> Ptr CCashFlow'
-> IO CashFlow
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCashFlow' -> IO (GenForeignPtr CCashFlow CCashFlow')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr
withCashFlow :: GenCashFlow cf -> (Ptr CCashFlow' -> IO b) -> IO b
withCashFlow :: forall cf b. GenCashFlow cf -> (Ptr CCashFlow' -> IO b) -> IO b
withCashFlow = GenForeignPtr cf CCashFlow' -> (Ptr CCashFlow' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr cf CCashFlow' -> (Ptr CCashFlow' -> IO b) -> IO b)
-> (GenCashFlow cf -> GenForeignPtr cf CCashFlow')
-> GenCashFlow cf
-> (Ptr CCashFlow' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow
withCashFlowArray :: [GenCashFlow cf] -> ((CUInt, Ptr (Ptr CCashFlow')) -> IO b) -> IO b
withCashFlowArray :: forall cf b.
[GenCashFlow cf] -> ((CUInt, Ptr (Ptr CCashFlow')) -> IO b) -> IO b
withCashFlowArray = (GenCashFlow cf -> (Ptr CCashFlow' -> IO b) -> IO b)
-> [GenCashFlow cf]
-> ((CUInt, Ptr (Ptr CCashFlow')) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray GenCashFlow cf -> (Ptr CCashFlow' -> IO b) -> IO b
forall cf b. GenCashFlow cf -> (Ptr CCashFlow' -> IO b) -> IO b
withCashFlow

data CCoupon'

-- |Shared base of every accruing cash flow: a nominal, an accrual period, and a rate.
-- See the hierarchy under t'GenCashFlow'.
type GenCoupon c = GenCashFlow (AnyOf CCoupon' c)
type CCoupon = ForeignPtr CCoupon'
-- |A 'CashFlow'; see the hierarchy under t'GenCashFlow'.
type Coupon = GenCoupon CCoupon
foreign import ccall unsafe "ql.h &qlFreeCoupon" qlFreeCoupon :: FinalizerPtr CCoupon'
instance Finalizable CCoupon' where finalize :: FinalizerPtr CCoupon'
finalize = FinalizerPtr CCoupon'
qlFreeCoupon
foreign import ccall "ql.h qlCouponAsCashFlow" qlCouponAsCashFlow :: Ptr CCoupon' -> IO (Ptr CCashFlow')
instance Upcastable CCoupon' where {type Base CCoupon' = CCashFlow'; upcast :: Ptr CCoupon' -> IO (Ptr (Base CCoupon'))
upcast = Ptr CCoupon' -> IO (Ptr CCashFlow')
Ptr CCoupon' -> IO (Ptr (Base CCoupon'))
qlCouponAsCashFlow}
asCoupon :: GenCoupon c -> IO Coupon
asCoupon :: forall c. GenCoupon c -> IO Coupon
asCoupon = (Ptr CCoupon' -> IO Coupon)
-> GenForeignPtr c CCoupon' -> IO Coupon
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CCoupon' -> IO Coupon
peekCoupon (GenForeignPtr c CCoupon' -> IO Coupon)
-> (GenCoupon c -> GenForeignPtr c CCoupon')
-> GenCoupon c
-> IO Coupon
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CCoupon' c) CCashFlow'
-> GenForeignPtr c CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CCoupon' c) CCashFlow'
 -> GenForeignPtr c CCoupon')
-> (GenCoupon c -> GenForeignPtr (AnyOf CCoupon' c) CCashFlow')
-> GenCoupon c
-> GenForeignPtr c CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenCoupon c -> GenForeignPtr (AnyOf CCoupon' c) CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow
peekCoupon :: Ptr CCoupon' -> IO Coupon
peekCoupon :: Ptr CCoupon' -> IO Coupon
peekCoupon = Ptr CCoupon' -> IO (GenForeignPtr (ForeignPtr CCoupon') CCoupon')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CCoupon' -> IO (GenForeignPtr (ForeignPtr CCoupon') CCoupon'))
-> (GenForeignPtr (ForeignPtr CCoupon') CCoupon' -> IO Coupon)
-> Ptr CCoupon'
-> IO Coupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CCoupon') CCoupon' -> IO Coupon
forall c. GenForeignPtr c CCoupon' -> IO (GenCoupon c)
newGenCoupon
newGenCoupon :: GenForeignPtr c CCoupon' -> IO (GenCoupon c)
newGenCoupon :: forall c. GenForeignPtr c CCoupon' -> IO (GenCoupon c)
newGenCoupon = GenCoupon c -> IO (GenCoupon c)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenCoupon c -> IO (GenCoupon c))
-> (GenForeignPtr c CCoupon' -> GenCoupon c)
-> GenForeignPtr c CCoupon'
-> IO (GenCoupon c)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CCoupon' c) CCashFlow' -> GenCoupon c
forall cf. GenForeignPtr cf CCashFlow' -> GenCashFlow cf
GenCashFlow (GenForeignPtr (AnyOf CCoupon' c) CCashFlow' -> GenCoupon c)
-> (GenForeignPtr c CCoupon'
    -> GenForeignPtr (AnyOf CCoupon' c) CCashFlow')
-> GenForeignPtr c CCoupon'
-> GenCoupon c
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr c CCoupon'
-> GenForeignPtr (AnyOf CCoupon' c) CCashFlow'
GenForeignPtr c CCoupon'
-> GenForeignPtr (AnyOf CCoupon' c) (Base CCoupon')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
withCoupon :: GenCoupon c -> (Ptr CCoupon' -> IO b) -> IO b
withCoupon :: forall c b. GenCoupon c -> (Ptr CCoupon' -> IO b) -> IO b
withCoupon = GenForeignPtr c CCoupon' -> (Ptr CCoupon' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr c CCoupon' -> (Ptr CCoupon' -> IO b) -> IO b)
-> (GenCoupon c -> GenForeignPtr c CCoupon')
-> GenCoupon c
-> (Ptr CCoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CCoupon' c) CCashFlow'
-> GenForeignPtr c CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CCoupon' c) CCashFlow'
 -> GenForeignPtr c CCoupon')
-> (GenCoupon c -> GenForeignPtr (AnyOf CCoupon' c) CCashFlow')
-> GenCoupon c
-> GenForeignPtr c CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenCoupon c -> GenForeignPtr (AnyOf CCoupon' c) CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow
peekCouponArray :: Ptr CUInt -> Ptr (Ptr (Ptr CCoupon')) -> IO [Coupon]
peekCouponArray :: Ptr CUInt -> Ptr (Ptr (Ptr CCoupon')) -> IO [Coupon]
peekCouponArray = (Ptr CCoupon' -> IO Coupon)
-> Ptr CUInt -> Ptr (Ptr (Ptr CCoupon')) -> IO [Coupon]
forall a b.
(Ptr a -> IO b) -> Ptr CUInt -> Ptr (Ptr (Ptr a)) -> IO [b]
peekPtrArray Ptr CCoupon' -> IO Coupon
peekCoupon

data CFixedRateCoupon'
type CFixedRateCoupon = ForeignPtr CFixedRateCoupon'
-- |A 'Coupon'; see the hierarchy under t'GenCashFlow'.
type FixedRateCoupon = GenCoupon CFixedRateCoupon
foreign import ccall unsafe "ql.h &qlFreeFixedRateCoupon" qlFreeFixedRateCoupon :: FinalizerPtr CFixedRateCoupon'
instance Finalizable CFixedRateCoupon' where finalize :: FinalizerPtr CFixedRateCoupon'
finalize = FinalizerPtr CFixedRateCoupon'
qlFreeFixedRateCoupon
foreign import ccall "ql.h qlFixedRateCouponAsCoupon" qlFixedRateCouponAsCoupon :: Ptr CFixedRateCoupon' -> IO (Ptr CCoupon')
instance Upcastable CFixedRateCoupon' where {type Base CFixedRateCoupon' = CCoupon'; upcast :: Ptr CFixedRateCoupon' -> IO (Ptr (Base CFixedRateCoupon'))
upcast = Ptr CFixedRateCoupon' -> IO (Ptr CCoupon')
Ptr CFixedRateCoupon' -> IO (Ptr (Base CFixedRateCoupon'))
qlFixedRateCouponAsCoupon}
peekFixedRateCoupon :: Ptr CFixedRateCoupon' -> IO FixedRateCoupon
peekFixedRateCoupon :: Ptr CFixedRateCoupon' -> IO FixedRateCoupon
peekFixedRateCoupon = Ptr CFixedRateCoupon'
-> IO (GenForeignPtr (ForeignPtr CFixedRateCoupon') CCoupon')
Ptr CFixedRateCoupon'
-> IO
     (GenForeignPtr
        (ForeignPtr CFixedRateCoupon') (Base CFixedRateCoupon'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CFixedRateCoupon'
 -> IO (GenForeignPtr (ForeignPtr CFixedRateCoupon') CCoupon'))
-> (GenForeignPtr (ForeignPtr CFixedRateCoupon') CCoupon'
    -> IO FixedRateCoupon)
-> Ptr CFixedRateCoupon'
-> IO FixedRateCoupon
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CFixedRateCoupon') CCoupon'
-> IO FixedRateCoupon
forall c. GenForeignPtr c CCoupon' -> IO (GenCoupon c)
newGenCoupon
withFixedRateCoupon :: FixedRateCoupon -> (Ptr CFixedRateCoupon' -> IO b) -> IO b
withFixedRateCoupon :: forall b.
FixedRateCoupon -> (Ptr CFixedRateCoupon' -> IO b) -> IO b
withFixedRateCoupon = ForeignPtr CFixedRateCoupon'
-> (Ptr CFixedRateCoupon' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CFixedRateCoupon'
 -> (Ptr CFixedRateCoupon' -> IO b) -> IO b)
-> (FixedRateCoupon -> ForeignPtr CFixedRateCoupon')
-> FixedRateCoupon
-> (Ptr CFixedRateCoupon' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CFixedRateCoupon') CCoupon'
-> ForeignPtr CFixedRateCoupon'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CFixedRateCoupon') CCoupon'
 -> ForeignPtr CFixedRateCoupon')
-> (FixedRateCoupon
    -> GenForeignPtr (ForeignPtr CFixedRateCoupon') CCoupon')
-> FixedRateCoupon
-> ForeignPtr CFixedRateCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CCoupon' (ForeignPtr CFixedRateCoupon')) CCashFlow'
-> GenForeignPtr (ForeignPtr CFixedRateCoupon') CCoupon'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CCoupon' (ForeignPtr CFixedRateCoupon')) CCashFlow'
 -> GenForeignPtr (ForeignPtr CFixedRateCoupon') CCoupon')
-> (FixedRateCoupon
    -> GenForeignPtr
         (AnyOf CCoupon' (ForeignPtr CFixedRateCoupon')) CCashFlow')
-> FixedRateCoupon
-> GenForeignPtr (ForeignPtr CFixedRateCoupon') CCoupon'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FixedRateCoupon
-> GenForeignPtr
     (AnyOf CCoupon' (ForeignPtr CFixedRateCoupon')) CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

data CIndexedCashFlow'
-- |An 'IndexedCashFlow' or one of its leaves; see the hierarchy under t'GenCashFlow'.
type GenIndexedCashFlow icf = GenCashFlow (AnyOf CIndexedCashFlow' icf)
type CIndexedCashFlow = ForeignPtr CIndexedCashFlow'
-- |A 'CashFlow'; see the hierarchy under t'GenCashFlow'.
type IndexedCashFlow = GenIndexedCashFlow CIndexedCashFlow
foreign import ccall unsafe "ql.h &qlFreeIndexedCashFlow" qlFreeIndexedCashFlow :: FinalizerPtr CIndexedCashFlow'
instance Finalizable CIndexedCashFlow' where finalize :: FinalizerPtr CIndexedCashFlow'
finalize = FinalizerPtr CIndexedCashFlow'
qlFreeIndexedCashFlow
foreign import ccall "ql.h qlIndexedCashFlowAsCashFlow" qlIndexedCashFlowAsCashFlow :: Ptr CIndexedCashFlow' -> IO (Ptr CCashFlow')
instance Upcastable CIndexedCashFlow' where {type Base CIndexedCashFlow' = CCashFlow'; upcast :: Ptr CIndexedCashFlow' -> IO (Ptr (Base CIndexedCashFlow'))
upcast = Ptr CIndexedCashFlow' -> IO (Ptr CCashFlow')
Ptr CIndexedCashFlow' -> IO (Ptr (Base CIndexedCashFlow'))
qlIndexedCashFlowAsCashFlow}
peekIndexedCashFlow :: Ptr CIndexedCashFlow' -> IO IndexedCashFlow
peekIndexedCashFlow :: Ptr CIndexedCashFlow' -> IO IndexedCashFlow
peekIndexedCashFlow = Ptr CIndexedCashFlow'
-> IO
     (GenForeignPtr (ForeignPtr CIndexedCashFlow') CIndexedCashFlow')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CIndexedCashFlow'
 -> IO
      (GenForeignPtr (ForeignPtr CIndexedCashFlow') CIndexedCashFlow'))
-> (GenForeignPtr (ForeignPtr CIndexedCashFlow') CIndexedCashFlow'
    -> IO IndexedCashFlow)
-> Ptr CIndexedCashFlow'
-> IO IndexedCashFlow
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CIndexedCashFlow') CIndexedCashFlow'
-> IO IndexedCashFlow
forall icf.
GenForeignPtr icf CIndexedCashFlow' -> IO (GenIndexedCashFlow icf)
newGenIndexedCashFlow
newGenIndexedCashFlow :: GenForeignPtr icf CIndexedCashFlow' -> IO (GenIndexedCashFlow icf)
newGenIndexedCashFlow :: forall icf.
GenForeignPtr icf CIndexedCashFlow' -> IO (GenIndexedCashFlow icf)
newGenIndexedCashFlow = GenIndexedCashFlow icf -> IO (GenIndexedCashFlow icf)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenIndexedCashFlow icf -> IO (GenIndexedCashFlow icf))
-> (GenForeignPtr icf CIndexedCashFlow' -> GenIndexedCashFlow icf)
-> GenForeignPtr icf CIndexedCashFlow'
-> IO (GenIndexedCashFlow icf)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CIndexedCashFlow' icf) CCashFlow'
-> GenIndexedCashFlow icf
forall cf. GenForeignPtr cf CCashFlow' -> GenCashFlow cf
GenCashFlow (GenForeignPtr (AnyOf CIndexedCashFlow' icf) CCashFlow'
 -> GenIndexedCashFlow icf)
-> (GenForeignPtr icf CIndexedCashFlow'
    -> GenForeignPtr (AnyOf CIndexedCashFlow' icf) CCashFlow')
-> GenForeignPtr icf CIndexedCashFlow'
-> GenIndexedCashFlow icf
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr icf CIndexedCashFlow'
-> GenForeignPtr (AnyOf CIndexedCashFlow' icf) CCashFlow'
GenForeignPtr icf CIndexedCashFlow'
-> GenForeignPtr
     (AnyOf CIndexedCashFlow' icf) (Base CIndexedCashFlow')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
withIndexedCashFlow :: GenIndexedCashFlow icf -> (Ptr CIndexedCashFlow' -> IO b) -> IO b
withIndexedCashFlow :: forall icf b.
GenIndexedCashFlow icf -> (Ptr CIndexedCashFlow' -> IO b) -> IO b
withIndexedCashFlow = GenForeignPtr icf CIndexedCashFlow'
-> (Ptr CIndexedCashFlow' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr icf CIndexedCashFlow'
 -> (Ptr CIndexedCashFlow' -> IO b) -> IO b)
-> (GenIndexedCashFlow icf -> GenForeignPtr icf CIndexedCashFlow')
-> GenIndexedCashFlow icf
-> (Ptr CIndexedCashFlow' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CIndexedCashFlow' icf) CCashFlow'
-> GenForeignPtr icf CIndexedCashFlow'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CIndexedCashFlow' icf) CCashFlow'
 -> GenForeignPtr icf CIndexedCashFlow')
-> (GenIndexedCashFlow icf
    -> GenForeignPtr (AnyOf CIndexedCashFlow' icf) CCashFlow')
-> GenIndexedCashFlow icf
-> GenForeignPtr icf CIndexedCashFlow'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenIndexedCashFlow icf
-> GenForeignPtr (AnyOf CIndexedCashFlow' icf) CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

data CZeroInflationCashFlow'
type CZeroInflationCashFlow = ForeignPtr CZeroInflationCashFlow'
-- |An 'IndexedCashFlow'; see the hierarchy under t'GenCashFlow'.
type ZeroInflationCashFlow = GenIndexedCashFlow CZeroInflationCashFlow
foreign import ccall unsafe "ql.h &qlFreeZeroInflationCashFlow" qlFreeZeroInflationCashFlow :: FinalizerPtr CZeroInflationCashFlow'
instance Finalizable CZeroInflationCashFlow' where finalize :: FinalizerPtr CZeroInflationCashFlow'
finalize = FinalizerPtr CZeroInflationCashFlow'
qlFreeZeroInflationCashFlow
foreign import ccall "ql.h qlZeroInflationCashFlowAsIndexedCashFlow" qlZeroInflationCashFlowAsIndexedCashFlow :: Ptr CZeroInflationCashFlow' -> IO (Ptr CIndexedCashFlow')
instance Upcastable CZeroInflationCashFlow' where {type Base CZeroInflationCashFlow' = CIndexedCashFlow'; upcast :: Ptr CZeroInflationCashFlow'
-> IO (Ptr (Base CZeroInflationCashFlow'))
upcast = Ptr CZeroInflationCashFlow' -> IO (Ptr CIndexedCashFlow')
Ptr CZeroInflationCashFlow'
-> IO (Ptr (Base CZeroInflationCashFlow'))
qlZeroInflationCashFlowAsIndexedCashFlow}
peekZeroInflationCashFlow :: Ptr CZeroInflationCashFlow' -> IO ZeroInflationCashFlow
peekZeroInflationCashFlow :: Ptr CZeroInflationCashFlow' -> IO ZeroInflationCashFlow
peekZeroInflationCashFlow = Ptr CZeroInflationCashFlow'
-> IO
     (GenForeignPtr
        (ForeignPtr CZeroInflationCashFlow') CIndexedCashFlow')
Ptr CZeroInflationCashFlow'
-> IO
     (GenForeignPtr
        (ForeignPtr CZeroInflationCashFlow')
        (Base CZeroInflationCashFlow'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CZeroInflationCashFlow'
 -> IO
      (GenForeignPtr
         (ForeignPtr CZeroInflationCashFlow') CIndexedCashFlow'))
-> (GenForeignPtr
      (ForeignPtr CZeroInflationCashFlow') CIndexedCashFlow'
    -> IO ZeroInflationCashFlow)
-> Ptr CZeroInflationCashFlow'
-> IO ZeroInflationCashFlow
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CZeroInflationCashFlow') CIndexedCashFlow'
-> IO ZeroInflationCashFlow
forall icf.
GenForeignPtr icf CIndexedCashFlow' -> IO (GenIndexedCashFlow icf)
newGenIndexedCashFlow
withZeroInflationCashFlow :: ZeroInflationCashFlow -> (Ptr CZeroInflationCashFlow' -> IO b) -> IO b
withZeroInflationCashFlow :: forall b.
ZeroInflationCashFlow
-> (Ptr CZeroInflationCashFlow' -> IO b) -> IO b
withZeroInflationCashFlow = ForeignPtr CZeroInflationCashFlow'
-> (Ptr CZeroInflationCashFlow' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CZeroInflationCashFlow'
 -> (Ptr CZeroInflationCashFlow' -> IO b) -> IO b)
-> (ZeroInflationCashFlow -> ForeignPtr CZeroInflationCashFlow')
-> ZeroInflationCashFlow
-> (Ptr CZeroInflationCashFlow' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CZeroInflationCashFlow') CIndexedCashFlow'
-> ForeignPtr CZeroInflationCashFlow'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CZeroInflationCashFlow') CIndexedCashFlow'
 -> ForeignPtr CZeroInflationCashFlow')
-> (ZeroInflationCashFlow
    -> GenForeignPtr
         (ForeignPtr CZeroInflationCashFlow') CIndexedCashFlow')
-> ZeroInflationCashFlow
-> ForeignPtr CZeroInflationCashFlow'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CIndexedCashFlow' (ForeignPtr CZeroInflationCashFlow'))
  CCashFlow'
-> GenForeignPtr
     (ForeignPtr CZeroInflationCashFlow') CIndexedCashFlow'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CIndexedCashFlow' (ForeignPtr CZeroInflationCashFlow'))
   CCashFlow'
 -> GenForeignPtr
      (ForeignPtr CZeroInflationCashFlow') CIndexedCashFlow')
-> (ZeroInflationCashFlow
    -> GenForeignPtr
         (AnyOf CIndexedCashFlow' (ForeignPtr CZeroInflationCashFlow'))
         CCashFlow')
-> ZeroInflationCashFlow
-> GenForeignPtr
     (ForeignPtr CZeroInflationCashFlow') CIndexedCashFlow'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ZeroInflationCashFlow
-> GenForeignPtr
     (AnyOf CIndexedCashFlow' (ForeignPtr CZeroInflationCashFlow'))
     CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

data CCPICashFlow'
type CCPICashFlow = ForeignPtr CCPICashFlow'
-- |An 'IndexedCashFlow'; see the hierarchy under t'GenCashFlow'.
type CPICashFlow = GenIndexedCashFlow CCPICashFlow
foreign import ccall unsafe "ql.h &qlFreeCPICashFlow" qlFreeCPICashFlow :: FinalizerPtr CCPICashFlow'
instance Finalizable CCPICashFlow' where finalize :: FinalizerPtr CCPICashFlow'
finalize = FinalizerPtr CCPICashFlow'
qlFreeCPICashFlow
foreign import ccall "ql.h qlCPICashFlowAsIndexedCashFlow" qlCPICashFlowAsIndexedCashFlow :: Ptr CCPICashFlow' -> IO (Ptr CIndexedCashFlow')
instance Upcastable CCPICashFlow' where {type Base CCPICashFlow' = CIndexedCashFlow'; upcast :: Ptr CCPICashFlow' -> IO (Ptr (Base CCPICashFlow'))
upcast = Ptr CCPICashFlow' -> IO (Ptr CIndexedCashFlow')
Ptr CCPICashFlow' -> IO (Ptr (Base CCPICashFlow'))
qlCPICashFlowAsIndexedCashFlow}
peekCPICashFlow :: Ptr CCPICashFlow' -> IO CPICashFlow
peekCPICashFlow :: Ptr CCPICashFlow' -> IO CPICashFlow
peekCPICashFlow = Ptr CCPICashFlow'
-> IO (GenForeignPtr (ForeignPtr CCPICashFlow') CIndexedCashFlow')
Ptr CCPICashFlow'
-> IO
     (GenForeignPtr (ForeignPtr CCPICashFlow') (Base CCPICashFlow'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CCPICashFlow'
 -> IO (GenForeignPtr (ForeignPtr CCPICashFlow') CIndexedCashFlow'))
-> (GenForeignPtr (ForeignPtr CCPICashFlow') CIndexedCashFlow'
    -> IO CPICashFlow)
-> Ptr CCPICashFlow'
-> IO CPICashFlow
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CCPICashFlow') CIndexedCashFlow'
-> IO CPICashFlow
forall icf.
GenForeignPtr icf CIndexedCashFlow' -> IO (GenIndexedCashFlow icf)
newGenIndexedCashFlow
withCPICashFlow :: CPICashFlow -> (Ptr CCPICashFlow' -> IO b) -> IO b
withCPICashFlow :: forall b. CPICashFlow -> (Ptr CCPICashFlow' -> IO b) -> IO b
withCPICashFlow = ForeignPtr CCPICashFlow' -> (Ptr CCPICashFlow' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CCPICashFlow' -> (Ptr CCPICashFlow' -> IO b) -> IO b)
-> (CPICashFlow -> ForeignPtr CCPICashFlow')
-> CPICashFlow
-> (Ptr CCPICashFlow' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CCPICashFlow') CIndexedCashFlow'
-> ForeignPtr CCPICashFlow'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CCPICashFlow') CIndexedCashFlow'
 -> ForeignPtr CCPICashFlow')
-> (CPICashFlow
    -> GenForeignPtr (ForeignPtr CCPICashFlow') CIndexedCashFlow')
-> CPICashFlow
-> ForeignPtr CCPICashFlow'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CIndexedCashFlow' (ForeignPtr CCPICashFlow')) CCashFlow'
-> GenForeignPtr (ForeignPtr CCPICashFlow') CIndexedCashFlow'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CIndexedCashFlow' (ForeignPtr CCPICashFlow')) CCashFlow'
 -> GenForeignPtr (ForeignPtr CCPICashFlow') CIndexedCashFlow')
-> (CPICashFlow
    -> GenForeignPtr
         (AnyOf CIndexedCashFlow' (ForeignPtr CCPICashFlow')) CCashFlow')
-> CPICashFlow
-> GenForeignPtr (ForeignPtr CCPICashFlow') CIndexedCashFlow'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CPICashFlow
-> GenForeignPtr
     (AnyOf CIndexedCashFlow' (ForeignPtr CCPICashFlow')) CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

data CEquityCashFlow'
type CEquityCashFlow = ForeignPtr CEquityCashFlow'
-- |An 'IndexedCashFlow'; see the hierarchy under t'GenCashFlow'.
type EquityCashFlow = GenIndexedCashFlow CEquityCashFlow
foreign import ccall unsafe "ql.h &qlFreeEquityCashFlow" qlFreeEquityCashFlow :: FinalizerPtr CEquityCashFlow'
instance Finalizable CEquityCashFlow' where finalize :: FinalizerPtr CEquityCashFlow'
finalize = FinalizerPtr CEquityCashFlow'
qlFreeEquityCashFlow
foreign import ccall "ql.h qlEquityCashFlowAsIndexedCashFlow" qlEquityCashFlowAsIndexedCashFlow :: Ptr CEquityCashFlow' -> IO (Ptr CIndexedCashFlow')
instance Upcastable CEquityCashFlow' where {type Base CEquityCashFlow' = CIndexedCashFlow'; upcast :: Ptr CEquityCashFlow' -> IO (Ptr (Base CEquityCashFlow'))
upcast = Ptr CEquityCashFlow' -> IO (Ptr CIndexedCashFlow')
Ptr CEquityCashFlow' -> IO (Ptr (Base CEquityCashFlow'))
qlEquityCashFlowAsIndexedCashFlow}
peekEquityCashFlow :: Ptr CEquityCashFlow' -> IO EquityCashFlow
peekEquityCashFlow :: Ptr CEquityCashFlow' -> IO EquityCashFlow
peekEquityCashFlow = Ptr CEquityCashFlow'
-> IO
     (GenForeignPtr (ForeignPtr CEquityCashFlow') CIndexedCashFlow')
Ptr CEquityCashFlow'
-> IO
     (GenForeignPtr
        (ForeignPtr CEquityCashFlow') (Base CEquityCashFlow'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CEquityCashFlow'
 -> IO
      (GenForeignPtr (ForeignPtr CEquityCashFlow') CIndexedCashFlow'))
-> (GenForeignPtr (ForeignPtr CEquityCashFlow') CIndexedCashFlow'
    -> IO EquityCashFlow)
-> Ptr CEquityCashFlow'
-> IO EquityCashFlow
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CEquityCashFlow') CIndexedCashFlow'
-> IO EquityCashFlow
forall icf.
GenForeignPtr icf CIndexedCashFlow' -> IO (GenIndexedCashFlow icf)
newGenIndexedCashFlow
withEquityCashFlow :: EquityCashFlow -> (Ptr CEquityCashFlow' -> IO b) -> IO b
withEquityCashFlow :: forall b. EquityCashFlow -> (Ptr CEquityCashFlow' -> IO b) -> IO b
withEquityCashFlow = ForeignPtr CEquityCashFlow'
-> (Ptr CEquityCashFlow' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CEquityCashFlow'
 -> (Ptr CEquityCashFlow' -> IO b) -> IO b)
-> (EquityCashFlow -> ForeignPtr CEquityCashFlow')
-> EquityCashFlow
-> (Ptr CEquityCashFlow' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CEquityCashFlow') CIndexedCashFlow'
-> ForeignPtr CEquityCashFlow'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CEquityCashFlow') CIndexedCashFlow'
 -> ForeignPtr CEquityCashFlow')
-> (EquityCashFlow
    -> GenForeignPtr (ForeignPtr CEquityCashFlow') CIndexedCashFlow')
-> EquityCashFlow
-> ForeignPtr CEquityCashFlow'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CIndexedCashFlow' (ForeignPtr CEquityCashFlow')) CCashFlow'
-> GenForeignPtr (ForeignPtr CEquityCashFlow') CIndexedCashFlow'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CIndexedCashFlow' (ForeignPtr CEquityCashFlow')) CCashFlow'
 -> GenForeignPtr (ForeignPtr CEquityCashFlow') CIndexedCashFlow')
-> (EquityCashFlow
    -> GenForeignPtr
         (AnyOf CIndexedCashFlow' (ForeignPtr CEquityCashFlow')) CCashFlow')
-> EquityCashFlow
-> GenForeignPtr (ForeignPtr CEquityCashFlow') CIndexedCashFlow'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EquityCashFlow
-> GenForeignPtr
     (AnyOf CIndexedCashFlow' (ForeignPtr CEquityCashFlow')) CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow

-- | > Leg
-- >   CouponLeg
newtype GenLeg l = GenLeg {forall l. GenLeg l -> GenForeignPtr l CLeg'
getLeg :: GenForeignPtr l CLeg'}
type CLeg = ForeignPtr CLeg'
-- |The root of the hierarchy shown under t'GenLeg'.
type Leg = GenLeg CLeg
type CCouponLeg = ForeignPtr CCouponLeg'
-- |A 'Leg'; see the hierarchy under t'GenLeg'.
type CouponLeg = GenLeg CCouponLeg
foreign import ccall unsafe "ql.h &qlFreeLeg" qlFreeLeg :: FinalizerPtr CLeg'
foreign import ccall unsafe "ql.h &qlFreeCouponLeg" qlFreeCouponLeg :: FinalizerPtr CCouponLeg'
instance Finalizable CLeg' where finalize :: FinalizerPtr CLeg'
finalize = FinalizerPtr CLeg'
qlFreeLeg
instance Finalizable CCouponLeg' where finalize :: FinalizerPtr CCouponLeg'
finalize = FinalizerPtr CCouponLeg'
qlFreeCouponLeg
foreign import ccall "ql.h qlCouponLegAsLeg" qlCouponLegAsLeg :: Ptr CCouponLeg' -> IO (Ptr CLeg')
instance Upcastable CCouponLeg' where {type Base CCouponLeg' = CLeg'; upcast :: Ptr CCouponLeg' -> IO (Ptr (Base CCouponLeg'))
upcast = Ptr CCouponLeg' -> IO (Ptr CLeg')
Ptr CCouponLeg' -> IO (Ptr (Base CCouponLeg'))
qlCouponLegAsLeg}
asLeg :: GenLeg l -> IO Leg
asLeg :: forall l. GenLeg l -> IO Leg
asLeg = (Ptr CLeg' -> IO Leg) -> GenForeignPtr l CLeg' -> IO Leg
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CLeg' -> IO Leg
peekLeg (GenForeignPtr l CLeg' -> IO Leg)
-> (GenLeg l -> GenForeignPtr l CLeg') -> GenLeg l -> IO Leg
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenLeg l -> GenForeignPtr l CLeg'
forall l. GenLeg l -> GenForeignPtr l CLeg'
getLeg
peekLeg :: Ptr CLeg' -> IO Leg
peekLeg :: Ptr CLeg' -> IO Leg
peekLeg = GenForeignPtr CLeg CLeg' -> Leg
forall l. GenForeignPtr l CLeg' -> GenLeg l
GenLeg (GenForeignPtr CLeg CLeg' -> Leg)
-> (Ptr CLeg' -> IO (GenForeignPtr CLeg CLeg'))
-> Ptr CLeg'
-> IO Leg
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CLeg' -> IO (GenForeignPtr CLeg CLeg')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr
withLeg :: GenLeg l -> (Ptr CLeg' -> IO b) -> IO b
withLeg :: forall l b. GenLeg l -> (Ptr CLeg' -> IO b) -> IO b
withLeg = GenForeignPtr l CLeg' -> (Ptr CLeg' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr l CLeg' -> (Ptr CLeg' -> IO b) -> IO b)
-> (GenLeg l -> GenForeignPtr l CLeg')
-> GenLeg l
-> (Ptr CLeg' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenLeg l -> GenForeignPtr l CLeg'
forall l. GenLeg l -> GenForeignPtr l CLeg'
getLeg
withLegArray :: [GenLeg l] -> ((CUInt, Ptr (Ptr CLeg')) -> IO b) -> IO b
withLegArray :: forall l b.
[GenLeg l] -> ((CUInt, Ptr (Ptr CLeg')) -> IO b) -> IO b
withLegArray = (GenLeg l -> (Ptr CLeg' -> IO b) -> IO b)
-> [GenLeg l] -> ((CUInt, Ptr (Ptr CLeg')) -> IO b) -> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray GenLeg l -> (Ptr CLeg' -> IO b) -> IO b
forall l b. GenLeg l -> (Ptr CLeg' -> IO b) -> IO b
withLeg
withGenLeg :: GenLeg (ForeignPtr l) -> (Ptr l -> IO b) -> IO b
withGenLeg :: forall l b. GenLeg (ForeignPtr l) -> (Ptr l -> IO b) -> IO b
withGenLeg = ForeignPtr l -> (Ptr l -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr l -> (Ptr l -> IO b) -> IO b)
-> (GenLeg (ForeignPtr l) -> ForeignPtr l)
-> GenLeg (ForeignPtr l)
-> (Ptr l -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr l) CLeg' -> ForeignPtr l
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr l) CLeg' -> ForeignPtr l)
-> (GenLeg (ForeignPtr l) -> GenForeignPtr (ForeignPtr l) CLeg')
-> GenLeg (ForeignPtr l)
-> ForeignPtr l
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenLeg (ForeignPtr l) -> GenForeignPtr (ForeignPtr l) CLeg'
forall l. GenLeg l -> GenForeignPtr l CLeg'
getLeg
peekCouponLeg :: Ptr CCouponLeg' -> IO CouponLeg
peekCouponLeg :: Ptr CCouponLeg' -> IO CouponLeg
peekCouponLeg = GenForeignPtr CCouponLeg CLeg' -> CouponLeg
forall l. GenForeignPtr l CLeg' -> GenLeg l
GenLeg (GenForeignPtr CCouponLeg CLeg' -> CouponLeg)
-> (Ptr CCouponLeg' -> IO (GenForeignPtr CCouponLeg CLeg'))
-> Ptr CCouponLeg'
-> IO CouponLeg
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCouponLeg' -> IO (GenForeignPtr CCouponLeg CLeg')
Ptr CCouponLeg' -> IO (GenForeignPtr CCouponLeg (Base CCouponLeg'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr

-- |The root of the hierarchy shown under t'GenRateHelper'.
type RateHelper = GenRateHelper CRateHelper
data CRateHelper'
-- | > RateHelper
-- >   BondHelper
-- >   SwapRateHelper
-- >   OISRateHelper
-- >   FuturesRateHelper
-- >   OvernightIndexFutureRateHelper
newtype GenRateHelper rh = GenRateHelper {forall rh. GenRateHelper rh -> GenForeignPtr rh CRateHelper'
getRateHelper :: GenForeignPtr rh CRateHelper'}
type CRateHelper = ForeignPtr CRateHelper'
foreign import ccall unsafe "ql.h &qlFreeRateHelper" qlFreeRateHelper :: FinalizerPtr CRateHelper'
instance Finalizable CRateHelper' where finalize :: FinalizerPtr CRateHelper'
finalize = FinalizerPtr CRateHelper'
qlFreeRateHelper
asRateHelper :: GenRateHelper rh -> IO RateHelper
asRateHelper :: forall rh. GenRateHelper rh -> IO RateHelper
asRateHelper = (Ptr CRateHelper' -> IO RateHelper)
-> GenForeignPtr rh CRateHelper' -> IO RateHelper
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CRateHelper' -> IO RateHelper
peekRateHelper (GenForeignPtr rh CRateHelper' -> IO RateHelper)
-> (GenRateHelper rh -> GenForeignPtr rh CRateHelper')
-> GenRateHelper rh
-> IO RateHelper
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenRateHelper rh -> GenForeignPtr rh CRateHelper'
forall rh. GenRateHelper rh -> GenForeignPtr rh CRateHelper'
getRateHelper
peekRateHelper :: Ptr CRateHelper' -> IO RateHelper
peekRateHelper :: Ptr CRateHelper' -> IO RateHelper
peekRateHelper = GenForeignPtr CRateHelper CRateHelper' -> RateHelper
forall rh. GenForeignPtr rh CRateHelper' -> GenRateHelper rh
GenRateHelper (GenForeignPtr CRateHelper CRateHelper' -> RateHelper)
-> (Ptr CRateHelper'
    -> IO (GenForeignPtr CRateHelper CRateHelper'))
-> Ptr CRateHelper'
-> IO RateHelper
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CRateHelper' -> IO (GenForeignPtr CRateHelper CRateHelper')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr
withRateHelper :: GenRateHelper rh -> (Ptr CRateHelper' -> IO b) -> IO b
withRateHelper :: forall rh b. GenRateHelper rh -> (Ptr CRateHelper' -> IO b) -> IO b
withRateHelper = GenForeignPtr rh CRateHelper' -> (Ptr CRateHelper' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr rh CRateHelper'
 -> (Ptr CRateHelper' -> IO b) -> IO b)
-> (GenRateHelper rh -> GenForeignPtr rh CRateHelper')
-> GenRateHelper rh
-> (Ptr CRateHelper' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenRateHelper rh -> GenForeignPtr rh CRateHelper'
forall rh. GenRateHelper rh -> GenForeignPtr rh CRateHelper'
getRateHelper
withGenRateHelper :: GenRateHelper (ForeignPtr rh) -> (Ptr rh -> IO b) -> IO b
withGenRateHelper :: forall rh b.
GenRateHelper (ForeignPtr rh) -> (Ptr rh -> IO b) -> IO b
withGenRateHelper = ForeignPtr rh -> (Ptr rh -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr rh -> (Ptr rh -> IO b) -> IO b)
-> (GenRateHelper (ForeignPtr rh) -> ForeignPtr rh)
-> GenRateHelper (ForeignPtr rh)
-> (Ptr rh -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr rh) CRateHelper' -> ForeignPtr rh
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr rh) CRateHelper' -> ForeignPtr rh)
-> (GenRateHelper (ForeignPtr rh)
    -> GenForeignPtr (ForeignPtr rh) CRateHelper')
-> GenRateHelper (ForeignPtr rh)
-> ForeignPtr rh
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenRateHelper (ForeignPtr rh)
-> GenForeignPtr (ForeignPtr rh) CRateHelper'
forall rh. GenRateHelper rh -> GenForeignPtr rh CRateHelper'
getRateHelper
withRateHelperArray :: [GenRateHelper rh] -> ((CUInt, Ptr (Ptr CRateHelper')) -> IO b) -> IO b
withRateHelperArray :: forall rh b.
[GenRateHelper rh]
-> ((CUInt, Ptr (Ptr CRateHelper')) -> IO b) -> IO b
withRateHelperArray = (GenRateHelper rh -> (Ptr CRateHelper' -> IO b) -> IO b)
-> [GenRateHelper rh]
-> ((CUInt, Ptr (Ptr CRateHelper')) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray GenRateHelper rh -> (Ptr CRateHelper' -> IO b) -> IO b
forall rh b. GenRateHelper rh -> (Ptr CRateHelper' -> IO b) -> IO b
withRateHelper
data CBondHelper'
type CBondHelper = ForeignPtr CBondHelper'
-- |A 'RateHelper'; see the hierarchy under t'GenRateHelper'.
type BondHelper = GenRateHelper CBondHelper
foreign import ccall unsafe "ql.h &qlFreeBondHelper" qlFreeBondHelper :: FinalizerPtr CBondHelper'
instance Finalizable CBondHelper' where finalize :: FinalizerPtr CBondHelper'
finalize = FinalizerPtr CBondHelper'
qlFreeBondHelper
foreign import ccall "ql.h qlBondHelperAsRateHelper" qlBondHelperAsRateHelper :: Ptr CBondHelper' -> IO (Ptr CRateHelper')
instance Upcastable CBondHelper' where {type Base CBondHelper' = CRateHelper'; upcast :: Ptr CBondHelper' -> IO (Ptr (Base CBondHelper'))
upcast = Ptr CBondHelper' -> IO (Ptr CRateHelper')
Ptr CBondHelper' -> IO (Ptr (Base CBondHelper'))
qlBondHelperAsRateHelper}
peekBondHelper :: Ptr CBondHelper' -> IO BondHelper
peekBondHelper :: Ptr CBondHelper' -> IO BondHelper
peekBondHelper = GenForeignPtr CBondHelper CRateHelper' -> BondHelper
forall rh. GenForeignPtr rh CRateHelper' -> GenRateHelper rh
GenRateHelper (GenForeignPtr CBondHelper CRateHelper' -> BondHelper)
-> (Ptr CBondHelper'
    -> IO (GenForeignPtr CBondHelper CRateHelper'))
-> Ptr CBondHelper'
-> IO BondHelper
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CBondHelper' -> IO (GenForeignPtr CBondHelper CRateHelper')
Ptr CBondHelper'
-> IO (GenForeignPtr CBondHelper (Base CBondHelper'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
withBondHelperArray :: [BondHelper] -> ((CUInt, Ptr (Ptr CBondHelper')) -> IO b) -> IO b
withBondHelperArray :: forall b.
[BondHelper] -> ((CUInt, Ptr (Ptr CBondHelper')) -> IO b) -> IO b
withBondHelperArray = (BondHelper -> (Ptr CBondHelper' -> IO b) -> IO b)
-> [BondHelper]
-> ((CUInt, Ptr (Ptr CBondHelper')) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray BondHelper -> (Ptr CBondHelper' -> IO b) -> IO b
forall rh b.
GenRateHelper (ForeignPtr rh) -> (Ptr rh -> IO b) -> IO b
withGenRateHelper
data CSwapRateHelper'
type CSwapRateHelper = ForeignPtr CSwapRateHelper'
-- |A 'RateHelper'; see the hierarchy under t'GenRateHelper'.
type SwapRateHelper = GenRateHelper CSwapRateHelper
foreign import ccall unsafe "ql.h &qlFreeSwapRateHelper" qlFreeSwapRateHelper :: FinalizerPtr CSwapRateHelper'
instance Finalizable CSwapRateHelper' where finalize :: FinalizerPtr CSwapRateHelper'
finalize = FinalizerPtr CSwapRateHelper'
qlFreeSwapRateHelper
foreign import ccall "ql.h qlSwapRateHelperAsRateHelper" qlSwapRateHelperAsRateHelper :: Ptr CSwapRateHelper' -> IO (Ptr CRateHelper')
instance Upcastable CSwapRateHelper' where {type Base CSwapRateHelper' = CRateHelper'; upcast :: Ptr CSwapRateHelper' -> IO (Ptr (Base CSwapRateHelper'))
upcast = Ptr CSwapRateHelper' -> IO (Ptr CRateHelper')
Ptr CSwapRateHelper' -> IO (Ptr (Base CSwapRateHelper'))
qlSwapRateHelperAsRateHelper}
peekSwapRateHelper :: Ptr CSwapRateHelper' -> IO SwapRateHelper
peekSwapRateHelper :: Ptr CSwapRateHelper' -> IO SwapRateHelper
peekSwapRateHelper = GenForeignPtr CSwapRateHelper CRateHelper' -> SwapRateHelper
forall rh. GenForeignPtr rh CRateHelper' -> GenRateHelper rh
GenRateHelper (GenForeignPtr CSwapRateHelper CRateHelper' -> SwapRateHelper)
-> (Ptr CSwapRateHelper'
    -> IO (GenForeignPtr CSwapRateHelper CRateHelper'))
-> Ptr CSwapRateHelper'
-> IO SwapRateHelper
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CSwapRateHelper'
-> IO (GenForeignPtr CSwapRateHelper CRateHelper')
Ptr CSwapRateHelper'
-> IO (GenForeignPtr CSwapRateHelper (Base CSwapRateHelper'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
data COISRateHelper'
type COISRateHelper = ForeignPtr COISRateHelper'
-- |A 'RateHelper'; see the hierarchy under t'GenRateHelper'.
type OISRateHelper = GenRateHelper COISRateHelper
foreign import ccall unsafe "ql.h &qlFreeOISRateHelper" qlFreeOISRateHelper :: FinalizerPtr COISRateHelper'
instance Finalizable COISRateHelper' where finalize :: FinalizerPtr COISRateHelper'
finalize = FinalizerPtr COISRateHelper'
qlFreeOISRateHelper
foreign import ccall "ql.h qlOISRateHelperAsRateHelper" qlOISRateHelperAsRateHelper :: Ptr COISRateHelper' -> IO (Ptr CRateHelper')
instance Upcastable COISRateHelper' where {type Base COISRateHelper' = CRateHelper'; upcast :: Ptr COISRateHelper' -> IO (Ptr (Base COISRateHelper'))
upcast = Ptr COISRateHelper' -> IO (Ptr CRateHelper')
Ptr COISRateHelper' -> IO (Ptr (Base COISRateHelper'))
qlOISRateHelperAsRateHelper}
peekOISRateHelper :: Ptr COISRateHelper' -> IO OISRateHelper
peekOISRateHelper :: Ptr COISRateHelper' -> IO OISRateHelper
peekOISRateHelper = GenForeignPtr COISRateHelper CRateHelper' -> OISRateHelper
forall rh. GenForeignPtr rh CRateHelper' -> GenRateHelper rh
GenRateHelper (GenForeignPtr COISRateHelper CRateHelper' -> OISRateHelper)
-> (Ptr COISRateHelper'
    -> IO (GenForeignPtr COISRateHelper CRateHelper'))
-> Ptr COISRateHelper'
-> IO OISRateHelper
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr COISRateHelper'
-> IO (GenForeignPtr COISRateHelper CRateHelper')
Ptr COISRateHelper'
-> IO (GenForeignPtr COISRateHelper (Base COISRateHelper'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
data CFuturesRateHelper'
type CFuturesRateHelper = ForeignPtr CFuturesRateHelper'
-- |A 'RateHelper'; see the hierarchy under t'GenRateHelper'.
type FuturesRateHelper = GenRateHelper CFuturesRateHelper
foreign import ccall unsafe "ql.h &qlFreeFuturesRateHelper" qlFreeFuturesRateHelper :: FinalizerPtr CFuturesRateHelper'
instance Finalizable CFuturesRateHelper' where finalize :: FinalizerPtr CFuturesRateHelper'
finalize = FinalizerPtr CFuturesRateHelper'
qlFreeFuturesRateHelper
foreign import ccall "ql.h qlFuturesRateHelperAsRateHelper" qlFuturesRateHelperAsRateHelper :: Ptr CFuturesRateHelper' -> IO (Ptr CRateHelper')
instance Upcastable CFuturesRateHelper' where {type Base CFuturesRateHelper' = CRateHelper'; upcast :: Ptr CFuturesRateHelper' -> IO (Ptr (Base CFuturesRateHelper'))
upcast = Ptr CFuturesRateHelper' -> IO (Ptr CRateHelper')
Ptr CFuturesRateHelper' -> IO (Ptr (Base CFuturesRateHelper'))
qlFuturesRateHelperAsRateHelper}
peekFuturesRateHelper :: Ptr CFuturesRateHelper' -> IO FuturesRateHelper
peekFuturesRateHelper :: Ptr CFuturesRateHelper' -> IO FuturesRateHelper
peekFuturesRateHelper = GenForeignPtr CFuturesRateHelper CRateHelper' -> FuturesRateHelper
forall rh. GenForeignPtr rh CRateHelper' -> GenRateHelper rh
GenRateHelper (GenForeignPtr CFuturesRateHelper CRateHelper'
 -> FuturesRateHelper)
-> (Ptr CFuturesRateHelper'
    -> IO (GenForeignPtr CFuturesRateHelper CRateHelper'))
-> Ptr CFuturesRateHelper'
-> IO FuturesRateHelper
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CFuturesRateHelper'
-> IO (GenForeignPtr CFuturesRateHelper CRateHelper')
Ptr CFuturesRateHelper'
-> IO (GenForeignPtr CFuturesRateHelper (Base CFuturesRateHelper'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
data COvernightIndexFutureRateHelper'
type COvernightIndexFutureRateHelper = ForeignPtr COvernightIndexFutureRateHelper'
-- |A 'RateHelper'; see the hierarchy under t'GenRateHelper'.
type OvernightIndexFutureRateHelper = GenRateHelper COvernightIndexFutureRateHelper
foreign import ccall unsafe "ql.h &qlFreeOvernightIndexFutureRateHelper" qlFreeOvernightIndexFutureRateHelper :: FinalizerPtr COvernightIndexFutureRateHelper'
instance Finalizable COvernightIndexFutureRateHelper' where finalize :: FinalizerPtr COvernightIndexFutureRateHelper'
finalize = FinalizerPtr COvernightIndexFutureRateHelper'
qlFreeOvernightIndexFutureRateHelper
foreign import ccall "ql.h qlOvernightIndexFutureRateHelperAsRateHelper" qlOvernightIndexFutureRateHelperAsRateHelper :: Ptr COvernightIndexFutureRateHelper' -> IO (Ptr CRateHelper')
instance Upcastable COvernightIndexFutureRateHelper' where {type Base COvernightIndexFutureRateHelper' = CRateHelper'; upcast :: Ptr COvernightIndexFutureRateHelper'
-> IO (Ptr (Base COvernightIndexFutureRateHelper'))
upcast = Ptr COvernightIndexFutureRateHelper' -> IO (Ptr CRateHelper')
Ptr COvernightIndexFutureRateHelper'
-> IO (Ptr (Base COvernightIndexFutureRateHelper'))
qlOvernightIndexFutureRateHelperAsRateHelper}
peekOvernightIndexFutureRateHelper :: Ptr COvernightIndexFutureRateHelper' -> IO OvernightIndexFutureRateHelper
peekOvernightIndexFutureRateHelper :: Ptr COvernightIndexFutureRateHelper'
-> IO OvernightIndexFutureRateHelper
peekOvernightIndexFutureRateHelper = GenForeignPtr COvernightIndexFutureRateHelper CRateHelper'
-> OvernightIndexFutureRateHelper
forall rh. GenForeignPtr rh CRateHelper' -> GenRateHelper rh
GenRateHelper (GenForeignPtr COvernightIndexFutureRateHelper CRateHelper'
 -> OvernightIndexFutureRateHelper)
-> (Ptr COvernightIndexFutureRateHelper'
    -> IO (GenForeignPtr COvernightIndexFutureRateHelper CRateHelper'))
-> Ptr COvernightIndexFutureRateHelper'
-> IO OvernightIndexFutureRateHelper
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr COvernightIndexFutureRateHelper'
-> IO (GenForeignPtr COvernightIndexFutureRateHelper CRateHelper')
Ptr COvernightIndexFutureRateHelper'
-> IO
     (GenForeignPtr
        COvernightIndexFutureRateHelper
        (Base COvernightIndexFutureRateHelper'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr

-- |The root of the hierarchy shown under t'GenCalibrationHelper'.
type CalibrationHelper = GenCalibrationHelper CCalibrationHelper

-- BlackCalibrationHelper is a proper one-AnyOf-layer family (mirrors GenSwap/GenOption under
-- GenInstrument), not a plain leaf directly under CalibrationHelper, so a concrete subtype
-- (SwaptionHelper) can be given its own getters without a runtime cast: SwaptionHelper's
-- own underlying()/swaption() need the real SwaptionHelper pointer, while the
-- BlackCalibrationHelper-level accessors (times, blackPrice, impliedVolatility, ...) are
-- generalized to 'GenBlackCalibrationHelper bch' so they keep working on any leaf, SwaptionHelper
-- included, without an explicit upcast at each call site.
data CCalibrationHelper'
data CBlackCalibrationHelper'
-- | > CalibrationHelper
-- >   BlackCalibrationHelper*
-- >     SwaptionHelper
newtype GenCalibrationHelper ch = GenCalibrationHelper {forall ch.
GenCalibrationHelper ch -> GenForeignPtr ch CCalibrationHelper'
getCalibrationHelper :: GenForeignPtr ch CCalibrationHelper'}
type CCalibrationHelper = ForeignPtr CCalibrationHelper'
-- |A 'BlackCalibrationHelper' or one of its leaves; see the hierarchy under t'GenCalibrationHelper'.
type GenBlackCalibrationHelper bch = GenCalibrationHelper (AnyOf CBlackCalibrationHelper' bch)
type CBlackCalibrationHelper = ForeignPtr CBlackCalibrationHelper'
-- |A 'CalibrationHelper'; see the hierarchy under t'GenCalibrationHelper'.
type BlackCalibrationHelper = GenBlackCalibrationHelper CBlackCalibrationHelper
foreign import ccall unsafe "ql.h &qlFreeCalibrationHelper" qlFreeCalibrationHelper :: FinalizerPtr CCalibrationHelper'
foreign import ccall unsafe "ql.h &qlFreeBlackCalibrationHelper" qlFreeBlackCalibrationHelper :: FinalizerPtr CBlackCalibrationHelper'
instance Finalizable CCalibrationHelper' where finalize :: FinalizerPtr CCalibrationHelper'
finalize = FinalizerPtr CCalibrationHelper'
qlFreeCalibrationHelper
instance Finalizable CBlackCalibrationHelper' where finalize :: FinalizerPtr CBlackCalibrationHelper'
finalize = FinalizerPtr CBlackCalibrationHelper'
qlFreeBlackCalibrationHelper
foreign import ccall "ql.h qlBlackCalibrationHelperAsCalibrationHelper" qlBlackCalibrationHelperAsCalibrationHelper :: Ptr CBlackCalibrationHelper' -> IO (Ptr CCalibrationHelper')
instance Upcastable CBlackCalibrationHelper' where {type Base CBlackCalibrationHelper' = CCalibrationHelper'; upcast :: Ptr CBlackCalibrationHelper'
-> IO (Ptr (Base CBlackCalibrationHelper'))
upcast = Ptr CBlackCalibrationHelper' -> IO (Ptr CCalibrationHelper')
Ptr CBlackCalibrationHelper'
-> IO (Ptr (Base CBlackCalibrationHelper'))
qlBlackCalibrationHelperAsCalibrationHelper}
asCalibrationHelper :: GenCalibrationHelper ch -> IO CalibrationHelper
asCalibrationHelper :: forall ch. GenCalibrationHelper ch -> IO CalibrationHelper
asCalibrationHelper = (Ptr CCalibrationHelper' -> IO CalibrationHelper)
-> GenForeignPtr ch CCalibrationHelper' -> IO CalibrationHelper
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CCalibrationHelper' -> IO CalibrationHelper
peekCalibrationHelper (GenForeignPtr ch CCalibrationHelper' -> IO CalibrationHelper)
-> (GenCalibrationHelper ch
    -> GenForeignPtr ch CCalibrationHelper')
-> GenCalibrationHelper ch
-> IO CalibrationHelper
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenCalibrationHelper ch -> GenForeignPtr ch CCalibrationHelper'
forall ch.
GenCalibrationHelper ch -> GenForeignPtr ch CCalibrationHelper'
getCalibrationHelper
peekCalibrationHelper :: Ptr CCalibrationHelper' -> IO CalibrationHelper
peekCalibrationHelper :: Ptr CCalibrationHelper' -> IO CalibrationHelper
peekCalibrationHelper = GenForeignPtr CCalibrationHelper CCalibrationHelper'
-> CalibrationHelper
forall ch.
GenForeignPtr ch CCalibrationHelper' -> GenCalibrationHelper ch
GenCalibrationHelper (GenForeignPtr CCalibrationHelper CCalibrationHelper'
 -> CalibrationHelper)
-> (Ptr CCalibrationHelper'
    -> IO (GenForeignPtr CCalibrationHelper CCalibrationHelper'))
-> Ptr CCalibrationHelper'
-> IO CalibrationHelper
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCalibrationHelper'
-> IO (GenForeignPtr CCalibrationHelper CCalibrationHelper')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr
withCalibrationHelper :: GenCalibrationHelper ch -> (Ptr CCalibrationHelper' -> IO b) -> IO b
withCalibrationHelper :: forall ch b.
GenCalibrationHelper ch
-> (Ptr CCalibrationHelper' -> IO b) -> IO b
withCalibrationHelper = GenForeignPtr ch CCalibrationHelper'
-> (Ptr CCalibrationHelper' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr ch CCalibrationHelper'
 -> (Ptr CCalibrationHelper' -> IO b) -> IO b)
-> (GenCalibrationHelper ch
    -> GenForeignPtr ch CCalibrationHelper')
-> GenCalibrationHelper ch
-> (Ptr CCalibrationHelper' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenCalibrationHelper ch -> GenForeignPtr ch CCalibrationHelper'
forall ch.
GenCalibrationHelper ch -> GenForeignPtr ch CCalibrationHelper'
getCalibrationHelper
-- hands back the raw stored leaf pointer (e.g. Ptr CSwaptionHelper'); for a marshaller that
-- upcasts to the concrete Ptr CBlackCalibrationHelper', see 'withBlackCalibrationHelper' below.
withGenCalibrationHelper :: GenBlackCalibrationHelper (ForeignPtr ch) -> (Ptr ch -> IO b) -> IO b
withGenCalibrationHelper :: forall ch b.
GenBlackCalibrationHelper (ForeignPtr ch)
-> (Ptr ch -> IO b) -> IO b
withGenCalibrationHelper = ForeignPtr ch -> (Ptr ch -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr ch -> (Ptr ch -> IO b) -> IO b)
-> (GenBlackCalibrationHelper (ForeignPtr ch) -> ForeignPtr ch)
-> GenBlackCalibrationHelper (ForeignPtr ch)
-> (Ptr ch -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr ch) CBlackCalibrationHelper'
-> ForeignPtr ch
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr ch) CBlackCalibrationHelper'
 -> ForeignPtr ch)
-> (GenBlackCalibrationHelper (ForeignPtr ch)
    -> GenForeignPtr (ForeignPtr ch) CBlackCalibrationHelper')
-> GenBlackCalibrationHelper (ForeignPtr ch)
-> ForeignPtr ch
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackCalibrationHelper' (ForeignPtr ch))
  CCalibrationHelper'
-> GenForeignPtr (ForeignPtr ch) CBlackCalibrationHelper'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBlackCalibrationHelper' (ForeignPtr ch))
   CCalibrationHelper'
 -> GenForeignPtr (ForeignPtr ch) CBlackCalibrationHelper')
-> (GenBlackCalibrationHelper (ForeignPtr ch)
    -> GenForeignPtr
         (AnyOf CBlackCalibrationHelper' (ForeignPtr ch))
         CCalibrationHelper')
-> GenBlackCalibrationHelper (ForeignPtr ch)
-> GenForeignPtr (ForeignPtr ch) CBlackCalibrationHelper'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBlackCalibrationHelper (ForeignPtr ch)
-> GenForeignPtr
     (AnyOf CBlackCalibrationHelper' (ForeignPtr ch))
     CCalibrationHelper'
forall ch.
GenCalibrationHelper ch -> GenForeignPtr ch CCalibrationHelper'
getCalibrationHelper
asBlackCalibrationHelper :: GenBlackCalibrationHelper bch -> IO BlackCalibrationHelper
asBlackCalibrationHelper :: forall bch.
GenBlackCalibrationHelper bch -> IO BlackCalibrationHelper
asBlackCalibrationHelper = (Ptr CBlackCalibrationHelper' -> IO BlackCalibrationHelper)
-> GenForeignPtr bch CBlackCalibrationHelper'
-> IO BlackCalibrationHelper
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CBlackCalibrationHelper' -> IO BlackCalibrationHelper
peekBlackCalibrationHelper (GenForeignPtr bch CBlackCalibrationHelper'
 -> IO BlackCalibrationHelper)
-> (GenBlackCalibrationHelper bch
    -> GenForeignPtr bch CBlackCalibrationHelper')
-> GenBlackCalibrationHelper bch
-> IO BlackCalibrationHelper
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackCalibrationHelper' bch) CCalibrationHelper'
-> GenForeignPtr bch CBlackCalibrationHelper'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBlackCalibrationHelper' bch) CCalibrationHelper'
 -> GenForeignPtr bch CBlackCalibrationHelper')
-> (GenBlackCalibrationHelper bch
    -> GenForeignPtr
         (AnyOf CBlackCalibrationHelper' bch) CCalibrationHelper')
-> GenBlackCalibrationHelper bch
-> GenForeignPtr bch CBlackCalibrationHelper'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBlackCalibrationHelper bch
-> GenForeignPtr
     (AnyOf CBlackCalibrationHelper' bch) CCalibrationHelper'
forall ch.
GenCalibrationHelper ch -> GenForeignPtr ch CCalibrationHelper'
getCalibrationHelper
peekBlackCalibrationHelper :: Ptr CBlackCalibrationHelper' -> IO BlackCalibrationHelper
peekBlackCalibrationHelper :: Ptr CBlackCalibrationHelper' -> IO BlackCalibrationHelper
peekBlackCalibrationHelper = Ptr CBlackCalibrationHelper'
-> IO
     (GenForeignPtr
        (ForeignPtr CBlackCalibrationHelper') CBlackCalibrationHelper')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CBlackCalibrationHelper'
 -> IO
      (GenForeignPtr
         (ForeignPtr CBlackCalibrationHelper') CBlackCalibrationHelper'))
-> (GenForeignPtr
      (ForeignPtr CBlackCalibrationHelper') CBlackCalibrationHelper'
    -> IO BlackCalibrationHelper)
-> Ptr CBlackCalibrationHelper'
-> IO BlackCalibrationHelper
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CBlackCalibrationHelper') CBlackCalibrationHelper'
-> IO BlackCalibrationHelper
forall bch.
GenForeignPtr bch CBlackCalibrationHelper'
-> IO (GenBlackCalibrationHelper bch)
newGenBlackCalibrationHelper
withBlackCalibrationHelper :: GenBlackCalibrationHelper bch -> (Ptr CBlackCalibrationHelper' -> IO b) -> IO b
withBlackCalibrationHelper :: forall bch b.
GenBlackCalibrationHelper bch
-> (Ptr CBlackCalibrationHelper' -> IO b) -> IO b
withBlackCalibrationHelper = GenForeignPtr bch CBlackCalibrationHelper'
-> (Ptr CBlackCalibrationHelper' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr bch CBlackCalibrationHelper'
 -> (Ptr CBlackCalibrationHelper' -> IO b) -> IO b)
-> (GenBlackCalibrationHelper bch
    -> GenForeignPtr bch CBlackCalibrationHelper')
-> GenBlackCalibrationHelper bch
-> (Ptr CBlackCalibrationHelper' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackCalibrationHelper' bch) CCalibrationHelper'
-> GenForeignPtr bch CBlackCalibrationHelper'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBlackCalibrationHelper' bch) CCalibrationHelper'
 -> GenForeignPtr bch CBlackCalibrationHelper')
-> (GenBlackCalibrationHelper bch
    -> GenForeignPtr
         (AnyOf CBlackCalibrationHelper' bch) CCalibrationHelper')
-> GenBlackCalibrationHelper bch
-> GenForeignPtr bch CBlackCalibrationHelper'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBlackCalibrationHelper bch
-> GenForeignPtr
     (AnyOf CBlackCalibrationHelper' bch) CCalibrationHelper'
forall ch.
GenCalibrationHelper ch -> GenForeignPtr ch CCalibrationHelper'
getCalibrationHelper
newGenBlackCalibrationHelper :: GenForeignPtr bch CBlackCalibrationHelper' -> IO (GenBlackCalibrationHelper bch)
newGenBlackCalibrationHelper :: forall bch.
GenForeignPtr bch CBlackCalibrationHelper'
-> IO (GenBlackCalibrationHelper bch)
newGenBlackCalibrationHelper = GenBlackCalibrationHelper bch -> IO (GenBlackCalibrationHelper bch)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenBlackCalibrationHelper bch
 -> IO (GenBlackCalibrationHelper bch))
-> (GenForeignPtr bch CBlackCalibrationHelper'
    -> GenBlackCalibrationHelper bch)
-> GenForeignPtr bch CBlackCalibrationHelper'
-> IO (GenBlackCalibrationHelper bch)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackCalibrationHelper' bch) CCalibrationHelper'
-> GenBlackCalibrationHelper bch
forall ch.
GenForeignPtr ch CCalibrationHelper' -> GenCalibrationHelper ch
GenCalibrationHelper (GenForeignPtr
   (AnyOf CBlackCalibrationHelper' bch) CCalibrationHelper'
 -> GenBlackCalibrationHelper bch)
-> (GenForeignPtr bch CBlackCalibrationHelper'
    -> GenForeignPtr
         (AnyOf CBlackCalibrationHelper' bch) CCalibrationHelper')
-> GenForeignPtr bch CBlackCalibrationHelper'
-> GenBlackCalibrationHelper bch
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr bch CBlackCalibrationHelper'
-> GenForeignPtr
     (AnyOf CBlackCalibrationHelper' bch) CCalibrationHelper'
GenForeignPtr bch CBlackCalibrationHelper'
-> GenForeignPtr
     (AnyOf CBlackCalibrationHelper' bch)
     (Base CBlackCalibrationHelper')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
withCalibrationHelperArray :: [GenCalibrationHelper ch] -> ((CUInt, Ptr (Ptr CCalibrationHelper')) -> IO b) -> IO b
withCalibrationHelperArray :: forall ch b.
[GenCalibrationHelper ch]
-> ((CUInt, Ptr (Ptr CCalibrationHelper')) -> IO b) -> IO b
withCalibrationHelperArray = (GenCalibrationHelper ch
 -> (Ptr CCalibrationHelper' -> IO b) -> IO b)
-> [GenCalibrationHelper ch]
-> ((CUInt, Ptr (Ptr CCalibrationHelper')) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray GenCalibrationHelper ch
-> (Ptr CCalibrationHelper' -> IO b) -> IO b
forall ch b.
GenCalibrationHelper ch
-> (Ptr CCalibrationHelper' -> IO b) -> IO b
withCalibrationHelper
withBlackCalibrationHelperArray :: [GenBlackCalibrationHelper bch] -> ((CUInt, Ptr (Ptr CBlackCalibrationHelper')) -> IO b) -> IO b
withBlackCalibrationHelperArray :: forall bch b.
[GenBlackCalibrationHelper bch]
-> ((CUInt, Ptr (Ptr CBlackCalibrationHelper')) -> IO b) -> IO b
withBlackCalibrationHelperArray = (GenBlackCalibrationHelper bch
 -> (Ptr CBlackCalibrationHelper' -> IO b) -> IO b)
-> [GenBlackCalibrationHelper bch]
-> ((CUInt, Ptr (Ptr CBlackCalibrationHelper')) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray GenBlackCalibrationHelper bch
-> (Ptr CBlackCalibrationHelper' -> IO b) -> IO b
forall bch b.
GenBlackCalibrationHelper bch
-> (Ptr CBlackCalibrationHelper' -> IO b) -> IO b
withBlackCalibrationHelper
peekBlackCalibrationHelperArray :: Ptr CUInt -> Ptr (Ptr (Ptr CBlackCalibrationHelper')) -> IO [BlackCalibrationHelper]
peekBlackCalibrationHelperArray :: Ptr CUInt
-> Ptr (Ptr (Ptr CBlackCalibrationHelper'))
-> IO [BlackCalibrationHelper]
peekBlackCalibrationHelperArray = (Ptr CBlackCalibrationHelper' -> IO BlackCalibrationHelper)
-> Ptr CUInt
-> Ptr (Ptr (Ptr CBlackCalibrationHelper'))
-> IO [BlackCalibrationHelper]
forall a b.
(Ptr a -> IO b) -> Ptr CUInt -> Ptr (Ptr (Ptr a)) -> IO [b]
peekPtrArray Ptr CBlackCalibrationHelper' -> IO BlackCalibrationHelper
peekBlackCalibrationHelper

-- SwaptionHelper is only reachable as this concrete type when hasquant itself constructs it
-- (Model.chs's swaptionHelper/swaptionHelperFromDate/swaptionHelperFromDates); a basket returned
-- by NonstandardSwaption/FloatFloatSwaption's calibrationBasket is erased to plain
-- BlackCalibrationHelper by QuantLib's own calibrationBasket signature before it ever reaches
-- this binding, so underlying/swaption are not reachable on basket elements without a cast --
-- deliberately not offered there.
data CSwaptionHelper'
type CSwaptionHelper = ForeignPtr CSwaptionHelper'
-- |A 'BlackCalibrationHelper'; see the hierarchy under t'GenCalibrationHelper'.
type SwaptionHelper = GenBlackCalibrationHelper CSwaptionHelper
foreign import ccall unsafe "ql.h &qlFreeSwaptionHelper" qlFreeSwaptionHelper :: FinalizerPtr CSwaptionHelper'
instance Finalizable CSwaptionHelper' where finalize :: FinalizerPtr CSwaptionHelper'
finalize = FinalizerPtr CSwaptionHelper'
qlFreeSwaptionHelper
foreign import ccall "ql.h qlSwaptionHelperAsBlackCalibrationHelper" qlSwaptionHelperAsBlackCalibrationHelper :: Ptr CSwaptionHelper' -> IO (Ptr CBlackCalibrationHelper')
instance Upcastable CSwaptionHelper' where {type Base CSwaptionHelper' = CBlackCalibrationHelper'; upcast :: Ptr CSwaptionHelper' -> IO (Ptr (Base CSwaptionHelper'))
upcast = Ptr CSwaptionHelper' -> IO (Ptr CBlackCalibrationHelper')
Ptr CSwaptionHelper' -> IO (Ptr (Base CSwaptionHelper'))
qlSwaptionHelperAsBlackCalibrationHelper}
peekSwaptionHelper :: Ptr CSwaptionHelper' -> IO SwaptionHelper
peekSwaptionHelper :: Ptr CSwaptionHelper' -> IO SwaptionHelper
peekSwaptionHelper = Ptr CSwaptionHelper'
-> IO
     (GenForeignPtr
        (ForeignPtr CSwaptionHelper') CBlackCalibrationHelper')
Ptr CSwaptionHelper'
-> IO
     (GenForeignPtr
        (ForeignPtr CSwaptionHelper') (Base CSwaptionHelper'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CSwaptionHelper'
 -> IO
      (GenForeignPtr
         (ForeignPtr CSwaptionHelper') CBlackCalibrationHelper'))
-> (GenForeignPtr
      (ForeignPtr CSwaptionHelper') CBlackCalibrationHelper'
    -> IO SwaptionHelper)
-> Ptr CSwaptionHelper'
-> IO SwaptionHelper
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CSwaptionHelper') CBlackCalibrationHelper'
-> IO SwaptionHelper
forall bch.
GenForeignPtr bch CBlackCalibrationHelper'
-> IO (GenBlackCalibrationHelper bch)
newGenBlackCalibrationHelper
withSwaptionHelper :: SwaptionHelper -> (Ptr CSwaptionHelper' -> IO b) -> IO b
withSwaptionHelper :: forall b. SwaptionHelper -> (Ptr CSwaptionHelper' -> IO b) -> IO b
withSwaptionHelper = ForeignPtr CSwaptionHelper'
-> (Ptr CSwaptionHelper' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CSwaptionHelper'
 -> (Ptr CSwaptionHelper' -> IO b) -> IO b)
-> (SwaptionHelper -> ForeignPtr CSwaptionHelper')
-> SwaptionHelper
-> (Ptr CSwaptionHelper' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CSwaptionHelper') CBlackCalibrationHelper'
-> ForeignPtr CSwaptionHelper'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CSwaptionHelper') CBlackCalibrationHelper'
 -> ForeignPtr CSwaptionHelper')
-> (SwaptionHelper
    -> GenForeignPtr
         (ForeignPtr CSwaptionHelper') CBlackCalibrationHelper')
-> SwaptionHelper
-> ForeignPtr CSwaptionHelper'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackCalibrationHelper' (ForeignPtr CSwaptionHelper'))
  CCalibrationHelper'
-> GenForeignPtr
     (ForeignPtr CSwaptionHelper') CBlackCalibrationHelper'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBlackCalibrationHelper' (ForeignPtr CSwaptionHelper'))
   CCalibrationHelper'
 -> GenForeignPtr
      (ForeignPtr CSwaptionHelper') CBlackCalibrationHelper')
-> (SwaptionHelper
    -> GenForeignPtr
         (AnyOf CBlackCalibrationHelper' (ForeignPtr CSwaptionHelper'))
         CCalibrationHelper')
-> SwaptionHelper
-> GenForeignPtr
     (ForeignPtr CSwaptionHelper') CBlackCalibrationHelper'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SwaptionHelper
-> GenForeignPtr
     (AnyOf CBlackCalibrationHelper' (ForeignPtr CSwaptionHelper'))
     CCalibrationHelper'
forall ch.
GenCalibrationHelper ch -> GenForeignPtr ch CCalibrationHelper'
getCalibrationHelper

-- |The root of the hierarchy shown under t'GenBlackCalculator'.
type BlackCalculator = GenBlackCalculator CBlackCalculator
data CBlackCalculator'
data CBlackScholesCalculator'
-- | > BlackCalculator
-- >   BlackScholesCalculator
newtype GenBlackCalculator bc = GenBlackCalculator {forall bc.
GenBlackCalculator bc -> GenForeignPtr bc CBlackCalculator'
getBlackCalculator :: GenForeignPtr bc CBlackCalculator'}
type CBlackCalculator = ForeignPtr CBlackCalculator'
type CBlackScholesCalculator = ForeignPtr CBlackScholesCalculator'
-- |A 'BlackCalculator'; see the hierarchy under t'GenBlackCalculator'.
type BlackScholesCalculator = GenBlackCalculator CBlackScholesCalculator
foreign import ccall unsafe "ql.h &qlFreeBlackCalculator" qlFreeBlackCalculator :: FinalizerPtr CBlackCalculator'
foreign import ccall unsafe "ql.h &qlFreeBlackScholesCalculator" qlFreeBlackScholesCalculator :: FinalizerPtr CBlackScholesCalculator'
instance Finalizable CBlackCalculator' where finalize :: FinalizerPtr CBlackCalculator'
finalize = FinalizerPtr CBlackCalculator'
qlFreeBlackCalculator
instance Finalizable CBlackScholesCalculator' where finalize :: FinalizerPtr CBlackScholesCalculator'
finalize = FinalizerPtr CBlackScholesCalculator'
qlFreeBlackScholesCalculator
foreign import ccall "ql.h qlBlackScholesCalculatorAsBlackCalculator" qlBlackScholesCalculatorAsBlackCalculator :: Ptr CBlackScholesCalculator' -> IO (Ptr CBlackCalculator')
instance Upcastable CBlackScholesCalculator' where {type Base CBlackScholesCalculator' = CBlackCalculator'; upcast :: Ptr CBlackScholesCalculator'
-> IO (Ptr (Base CBlackScholesCalculator'))
upcast = Ptr CBlackScholesCalculator' -> IO (Ptr CBlackCalculator')
Ptr CBlackScholesCalculator'
-> IO (Ptr (Base CBlackScholesCalculator'))
qlBlackScholesCalculatorAsBlackCalculator}
asBlackCalculator :: GenBlackCalculator bc -> IO BlackCalculator
asBlackCalculator :: forall bc. GenBlackCalculator bc -> IO BlackCalculator
asBlackCalculator = (Ptr CBlackCalculator' -> IO BlackCalculator)
-> GenForeignPtr bc CBlackCalculator' -> IO BlackCalculator
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CBlackCalculator' -> IO BlackCalculator
peekBlackCalculator (GenForeignPtr bc CBlackCalculator' -> IO BlackCalculator)
-> (GenBlackCalculator bc -> GenForeignPtr bc CBlackCalculator')
-> GenBlackCalculator bc
-> IO BlackCalculator
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBlackCalculator bc -> GenForeignPtr bc CBlackCalculator'
forall bc.
GenBlackCalculator bc -> GenForeignPtr bc CBlackCalculator'
getBlackCalculator
peekBlackCalculator :: Ptr CBlackCalculator' -> IO BlackCalculator
peekBlackCalculator :: Ptr CBlackCalculator' -> IO BlackCalculator
peekBlackCalculator = GenForeignPtr CBlackCalculator CBlackCalculator' -> BlackCalculator
forall bc.
GenForeignPtr bc CBlackCalculator' -> GenBlackCalculator bc
GenBlackCalculator (GenForeignPtr CBlackCalculator CBlackCalculator'
 -> BlackCalculator)
-> (Ptr CBlackCalculator'
    -> IO (GenForeignPtr CBlackCalculator CBlackCalculator'))
-> Ptr CBlackCalculator'
-> IO BlackCalculator
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CBlackCalculator'
-> IO (GenForeignPtr CBlackCalculator CBlackCalculator')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr
withBlackCalculator :: GenBlackCalculator bc -> (Ptr CBlackCalculator' -> IO b) -> IO b
withBlackCalculator :: forall bc b.
GenBlackCalculator bc -> (Ptr CBlackCalculator' -> IO b) -> IO b
withBlackCalculator = GenForeignPtr bc CBlackCalculator'
-> (Ptr CBlackCalculator' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr bc CBlackCalculator'
 -> (Ptr CBlackCalculator' -> IO b) -> IO b)
-> (GenBlackCalculator bc -> GenForeignPtr bc CBlackCalculator')
-> GenBlackCalculator bc
-> (Ptr CBlackCalculator' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBlackCalculator bc -> GenForeignPtr bc CBlackCalculator'
forall bc.
GenBlackCalculator bc -> GenForeignPtr bc CBlackCalculator'
getBlackCalculator
withGenBlackCalculator :: GenBlackCalculator (ForeignPtr bc) -> (Ptr bc -> IO b) -> IO b
withGenBlackCalculator :: forall bc b.
GenBlackCalculator (ForeignPtr bc) -> (Ptr bc -> IO b) -> IO b
withGenBlackCalculator = ForeignPtr bc -> (Ptr bc -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr bc -> (Ptr bc -> IO b) -> IO b)
-> (GenBlackCalculator (ForeignPtr bc) -> ForeignPtr bc)
-> GenBlackCalculator (ForeignPtr bc)
-> (Ptr bc -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr bc) CBlackCalculator' -> ForeignPtr bc
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr bc) CBlackCalculator' -> ForeignPtr bc)
-> (GenBlackCalculator (ForeignPtr bc)
    -> GenForeignPtr (ForeignPtr bc) CBlackCalculator')
-> GenBlackCalculator (ForeignPtr bc)
-> ForeignPtr bc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBlackCalculator (ForeignPtr bc)
-> GenForeignPtr (ForeignPtr bc) CBlackCalculator'
forall bc.
GenBlackCalculator bc -> GenForeignPtr bc CBlackCalculator'
getBlackCalculator
peekBlackScholesCalculator :: Ptr CBlackScholesCalculator' -> IO BlackScholesCalculator
peekBlackScholesCalculator :: Ptr CBlackScholesCalculator' -> IO BlackScholesCalculator
peekBlackScholesCalculator = GenForeignPtr CBlackScholesCalculator CBlackCalculator'
-> BlackScholesCalculator
forall bc.
GenForeignPtr bc CBlackCalculator' -> GenBlackCalculator bc
GenBlackCalculator (GenForeignPtr CBlackScholesCalculator CBlackCalculator'
 -> BlackScholesCalculator)
-> (Ptr CBlackScholesCalculator'
    -> IO (GenForeignPtr CBlackScholesCalculator CBlackCalculator'))
-> Ptr CBlackScholesCalculator'
-> IO BlackScholesCalculator
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CBlackScholesCalculator'
-> IO (GenForeignPtr CBlackScholesCalculator CBlackCalculator')
Ptr CBlackScholesCalculator'
-> IO
     (GenForeignPtr
        CBlackScholesCalculator (Base CBlackScholesCalculator'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr

-- no subclasses upstream, unlike BlackCalculator/BlackScholesCalculator above, so this is a
-- plain leaf (Standalone), not a GenX/Upcastable hierarchy
data CBachelierCalculator

-- | > BachelierCalculator
newtype BachelierCalculator = BachelierCalculator {BachelierCalculator -> Standalone CBachelierCalculator
getCBachelierCalculator :: Standalone CBachelierCalculator}
foreign import ccall unsafe "ql.h &qlFreeBachelierCalculator" qlFreeBachelierCalculator :: FinalizerPtr CBachelierCalculator
instance Finalizable CBachelierCalculator where finalize :: FinalizerPtr CBachelierCalculator
finalize = FinalizerPtr CBachelierCalculator
qlFreeBachelierCalculator
peekBachelierCalculator :: Ptr CBachelierCalculator -> IO BachelierCalculator
peekBachelierCalculator :: Ptr CBachelierCalculator -> IO BachelierCalculator
peekBachelierCalculator = Standalone CBachelierCalculator -> BachelierCalculator
BachelierCalculator (Standalone CBachelierCalculator -> BachelierCalculator)
-> (Ptr CBachelierCalculator
    -> IO (Standalone CBachelierCalculator))
-> Ptr CBachelierCalculator
-> IO BachelierCalculator
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CBachelierCalculator -> IO (Standalone CBachelierCalculator)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withBachelierCalculator :: BachelierCalculator -> (Ptr CBachelierCalculator -> IO b) -> IO b
withBachelierCalculator :: forall b.
BachelierCalculator -> (Ptr CBachelierCalculator -> IO b) -> IO b
withBachelierCalculator = Standalone CBachelierCalculator
-> (Ptr CBachelierCalculator -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CBachelierCalculator
 -> (Ptr CBachelierCalculator -> IO b) -> IO b)
-> (BachelierCalculator -> Standalone CBachelierCalculator)
-> BachelierCalculator
-> (Ptr CBachelierCalculator -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BachelierCalculator -> Standalone CBachelierCalculator
getCBachelierCalculator

-- |The root of the hierarchy shown under t'GenIndex'.
type Index = GenIndex CIndex
data CIndex'
data CInterestRateIndex'
data CInflationIndex'
data CZeroInflationIndex'
data CYoYInflationIndex'
data CBMAIndex'
data CIborIndex'
data COvernightIndex'
data CSwapIndex'
data CSwapSpreadIndex'
data COvernightIndexedSwapIndex'
-- MULTILEVEL HIERARCHIES
-- | > Index
-- >  InterestRateIndex
-- >    BMAIndex
-- >    IborIndex
-- >      OvernightIborIndex (COvernightIndex')
-- >    SwapIndex
-- >      OvernightIndexedSwapIndex
-- >    SwapSpreadIndex
-- >  InflationIndex
-- >    YoYInflationIndex
-- >    ZeroInflationIndex
-- >  EquityIndex
-- >  CommodityIndex
newtype GenIndex idx = GenIndex {forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex :: GenForeignPtr idx CIndex'}
type CIndex = ForeignPtr CIndex'

foreign import ccall safe "ql.h qlIndexName" qlIndexName :: Ptr CIndex' -> IO CString
showIndex :: GenIndex idx -> String
showIndex :: forall idx. GenIndex idx -> String
showIndex = IO String -> String
forall a. IO a -> a
unsafePerformIO (IO String -> String)
-> (GenIndex idx -> IO String) -> GenIndex idx -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (GenIndex idx -> (Ptr CIndex' -> IO String) -> IO String
forall idx b. GenIndex idx -> (Ptr CIndex' -> IO b) -> IO b
`withIndex` (Ptr CIndex' -> IO CString
qlIndexName (Ptr CIndex' -> IO CString)
-> (CString -> IO String) -> Ptr CIndex' -> IO String
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> CString -> IO String
peekDynString))
{-# NOINLINE showIndex #-}

instance Show (GenIndex idx) where show :: GenIndex idx -> String
show = GenIndex idx -> String
forall idx. GenIndex idx -> String
showIndex

-- |An 'InterestRateIndex' or one of its leaves; see the hierarchy under t'GenIndex'.
type GenInterestRateIndex ridx = GenIndex (AnyOf CInterestRateIndex' ridx)
type CInterestRateIndex = ForeignPtr CInterestRateIndex'
-- |An 'Index'; see the hierarchy under t'GenIndex'.
type InterestRateIndex = GenInterestRateIndex CInterestRateIndex
-- |An 'InflationIndex' or one of its leaves; see the hierarchy under t'GenIndex'.
type GenInflationIndex iidx = GenIndex (AnyOf CInflationIndex' iidx)
type CInflationIndex = ForeignPtr CInflationIndex'
-- |An 'Index'; see the hierarchy under t'GenIndex'.
type InflationIndex = GenInflationIndex CInflationIndex
-- |A 'ZeroInflationIndex' or one of its leaves; see the hierarchy under t'GenIndex'.
type GenZeroInflationIndex zidx = GenInflationIndex (AnyOf CZeroInflationIndex' zidx)
type CZeroInflationIndex = ForeignPtr CZeroInflationIndex'
-- |An 'InflationIndex'; see the hierarchy under t'GenIndex'.
type ZeroInflationIndex = GenZeroInflationIndex CZeroInflationIndex
-- |A 'YoYInflationIndex' or one of its leaves; see the hierarchy under t'GenIndex'.
type GenYoYInflationIndex yidx = GenInflationIndex (AnyOf CYoYInflationIndex' yidx)
type CYoYInflationIndex = ForeignPtr CYoYInflationIndex'
-- |An 'InflationIndex'; see the hierarchy under t'GenIndex'.
type YoYInflationIndex = GenYoYInflationIndex CYoYInflationIndex
type CBMAIndex = ForeignPtr CBMAIndex'
-- |An 'InterestRateIndex'; see the hierarchy under t'GenIndex'.
type BMAIndex = GenInterestRateIndex CBMAIndex
type CIborIndex = ForeignPtr CIborIndex'
-- |An 'InterestRateIndex'; see the hierarchy under t'GenIndex'.
type IborIndex = GenIborIndex CIborIndex
type COvernightIndex = ForeignPtr COvernightIndex'
-- |An 'IborIndex'; see the hierarchy under t'GenIndex'.
type OvernightIborIndex = GenIborIndex COvernightIndex
type CSwapIndex = ForeignPtr CSwapIndex'
-- |An 'InterestRateIndex'; see the hierarchy under t'GenIndex'.
type SwapIndex = GenSwapIndex CSwapIndex
type CSwapSpreadIndex = ForeignPtr CSwapSpreadIndex'
-- |An 'InterestRateIndex'; see the hierarchy under t'GenIndex'.
type SwapSpreadIndex = GenInterestRateIndex CSwapSpreadIndex
-- |An 'IborIndex' or one of its leaves; see the hierarchy under t'GenIndex'.
type GenIborIndex ibor = GenInterestRateIndex (AnyOf CIborIndex' ibor)
-- |A 'SwapIndex' or one of its leaves; see the hierarchy under t'GenIndex'.
type GenSwapIndex sidx = GenInterestRateIndex (AnyOf CSwapIndex' sidx)
type COvernightIndexedSwapIndex = ForeignPtr COvernightIndexedSwapIndex'
-- |A 'SwapIndex'; see the hierarchy under t'GenIndex'.
type OvernightIndexedSwapIndex = GenSwapIndex COvernightIndexedSwapIndex
foreign import ccall unsafe "ql.h &qlFreeIndex" qlFreeIndex :: FinalizerPtr CIndex'
foreign import ccall unsafe "ql.h &qlFreeInterestRateIndex" qlFreeInterestRateIndex :: FinalizerPtr CInterestRateIndex'
foreign import ccall unsafe "ql.h &qlFreeInflationIndex" qlFreeInflationIndex :: FinalizerPtr CInflationIndex'
foreign import ccall unsafe "ql.h &qlFreeZeroInflationIndex" qlFreeZeroInflationIndex :: FinalizerPtr CZeroInflationIndex'
foreign import ccall unsafe "ql.h &qlFreeYoYInflationIndex" qlFreeYoYInflationIndex :: FinalizerPtr CYoYInflationIndex'
foreign import ccall unsafe "ql.h &qlFreeBMAIndex" qlFreeBMAIndex :: FinalizerPtr CBMAIndex'
foreign import ccall unsafe "ql.h &qlFreeIborIndex" qlFreeIborIndex :: FinalizerPtr CIborIndex'
foreign import ccall unsafe "ql.h &qlFreeOvernightIndex" qlFreeOvernightIborIndex :: FinalizerPtr COvernightIndex'
foreign import ccall unsafe "ql.h &qlFreeSwapIndex" qlFreeSwapIndex :: FinalizerPtr CSwapIndex'
foreign import ccall unsafe "ql.h &qlFreeSwapSpreadIndex" qlFreeSwapSpreadIndex :: FinalizerPtr CSwapSpreadIndex'
foreign import ccall unsafe "ql.h &qlFreeOvernightIndexedSwapIndex" qlFreeOvernightIndexedSwapIndex :: FinalizerPtr COvernightIndexedSwapIndex'
instance Finalizable CIndex' where finalize :: FinalizerPtr CIndex'
finalize = FinalizerPtr CIndex'
qlFreeIndex
instance Finalizable CInterestRateIndex' where finalize :: FinalizerPtr CInterestRateIndex'
finalize = FinalizerPtr CInterestRateIndex'
qlFreeInterestRateIndex
instance Finalizable CInflationIndex' where finalize :: FinalizerPtr CInflationIndex'
finalize = FinalizerPtr CInflationIndex'
qlFreeInflationIndex
instance Finalizable CZeroInflationIndex' where finalize :: FinalizerPtr CZeroInflationIndex'
finalize = FinalizerPtr CZeroInflationIndex'
qlFreeZeroInflationIndex
instance Finalizable CYoYInflationIndex' where finalize :: FinalizerPtr CYoYInflationIndex'
finalize = FinalizerPtr CYoYInflationIndex'
qlFreeYoYInflationIndex
instance Finalizable CBMAIndex' where finalize :: FinalizerPtr CBMAIndex'
finalize = FinalizerPtr CBMAIndex'
qlFreeBMAIndex
instance Finalizable CIborIndex' where finalize :: FinalizerPtr CIborIndex'
finalize = FinalizerPtr CIborIndex'
qlFreeIborIndex
instance Finalizable COvernightIndex' where finalize :: FinalizerPtr COvernightIndex'
finalize = FinalizerPtr COvernightIndex'
qlFreeOvernightIborIndex
instance Finalizable CSwapIndex' where finalize :: FinalizerPtr CSwapIndex'
finalize = FinalizerPtr CSwapIndex'
qlFreeSwapIndex
instance Finalizable CSwapSpreadIndex' where finalize :: FinalizerPtr CSwapSpreadIndex'
finalize = FinalizerPtr CSwapSpreadIndex'
qlFreeSwapSpreadIndex
instance Finalizable COvernightIndexedSwapIndex' where finalize :: FinalizerPtr COvernightIndexedSwapIndex'
finalize = FinalizerPtr COvernightIndexedSwapIndex'
qlFreeOvernightIndexedSwapIndex
foreign import ccall "ql.h qlInterestRateIndexAsIndex" qlInterestRateIndexAsIndex :: Ptr CInterestRateIndex' -> IO (Ptr CIndex')
foreign import ccall "ql.h qlInflationIndexAsIndex" qlInflationIndexAsIndex :: Ptr CInflationIndex' -> IO (Ptr CIndex')
foreign import ccall "ql.h qlZeroInflationIndexAsInflationIndex" qlZeroInflationIndexAsInflationIndex :: Ptr CZeroInflationIndex' -> IO (Ptr CInflationIndex')
foreign import ccall "ql.h qlYoYInflationIndexAsInflationIndex" qlYoYInflationIndexAsInflationIndex :: Ptr CYoYInflationIndex' -> IO (Ptr CInflationIndex')
foreign import ccall "ql.h qlBMAIndexAsInterestRateIndex" qlBMAIndexAsInterestRateIndex :: Ptr CBMAIndex' -> IO (Ptr CInterestRateIndex')
foreign import ccall "ql.h qlIborIndexAsInterestRateIndex" qlIborIndexAsInterestRateIndex :: Ptr CIborIndex' -> IO (Ptr CInterestRateIndex')
foreign import ccall "ql.h qlOvernightIndexAsIborIndex" qlOvernightIndexAsIborIndex :: Ptr COvernightIndex' -> IO (Ptr CIborIndex')
foreign import ccall "ql.h qlSwapIndexAsInterestRateIndex" qlSwapIndexAsInterestRateIndex :: Ptr CSwapIndex' -> IO (Ptr CInterestRateIndex')
foreign import ccall "ql.h qlSwapSpreadIndexAsInterestRateIndex" qlSwapSpreadIndexAsInterestRateIndex :: Ptr CSwapSpreadIndex' -> IO (Ptr CInterestRateIndex')
foreign import ccall "ql.h qlOvernightIndexedSwapIndexAsSwapIndex" qlOvernightIndexedSwapIndexAsSwapIndex :: Ptr COvernightIndexedSwapIndex' -> IO (Ptr CSwapIndex')
instance Upcastable CInterestRateIndex' where {type Base CInterestRateIndex' = CIndex'; upcast :: Ptr CInterestRateIndex' -> IO (Ptr (Base CInterestRateIndex'))
upcast = Ptr CInterestRateIndex' -> IO (Ptr CIndex')
Ptr CInterestRateIndex' -> IO (Ptr (Base CInterestRateIndex'))
qlInterestRateIndexAsIndex}
instance Upcastable CInflationIndex' where {type Base CInflationIndex' = CIndex'; upcast :: Ptr CInflationIndex' -> IO (Ptr (Base CInflationIndex'))
upcast = Ptr CInflationIndex' -> IO (Ptr CIndex')
Ptr CInflationIndex' -> IO (Ptr (Base CInflationIndex'))
qlInflationIndexAsIndex}
instance Upcastable CZeroInflationIndex' where {type Base CZeroInflationIndex' = CInflationIndex'; upcast :: Ptr CZeroInflationIndex' -> IO (Ptr (Base CZeroInflationIndex'))
upcast = Ptr CZeroInflationIndex' -> IO (Ptr CInflationIndex')
Ptr CZeroInflationIndex' -> IO (Ptr (Base CZeroInflationIndex'))
qlZeroInflationIndexAsInflationIndex}
instance Upcastable CYoYInflationIndex' where {type Base CYoYInflationIndex' = CInflationIndex'; upcast :: Ptr CYoYInflationIndex' -> IO (Ptr (Base CYoYInflationIndex'))
upcast = Ptr CYoYInflationIndex' -> IO (Ptr CInflationIndex')
Ptr CYoYInflationIndex' -> IO (Ptr (Base CYoYInflationIndex'))
qlYoYInflationIndexAsInflationIndex}
instance Upcastable CBMAIndex' where {type Base CBMAIndex' = CInterestRateIndex'; upcast :: Ptr CBMAIndex' -> IO (Ptr (Base CBMAIndex'))
upcast = Ptr CBMAIndex' -> IO (Ptr CInterestRateIndex')
Ptr CBMAIndex' -> IO (Ptr (Base CBMAIndex'))
qlBMAIndexAsInterestRateIndex}
instance Upcastable CIborIndex' where {type Base CIborIndex' = CInterestRateIndex'; upcast :: Ptr CIborIndex' -> IO (Ptr (Base CIborIndex'))
upcast = Ptr CIborIndex' -> IO (Ptr CInterestRateIndex')
Ptr CIborIndex' -> IO (Ptr (Base CIborIndex'))
qlIborIndexAsInterestRateIndex}
instance Upcastable COvernightIndex' where {type Base COvernightIndex' = CIborIndex'; upcast :: Ptr COvernightIndex' -> IO (Ptr (Base COvernightIndex'))
upcast = Ptr COvernightIndex' -> IO (Ptr CIborIndex')
Ptr COvernightIndex' -> IO (Ptr (Base COvernightIndex'))
qlOvernightIndexAsIborIndex}
instance Upcastable CSwapIndex' where {type Base CSwapIndex' = CInterestRateIndex'; upcast :: Ptr CSwapIndex' -> IO (Ptr (Base CSwapIndex'))
upcast = Ptr CSwapIndex' -> IO (Ptr CInterestRateIndex')
Ptr CSwapIndex' -> IO (Ptr (Base CSwapIndex'))
qlSwapIndexAsInterestRateIndex}
instance Upcastable CSwapSpreadIndex' where {type Base CSwapSpreadIndex' = CInterestRateIndex'; upcast :: Ptr CSwapSpreadIndex' -> IO (Ptr (Base CSwapSpreadIndex'))
upcast = Ptr CSwapSpreadIndex' -> IO (Ptr CInterestRateIndex')
Ptr CSwapSpreadIndex' -> IO (Ptr (Base CSwapSpreadIndex'))
qlSwapSpreadIndexAsInterestRateIndex}
instance Upcastable COvernightIndexedSwapIndex' where {type Base COvernightIndexedSwapIndex' = CSwapIndex'; upcast :: Ptr COvernightIndexedSwapIndex'
-> IO (Ptr (Base COvernightIndexedSwapIndex'))
upcast = Ptr COvernightIndexedSwapIndex' -> IO (Ptr CSwapIndex')
Ptr COvernightIndexedSwapIndex'
-> IO (Ptr (Base COvernightIndexedSwapIndex'))
qlOvernightIndexedSwapIndexAsSwapIndex}

asIndex :: GenIndex idx -> IO Index
asIndex :: forall idx. GenIndex idx -> IO Index
asIndex = (Ptr CIndex' -> IO Index) -> GenForeignPtr idx CIndex' -> IO Index
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CIndex' -> IO Index
peekIndex (GenForeignPtr idx CIndex' -> IO Index)
-> (GenIndex idx -> GenForeignPtr idx CIndex')
-> GenIndex idx
-> IO Index
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenIndex idx -> GenForeignPtr idx CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex
withIndex :: GenIndex idx -> (Ptr CIndex' -> IO b) -> IO b
withIndex :: forall idx b. GenIndex idx -> (Ptr CIndex' -> IO b) -> IO b
withIndex = GenForeignPtr idx CIndex' -> (Ptr CIndex' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr idx CIndex' -> (Ptr CIndex' -> IO b) -> IO b)
-> (GenIndex idx -> GenForeignPtr idx CIndex')
-> GenIndex idx
-> (Ptr CIndex' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenIndex idx -> GenForeignPtr idx CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex
peekIndex :: Ptr CIndex' -> IO Index
peekIndex :: Ptr CIndex' -> IO Index
peekIndex = GenForeignPtr CIndex CIndex' -> Index
forall idx. GenForeignPtr idx CIndex' -> GenIndex idx
GenIndex (GenForeignPtr CIndex CIndex' -> Index)
-> (Ptr CIndex' -> IO (GenForeignPtr CIndex CIndex'))
-> Ptr CIndex'
-> IO Index
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CIndex' -> IO (GenForeignPtr CIndex CIndex')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr
withIndexArray :: [Index] -> ((CUInt, Ptr (Ptr CIndex')) -> IO b) -> IO b
withIndexArray :: forall b. [Index] -> ((CUInt, Ptr (Ptr CIndex')) -> IO b) -> IO b
withIndexArray = (Index -> (Ptr CIndex' -> IO b) -> IO b)
-> [Index] -> ((CUInt, Ptr (Ptr CIndex')) -> IO b) -> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray Index -> (Ptr CIndex' -> IO b) -> IO b
forall idx b. GenIndex idx -> (Ptr CIndex' -> IO b) -> IO b
withIndex

asInterestRateIndex :: GenInterestRateIndex ridx -> IO InterestRateIndex
asInterestRateIndex :: forall ridx. GenInterestRateIndex ridx -> IO InterestRateIndex
asInterestRateIndex = (Ptr CInterestRateIndex' -> IO InterestRateIndex)
-> GenForeignPtr ridx CInterestRateIndex' -> IO InterestRateIndex
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CInterestRateIndex' -> IO InterestRateIndex
peekInterestRateIndex (GenForeignPtr ridx CInterestRateIndex' -> IO InterestRateIndex)
-> (GenInterestRateIndex ridx
    -> GenForeignPtr ridx CInterestRateIndex')
-> GenInterestRateIndex ridx
-> IO InterestRateIndex
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CInterestRateIndex' ridx) CIndex'
-> GenForeignPtr ridx CInterestRateIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CInterestRateIndex' ridx) CIndex'
 -> GenForeignPtr ridx CInterestRateIndex')
-> (GenInterestRateIndex ridx
    -> GenForeignPtr (AnyOf CInterestRateIndex' ridx) CIndex')
-> GenInterestRateIndex ridx
-> GenForeignPtr ridx CInterestRateIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenInterestRateIndex ridx
-> GenForeignPtr (AnyOf CInterestRateIndex' ridx) CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex
peekInterestRateIndex :: Ptr CInterestRateIndex' -> IO InterestRateIndex
peekInterestRateIndex :: Ptr CInterestRateIndex' -> IO InterestRateIndex
peekInterestRateIndex = Ptr CInterestRateIndex'
-> IO
     (GenForeignPtr
        (ForeignPtr CInterestRateIndex') CInterestRateIndex')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CInterestRateIndex'
 -> IO
      (GenForeignPtr
         (ForeignPtr CInterestRateIndex') CInterestRateIndex'))
-> (GenForeignPtr
      (ForeignPtr CInterestRateIndex') CInterestRateIndex'
    -> IO InterestRateIndex)
-> Ptr CInterestRateIndex'
-> IO InterestRateIndex
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CInterestRateIndex') CInterestRateIndex'
-> IO InterestRateIndex
forall ridx.
GenForeignPtr ridx CInterestRateIndex'
-> IO (GenInterestRateIndex ridx)
newGenInterestRateIndex
newGenInterestRateIndex :: GenForeignPtr ridx CInterestRateIndex' -> IO (GenInterestRateIndex ridx)
newGenInterestRateIndex :: forall ridx.
GenForeignPtr ridx CInterestRateIndex'
-> IO (GenInterestRateIndex ridx)
newGenInterestRateIndex = GenInterestRateIndex ridx -> IO (GenInterestRateIndex ridx)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenInterestRateIndex ridx -> IO (GenInterestRateIndex ridx))
-> (GenForeignPtr ridx CInterestRateIndex'
    -> GenInterestRateIndex ridx)
-> GenForeignPtr ridx CInterestRateIndex'
-> IO (GenInterestRateIndex ridx)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CInterestRateIndex' ridx) CIndex'
-> GenInterestRateIndex ridx
forall idx. GenForeignPtr idx CIndex' -> GenIndex idx
GenIndex (GenForeignPtr (AnyOf CInterestRateIndex' ridx) CIndex'
 -> GenInterestRateIndex ridx)
-> (GenForeignPtr ridx CInterestRateIndex'
    -> GenForeignPtr (AnyOf CInterestRateIndex' ridx) CIndex')
-> GenForeignPtr ridx CInterestRateIndex'
-> GenInterestRateIndex ridx
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr ridx CInterestRateIndex'
-> GenForeignPtr (AnyOf CInterestRateIndex' ridx) CIndex'
GenForeignPtr ridx CInterestRateIndex'
-> GenForeignPtr
     (AnyOf CInterestRateIndex' ridx) (Base CInterestRateIndex')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
withInterestRateIndex :: GenInterestRateIndex ridx -> (Ptr CInterestRateIndex' -> IO b) -> IO b
withInterestRateIndex :: forall ridx b.
GenInterestRateIndex ridx
-> (Ptr CInterestRateIndex' -> IO b) -> IO b
withInterestRateIndex = GenForeignPtr ridx CInterestRateIndex'
-> (Ptr CInterestRateIndex' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr ridx CInterestRateIndex'
 -> (Ptr CInterestRateIndex' -> IO b) -> IO b)
-> (GenInterestRateIndex ridx
    -> GenForeignPtr ridx CInterestRateIndex')
-> GenInterestRateIndex ridx
-> (Ptr CInterestRateIndex' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CInterestRateIndex' ridx) CIndex'
-> GenForeignPtr ridx CInterestRateIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CInterestRateIndex' ridx) CIndex'
 -> GenForeignPtr ridx CInterestRateIndex')
-> (GenInterestRateIndex ridx
    -> GenForeignPtr (AnyOf CInterestRateIndex' ridx) CIndex')
-> GenInterestRateIndex ridx
-> GenForeignPtr ridx CInterestRateIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenInterestRateIndex ridx
-> GenForeignPtr (AnyOf CInterestRateIndex' ridx) CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex
withInterestRateIndexArray :: [GenInterestRateIndex ridx] -> ((CUInt, Ptr (Ptr CInterestRateIndex')) -> IO b) -> IO b
withInterestRateIndexArray :: forall ridx b.
[GenInterestRateIndex ridx]
-> ((CUInt, Ptr (Ptr CInterestRateIndex')) -> IO b) -> IO b
withInterestRateIndexArray = (GenInterestRateIndex ridx
 -> (Ptr CInterestRateIndex' -> IO b) -> IO b)
-> [GenInterestRateIndex ridx]
-> ((CUInt, Ptr (Ptr CInterestRateIndex')) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray GenInterestRateIndex ridx
-> (Ptr CInterestRateIndex' -> IO b) -> IO b
forall ridx b.
GenInterestRateIndex ridx
-> (Ptr CInterestRateIndex' -> IO b) -> IO b
withInterestRateIndex

asInflationIndex :: GenInflationIndex iidx -> IO InflationIndex
asInflationIndex :: forall iidx. GenInflationIndex iidx -> IO InflationIndex
asInflationIndex = (Ptr CInflationIndex' -> IO InflationIndex)
-> GenForeignPtr iidx CInflationIndex' -> IO InflationIndex
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CInflationIndex' -> IO InflationIndex
peekInflationIndex (GenForeignPtr iidx CInflationIndex' -> IO InflationIndex)
-> (GenInflationIndex iidx -> GenForeignPtr iidx CInflationIndex')
-> GenInflationIndex iidx
-> IO InflationIndex
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CInflationIndex' iidx) CIndex'
-> GenForeignPtr iidx CInflationIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CInflationIndex' iidx) CIndex'
 -> GenForeignPtr iidx CInflationIndex')
-> (GenInflationIndex iidx
    -> GenForeignPtr (AnyOf CInflationIndex' iidx) CIndex')
-> GenInflationIndex iidx
-> GenForeignPtr iidx CInflationIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenInflationIndex iidx
-> GenForeignPtr (AnyOf CInflationIndex' iidx) CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex
peekInflationIndex :: Ptr CInflationIndex' -> IO InflationIndex
peekInflationIndex :: Ptr CInflationIndex' -> IO InflationIndex
peekInflationIndex = Ptr CInflationIndex'
-> IO
     (GenForeignPtr (ForeignPtr CInflationIndex') CInflationIndex')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CInflationIndex'
 -> IO
      (GenForeignPtr (ForeignPtr CInflationIndex') CInflationIndex'))
-> (GenForeignPtr (ForeignPtr CInflationIndex') CInflationIndex'
    -> IO InflationIndex)
-> Ptr CInflationIndex'
-> IO InflationIndex
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CInflationIndex') CInflationIndex'
-> IO InflationIndex
forall iidx.
GenForeignPtr iidx CInflationIndex' -> IO (GenInflationIndex iidx)
newGenInflationIndex
newGenInflationIndex :: GenForeignPtr iidx CInflationIndex' -> IO (GenInflationIndex iidx)
newGenInflationIndex :: forall iidx.
GenForeignPtr iidx CInflationIndex' -> IO (GenInflationIndex iidx)
newGenInflationIndex = GenInflationIndex iidx -> IO (GenInflationIndex iidx)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenInflationIndex iidx -> IO (GenInflationIndex iidx))
-> (GenForeignPtr iidx CInflationIndex' -> GenInflationIndex iidx)
-> GenForeignPtr iidx CInflationIndex'
-> IO (GenInflationIndex iidx)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CInflationIndex' iidx) CIndex'
-> GenInflationIndex iidx
forall idx. GenForeignPtr idx CIndex' -> GenIndex idx
GenIndex (GenForeignPtr (AnyOf CInflationIndex' iidx) CIndex'
 -> GenInflationIndex iidx)
-> (GenForeignPtr iidx CInflationIndex'
    -> GenForeignPtr (AnyOf CInflationIndex' iidx) CIndex')
-> GenForeignPtr iidx CInflationIndex'
-> GenInflationIndex iidx
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr iidx CInflationIndex'
-> GenForeignPtr (AnyOf CInflationIndex' iidx) CIndex'
GenForeignPtr iidx CInflationIndex'
-> GenForeignPtr
     (AnyOf CInflationIndex' iidx) (Base CInflationIndex')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
withInflationIndex :: GenInflationIndex iidx -> (Ptr CInflationIndex' -> IO b) -> IO b
withInflationIndex :: forall iidx b.
GenInflationIndex iidx -> (Ptr CInflationIndex' -> IO b) -> IO b
withInflationIndex = GenForeignPtr iidx CInflationIndex'
-> (Ptr CInflationIndex' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr iidx CInflationIndex'
 -> (Ptr CInflationIndex' -> IO b) -> IO b)
-> (GenInflationIndex iidx -> GenForeignPtr iidx CInflationIndex')
-> GenInflationIndex iidx
-> (Ptr CInflationIndex' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CInflationIndex' iidx) CIndex'
-> GenForeignPtr iidx CInflationIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CInflationIndex' iidx) CIndex'
 -> GenForeignPtr iidx CInflationIndex')
-> (GenInflationIndex iidx
    -> GenForeignPtr (AnyOf CInflationIndex' iidx) CIndex')
-> GenInflationIndex iidx
-> GenForeignPtr iidx CInflationIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenInflationIndex iidx
-> GenForeignPtr (AnyOf CInflationIndex' iidx) CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex

peekZeroInflationIndex :: Ptr CZeroInflationIndex' -> IO ZeroInflationIndex
peekZeroInflationIndex :: Ptr CZeroInflationIndex' -> IO ZeroInflationIndex
peekZeroInflationIndex = Ptr CZeroInflationIndex'
-> IO
     (GenForeignPtr
        (ForeignPtr CZeroInflationIndex') CZeroInflationIndex')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CZeroInflationIndex'
 -> IO
      (GenForeignPtr
         (ForeignPtr CZeroInflationIndex') CZeroInflationIndex'))
-> (GenForeignPtr
      (ForeignPtr CZeroInflationIndex') CZeroInflationIndex'
    -> IO ZeroInflationIndex)
-> Ptr CZeroInflationIndex'
-> IO ZeroInflationIndex
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CZeroInflationIndex') CZeroInflationIndex'
-> IO ZeroInflationIndex
forall zidx.
GenForeignPtr zidx CZeroInflationIndex'
-> IO (GenZeroInflationIndex zidx)
newGenZeroInflationIndex
withZeroInflationIndex :: GenZeroInflationIndex zidx -> (Ptr CZeroInflationIndex' -> IO b) -> IO b
withZeroInflationIndex :: forall zidx b.
GenZeroInflationIndex zidx
-> (Ptr CZeroInflationIndex' -> IO b) -> IO b
withZeroInflationIndex = GenForeignPtr zidx CZeroInflationIndex'
-> (Ptr CZeroInflationIndex' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr zidx CZeroInflationIndex'
 -> (Ptr CZeroInflationIndex' -> IO b) -> IO b)
-> (GenZeroInflationIndex zidx
    -> GenForeignPtr zidx CZeroInflationIndex')
-> GenZeroInflationIndex zidx
-> (Ptr CZeroInflationIndex' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CZeroInflationIndex' zidx) CInflationIndex'
-> GenForeignPtr zidx CZeroInflationIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CZeroInflationIndex' zidx) CInflationIndex'
 -> GenForeignPtr zidx CZeroInflationIndex')
-> (GenZeroInflationIndex zidx
    -> GenForeignPtr
         (AnyOf CZeroInflationIndex' zidx) CInflationIndex')
-> GenZeroInflationIndex zidx
-> GenForeignPtr zidx CZeroInflationIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CInflationIndex' (AnyOf CZeroInflationIndex' zidx)) CIndex'
-> GenForeignPtr (AnyOf CZeroInflationIndex' zidx) CInflationIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CInflationIndex' (AnyOf CZeroInflationIndex' zidx)) CIndex'
 -> GenForeignPtr
      (AnyOf CZeroInflationIndex' zidx) CInflationIndex')
-> (GenZeroInflationIndex zidx
    -> GenForeignPtr
         (AnyOf CInflationIndex' (AnyOf CZeroInflationIndex' zidx)) CIndex')
-> GenZeroInflationIndex zidx
-> GenForeignPtr (AnyOf CZeroInflationIndex' zidx) CInflationIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenZeroInflationIndex zidx
-> GenForeignPtr
     (AnyOf CInflationIndex' (AnyOf CZeroInflationIndex' zidx)) CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex
newGenZeroInflationIndex :: GenForeignPtr zidx CZeroInflationIndex' -> IO (GenZeroInflationIndex zidx)
newGenZeroInflationIndex :: forall zidx.
GenForeignPtr zidx CZeroInflationIndex'
-> IO (GenZeroInflationIndex zidx)
newGenZeroInflationIndex = GenZeroInflationIndex zidx -> IO (GenZeroInflationIndex zidx)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenZeroInflationIndex zidx -> IO (GenZeroInflationIndex zidx))
-> (GenForeignPtr zidx CZeroInflationIndex'
    -> GenZeroInflationIndex zidx)
-> GenForeignPtr zidx CZeroInflationIndex'
-> IO (GenZeroInflationIndex zidx)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CInflationIndex' (AnyOf CZeroInflationIndex' zidx)) CIndex'
-> GenZeroInflationIndex zidx
forall idx. GenForeignPtr idx CIndex' -> GenIndex idx
GenIndex (GenForeignPtr
   (AnyOf CInflationIndex' (AnyOf CZeroInflationIndex' zidx)) CIndex'
 -> GenZeroInflationIndex zidx)
-> (GenForeignPtr zidx CZeroInflationIndex'
    -> GenForeignPtr
         (AnyOf CInflationIndex' (AnyOf CZeroInflationIndex' zidx)) CIndex')
-> GenForeignPtr zidx CZeroInflationIndex'
-> GenZeroInflationIndex zidx
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CZeroInflationIndex' zidx) CInflationIndex'
-> GenForeignPtr
     (AnyOf CInflationIndex' (AnyOf CZeroInflationIndex' zidx)) CIndex'
GenForeignPtr (AnyOf CZeroInflationIndex' zidx) CInflationIndex'
-> GenForeignPtr
     (AnyOf CInflationIndex' (AnyOf CZeroInflationIndex' zidx))
     (Base CInflationIndex')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CZeroInflationIndex' zidx) CInflationIndex'
 -> GenForeignPtr
      (AnyOf CInflationIndex' (AnyOf CZeroInflationIndex' zidx)) CIndex')
-> (GenForeignPtr zidx CZeroInflationIndex'
    -> GenForeignPtr
         (AnyOf CZeroInflationIndex' zidx) CInflationIndex')
-> GenForeignPtr zidx CZeroInflationIndex'
-> GenForeignPtr
     (AnyOf CInflationIndex' (AnyOf CZeroInflationIndex' zidx)) CIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr zidx CZeroInflationIndex'
-> GenForeignPtr (AnyOf CZeroInflationIndex' zidx) CInflationIndex'
GenForeignPtr zidx CZeroInflationIndex'
-> GenForeignPtr
     (AnyOf CZeroInflationIndex' zidx) (Base CZeroInflationIndex')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf

peekYoYInflationIndex :: Ptr CYoYInflationIndex' -> IO YoYInflationIndex
peekYoYInflationIndex :: Ptr CYoYInflationIndex' -> IO YoYInflationIndex
peekYoYInflationIndex = Ptr CYoYInflationIndex'
-> IO
     (GenForeignPtr
        (ForeignPtr CYoYInflationIndex') CYoYInflationIndex')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CYoYInflationIndex'
 -> IO
      (GenForeignPtr
         (ForeignPtr CYoYInflationIndex') CYoYInflationIndex'))
-> (GenForeignPtr
      (ForeignPtr CYoYInflationIndex') CYoYInflationIndex'
    -> IO YoYInflationIndex)
-> Ptr CYoYInflationIndex'
-> IO YoYInflationIndex
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CYoYInflationIndex') CYoYInflationIndex'
-> IO YoYInflationIndex
forall yidx.
GenForeignPtr yidx CYoYInflationIndex'
-> IO (GenYoYInflationIndex yidx)
newGenYoYInflationIndex
withYoYInflationIndex :: GenYoYInflationIndex yidx -> (Ptr CYoYInflationIndex' -> IO b) -> IO b
withYoYInflationIndex :: forall yidx b.
GenYoYInflationIndex yidx
-> (Ptr CYoYInflationIndex' -> IO b) -> IO b
withYoYInflationIndex = GenForeignPtr yidx CYoYInflationIndex'
-> (Ptr CYoYInflationIndex' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr yidx CYoYInflationIndex'
 -> (Ptr CYoYInflationIndex' -> IO b) -> IO b)
-> (GenYoYInflationIndex yidx
    -> GenForeignPtr yidx CYoYInflationIndex')
-> GenYoYInflationIndex yidx
-> (Ptr CYoYInflationIndex' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CYoYInflationIndex' yidx) CInflationIndex'
-> GenForeignPtr yidx CYoYInflationIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CYoYInflationIndex' yidx) CInflationIndex'
 -> GenForeignPtr yidx CYoYInflationIndex')
-> (GenYoYInflationIndex yidx
    -> GenForeignPtr (AnyOf CYoYInflationIndex' yidx) CInflationIndex')
-> GenYoYInflationIndex yidx
-> GenForeignPtr yidx CYoYInflationIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CInflationIndex' (AnyOf CYoYInflationIndex' yidx)) CIndex'
-> GenForeignPtr (AnyOf CYoYInflationIndex' yidx) CInflationIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CInflationIndex' (AnyOf CYoYInflationIndex' yidx)) CIndex'
 -> GenForeignPtr (AnyOf CYoYInflationIndex' yidx) CInflationIndex')
-> (GenYoYInflationIndex yidx
    -> GenForeignPtr
         (AnyOf CInflationIndex' (AnyOf CYoYInflationIndex' yidx)) CIndex')
-> GenYoYInflationIndex yidx
-> GenForeignPtr (AnyOf CYoYInflationIndex' yidx) CInflationIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenYoYInflationIndex yidx
-> GenForeignPtr
     (AnyOf CInflationIndex' (AnyOf CYoYInflationIndex' yidx)) CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex
newGenYoYInflationIndex :: GenForeignPtr yidx CYoYInflationIndex' -> IO (GenYoYInflationIndex yidx)
newGenYoYInflationIndex :: forall yidx.
GenForeignPtr yidx CYoYInflationIndex'
-> IO (GenYoYInflationIndex yidx)
newGenYoYInflationIndex = GenYoYInflationIndex yidx -> IO (GenYoYInflationIndex yidx)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenYoYInflationIndex yidx -> IO (GenYoYInflationIndex yidx))
-> (GenForeignPtr yidx CYoYInflationIndex'
    -> GenYoYInflationIndex yidx)
-> GenForeignPtr yidx CYoYInflationIndex'
-> IO (GenYoYInflationIndex yidx)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CInflationIndex' (AnyOf CYoYInflationIndex' yidx)) CIndex'
-> GenYoYInflationIndex yidx
forall idx. GenForeignPtr idx CIndex' -> GenIndex idx
GenIndex (GenForeignPtr
   (AnyOf CInflationIndex' (AnyOf CYoYInflationIndex' yidx)) CIndex'
 -> GenYoYInflationIndex yidx)
-> (GenForeignPtr yidx CYoYInflationIndex'
    -> GenForeignPtr
         (AnyOf CInflationIndex' (AnyOf CYoYInflationIndex' yidx)) CIndex')
-> GenForeignPtr yidx CYoYInflationIndex'
-> GenYoYInflationIndex yidx
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CYoYInflationIndex' yidx) CInflationIndex'
-> GenForeignPtr
     (AnyOf CInflationIndex' (AnyOf CYoYInflationIndex' yidx)) CIndex'
GenForeignPtr (AnyOf CYoYInflationIndex' yidx) CInflationIndex'
-> GenForeignPtr
     (AnyOf CInflationIndex' (AnyOf CYoYInflationIndex' yidx))
     (Base CInflationIndex')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CYoYInflationIndex' yidx) CInflationIndex'
 -> GenForeignPtr
      (AnyOf CInflationIndex' (AnyOf CYoYInflationIndex' yidx)) CIndex')
-> (GenForeignPtr yidx CYoYInflationIndex'
    -> GenForeignPtr (AnyOf CYoYInflationIndex' yidx) CInflationIndex')
-> GenForeignPtr yidx CYoYInflationIndex'
-> GenForeignPtr
     (AnyOf CInflationIndex' (AnyOf CYoYInflationIndex' yidx)) CIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr yidx CYoYInflationIndex'
-> GenForeignPtr (AnyOf CYoYInflationIndex' yidx) CInflationIndex'
GenForeignPtr yidx CYoYInflationIndex'
-> GenForeignPtr
     (AnyOf CYoYInflationIndex' yidx) (Base CYoYInflationIndex')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf

peekBMAIndex :: Ptr CBMAIndex' -> IO BMAIndex
peekBMAIndex :: Ptr CBMAIndex' -> IO BMAIndex
peekBMAIndex = Ptr CBMAIndex'
-> IO (GenForeignPtr (ForeignPtr CBMAIndex') CInterestRateIndex')
Ptr CBMAIndex'
-> IO (GenForeignPtr (ForeignPtr CBMAIndex') (Base CBMAIndex'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CBMAIndex'
 -> IO (GenForeignPtr (ForeignPtr CBMAIndex') CInterestRateIndex'))
-> (GenForeignPtr (ForeignPtr CBMAIndex') CInterestRateIndex'
    -> IO BMAIndex)
-> Ptr CBMAIndex'
-> IO BMAIndex
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CBMAIndex') CInterestRateIndex'
-> IO BMAIndex
forall ridx.
GenForeignPtr ridx CInterestRateIndex'
-> IO (GenInterestRateIndex ridx)
newGenInterestRateIndex
withBMAIndex :: BMAIndex -> (Ptr CBMAIndex' -> IO b) -> IO b
withBMAIndex :: forall b. BMAIndex -> (Ptr CBMAIndex' -> IO b) -> IO b
withBMAIndex = ForeignPtr CBMAIndex' -> (Ptr CBMAIndex' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CBMAIndex' -> (Ptr CBMAIndex' -> IO b) -> IO b)
-> (BMAIndex -> ForeignPtr CBMAIndex')
-> BMAIndex
-> (Ptr CBMAIndex' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CBMAIndex') CInterestRateIndex'
-> ForeignPtr CBMAIndex'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CBMAIndex') CInterestRateIndex'
 -> ForeignPtr CBMAIndex')
-> (BMAIndex
    -> GenForeignPtr (ForeignPtr CBMAIndex') CInterestRateIndex')
-> BMAIndex
-> ForeignPtr CBMAIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CInterestRateIndex' (ForeignPtr CBMAIndex')) CIndex'
-> GenForeignPtr (ForeignPtr CBMAIndex') CInterestRateIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CInterestRateIndex' (ForeignPtr CBMAIndex')) CIndex'
 -> GenForeignPtr (ForeignPtr CBMAIndex') CInterestRateIndex')
-> (BMAIndex
    -> GenForeignPtr
         (AnyOf CInterestRateIndex' (ForeignPtr CBMAIndex')) CIndex')
-> BMAIndex
-> GenForeignPtr (ForeignPtr CBMAIndex') CInterestRateIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BMAIndex
-> GenForeignPtr
     (AnyOf CInterestRateIndex' (ForeignPtr CBMAIndex')) CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex

asIborIndex :: GenIborIndex ibor -> IO IborIndex
asIborIndex :: forall ibor. GenIborIndex ibor -> IO IborIndex
asIborIndex = (Ptr CIborIndex' -> IO IborIndex)
-> GenForeignPtr ibor CIborIndex' -> IO IborIndex
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CIborIndex' -> IO IborIndex
peekIborIndex (GenForeignPtr ibor CIborIndex' -> IO IborIndex)
-> (GenIborIndex ibor -> GenForeignPtr ibor CIborIndex')
-> GenIborIndex ibor
-> IO IborIndex
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex'
-> GenForeignPtr ibor CIborIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex'
 -> GenForeignPtr ibor CIborIndex')
-> (GenIborIndex ibor
    -> GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex')
-> GenIborIndex ibor
-> GenForeignPtr ibor CIborIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor)) CIndex'
-> GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor)) CIndex'
 -> GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex')
-> (GenIborIndex ibor
    -> GenForeignPtr
         (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor)) CIndex')
-> GenIborIndex ibor
-> GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenIborIndex ibor
-> GenForeignPtr
     (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor)) CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex
peekIborIndex :: Ptr CIborIndex' -> IO IborIndex
peekIborIndex :: Ptr CIborIndex' -> IO IborIndex
peekIborIndex = Ptr CIborIndex'
-> IO (GenForeignPtr (ForeignPtr CIborIndex') CIborIndex')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CIborIndex'
 -> IO (GenForeignPtr (ForeignPtr CIborIndex') CIborIndex'))
-> (GenForeignPtr (ForeignPtr CIborIndex') CIborIndex'
    -> IO IborIndex)
-> Ptr CIborIndex'
-> IO IborIndex
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CIborIndex') CIborIndex' -> IO IborIndex
forall ibor.
GenForeignPtr ibor CIborIndex' -> IO (GenIborIndex ibor)
newGenIborIndex
withIborIndex :: GenIborIndex ibor -> (Ptr CIborIndex' -> IO b) -> IO b
withIborIndex :: forall ibor b.
GenIborIndex ibor -> (Ptr CIborIndex' -> IO b) -> IO b
withIborIndex = GenForeignPtr ibor CIborIndex' -> (Ptr CIborIndex' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr ibor CIborIndex'
 -> (Ptr CIborIndex' -> IO b) -> IO b)
-> (GenIborIndex ibor -> GenForeignPtr ibor CIborIndex')
-> GenIborIndex ibor
-> (Ptr CIborIndex' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex'
-> GenForeignPtr ibor CIborIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex'
 -> GenForeignPtr ibor CIborIndex')
-> (GenIborIndex ibor
    -> GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex')
-> GenIborIndex ibor
-> GenForeignPtr ibor CIborIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor)) CIndex'
-> GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor)) CIndex'
 -> GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex')
-> (GenIborIndex ibor
    -> GenForeignPtr
         (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor)) CIndex')
-> GenIborIndex ibor
-> GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenIborIndex ibor
-> GenForeignPtr
     (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor)) CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex
withMaybeIborIndex :: Maybe (GenIborIndex ibor) -> (Ptr CIborIndex' -> IO b) -> IO b
withMaybeIborIndex :: forall ibor b.
Maybe (GenIborIndex ibor) -> (Ptr CIborIndex' -> IO b) -> IO b
withMaybeIborIndex Maybe (GenIborIndex ibor)
x Ptr CIborIndex' -> IO b
f = IO b
-> (GenIborIndex ibor -> IO b) -> Maybe (GenIborIndex ibor) -> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Ptr CIborIndex' -> IO b
f Ptr CIborIndex'
forall a. Ptr a
nullPtr) (GenIborIndex ibor -> (Ptr CIborIndex' -> IO b) -> IO b
forall ibor b.
GenIborIndex ibor -> (Ptr CIborIndex' -> IO b) -> IO b
`withIborIndex` Ptr CIborIndex' -> IO b
f) Maybe (GenIborIndex ibor)
x
newGenIborIndex :: GenForeignPtr ibor CIborIndex' -> IO (GenIborIndex ibor)
newGenIborIndex :: forall ibor.
GenForeignPtr ibor CIborIndex' -> IO (GenIborIndex ibor)
newGenIborIndex = GenIborIndex ibor -> IO (GenIborIndex ibor)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenIborIndex ibor -> IO (GenIborIndex ibor))
-> (GenForeignPtr ibor CIborIndex' -> GenIborIndex ibor)
-> GenForeignPtr ibor CIborIndex'
-> IO (GenIborIndex ibor)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor)) CIndex'
-> GenIborIndex ibor
forall idx. GenForeignPtr idx CIndex' -> GenIndex idx
GenIndex (GenForeignPtr
   (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor)) CIndex'
 -> GenIborIndex ibor)
-> (GenForeignPtr ibor CIborIndex'
    -> GenForeignPtr
         (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor)) CIndex')
-> GenForeignPtr ibor CIborIndex'
-> GenIborIndex ibor
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex'
-> GenForeignPtr
     (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor)) CIndex'
GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex'
-> GenForeignPtr
     (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor))
     (Base CInterestRateIndex')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex'
 -> GenForeignPtr
      (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor)) CIndex')
-> (GenForeignPtr ibor CIborIndex'
    -> GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex')
-> GenForeignPtr ibor CIborIndex'
-> GenForeignPtr
     (AnyOf CInterestRateIndex' (AnyOf CIborIndex' ibor)) CIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr ibor CIborIndex'
-> GenForeignPtr (AnyOf CIborIndex' ibor) CInterestRateIndex'
GenForeignPtr ibor CIborIndex'
-> GenForeignPtr (AnyOf CIborIndex' ibor) (Base CIborIndex')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf

peekOvernightIborIndex :: Ptr COvernightIndex' -> IO OvernightIborIndex
peekOvernightIborIndex :: Ptr COvernightIndex' -> IO OvernightIborIndex
peekOvernightIborIndex = Ptr COvernightIndex'
-> IO (GenForeignPtr (ForeignPtr COvernightIndex') CIborIndex')
Ptr COvernightIndex'
-> IO
     (GenForeignPtr
        (ForeignPtr COvernightIndex') (Base COvernightIndex'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr COvernightIndex'
 -> IO (GenForeignPtr (ForeignPtr COvernightIndex') CIborIndex'))
-> (GenForeignPtr (ForeignPtr COvernightIndex') CIborIndex'
    -> IO OvernightIborIndex)
-> Ptr COvernightIndex'
-> IO OvernightIborIndex
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr COvernightIndex') CIborIndex'
-> IO OvernightIborIndex
forall ibor.
GenForeignPtr ibor CIborIndex' -> IO (GenIborIndex ibor)
newGenIborIndex
withOvernightIborIndex :: OvernightIborIndex -> (Ptr COvernightIndex' -> IO b) -> IO b
withOvernightIborIndex :: forall b.
OvernightIborIndex -> (Ptr COvernightIndex' -> IO b) -> IO b
withOvernightIborIndex = ForeignPtr COvernightIndex'
-> (Ptr COvernightIndex' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr COvernightIndex'
 -> (Ptr COvernightIndex' -> IO b) -> IO b)
-> (OvernightIborIndex -> ForeignPtr COvernightIndex')
-> OvernightIborIndex
-> (Ptr COvernightIndex' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr COvernightIndex') CIborIndex'
-> ForeignPtr COvernightIndex'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr COvernightIndex') CIborIndex'
 -> ForeignPtr COvernightIndex')
-> (OvernightIborIndex
    -> GenForeignPtr (ForeignPtr COvernightIndex') CIborIndex')
-> OvernightIborIndex
-> ForeignPtr COvernightIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CIborIndex' (ForeignPtr COvernightIndex'))
  CInterestRateIndex'
-> GenForeignPtr (ForeignPtr COvernightIndex') CIborIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CIborIndex' (ForeignPtr COvernightIndex'))
   CInterestRateIndex'
 -> GenForeignPtr (ForeignPtr COvernightIndex') CIborIndex')
-> (OvernightIborIndex
    -> GenForeignPtr
         (AnyOf CIborIndex' (ForeignPtr COvernightIndex'))
         CInterestRateIndex')
-> OvernightIborIndex
-> GenForeignPtr (ForeignPtr COvernightIndex') CIborIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CInterestRateIndex'
     (AnyOf CIborIndex' (ForeignPtr COvernightIndex')))
  CIndex'
-> GenForeignPtr
     (AnyOf CIborIndex' (ForeignPtr COvernightIndex'))
     CInterestRateIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CInterestRateIndex'
      (AnyOf CIborIndex' (ForeignPtr COvernightIndex')))
   CIndex'
 -> GenForeignPtr
      (AnyOf CIborIndex' (ForeignPtr COvernightIndex'))
      CInterestRateIndex')
-> (OvernightIborIndex
    -> GenForeignPtr
         (AnyOf
            CInterestRateIndex'
            (AnyOf CIborIndex' (ForeignPtr COvernightIndex')))
         CIndex')
-> OvernightIborIndex
-> GenForeignPtr
     (AnyOf CIborIndex' (ForeignPtr COvernightIndex'))
     CInterestRateIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OvernightIborIndex
-> GenForeignPtr
     (AnyOf
        CInterestRateIndex'
        (AnyOf CIborIndex' (ForeignPtr COvernightIndex')))
     CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex

asSwapIndex :: GenSwapIndex sidx -> IO SwapIndex
asSwapIndex :: forall sidx. GenSwapIndex sidx -> IO SwapIndex
asSwapIndex = (Ptr CSwapIndex' -> IO SwapIndex)
-> GenForeignPtr sidx CSwapIndex' -> IO SwapIndex
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CSwapIndex' -> IO SwapIndex
peekSwapIndex (GenForeignPtr sidx CSwapIndex' -> IO SwapIndex)
-> (GenSwapIndex sidx -> GenForeignPtr sidx CSwapIndex')
-> GenSwapIndex sidx
-> IO SwapIndex
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex'
-> GenForeignPtr sidx CSwapIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex'
 -> GenForeignPtr sidx CSwapIndex')
-> (GenSwapIndex sidx
    -> GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex')
-> GenSwapIndex sidx
-> GenForeignPtr sidx CSwapIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx)) CIndex'
-> GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx)) CIndex'
 -> GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex')
-> (GenSwapIndex sidx
    -> GenForeignPtr
         (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx)) CIndex')
-> GenSwapIndex sidx
-> GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenSwapIndex sidx
-> GenForeignPtr
     (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx)) CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex
peekSwapIndex :: Ptr CSwapIndex' -> IO SwapIndex
peekSwapIndex :: Ptr CSwapIndex' -> IO SwapIndex
peekSwapIndex = Ptr CSwapIndex'
-> IO (GenForeignPtr (ForeignPtr CSwapIndex') CSwapIndex')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CSwapIndex'
 -> IO (GenForeignPtr (ForeignPtr CSwapIndex') CSwapIndex'))
-> (GenForeignPtr (ForeignPtr CSwapIndex') CSwapIndex'
    -> IO SwapIndex)
-> Ptr CSwapIndex'
-> IO SwapIndex
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CSwapIndex') CSwapIndex' -> IO SwapIndex
forall sidx.
GenForeignPtr sidx CSwapIndex' -> IO (GenSwapIndex sidx)
newGenSwapIndex
withSwapIndex :: GenSwapIndex sidx -> (Ptr CSwapIndex' -> IO b) -> IO b
withSwapIndex :: forall sidx b.
GenSwapIndex sidx -> (Ptr CSwapIndex' -> IO b) -> IO b
withSwapIndex  = GenForeignPtr sidx CSwapIndex' -> (Ptr CSwapIndex' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr sidx CSwapIndex'
 -> (Ptr CSwapIndex' -> IO b) -> IO b)
-> (GenSwapIndex sidx -> GenForeignPtr sidx CSwapIndex')
-> GenSwapIndex sidx
-> (Ptr CSwapIndex' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex'
-> GenForeignPtr sidx CSwapIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex'
 -> GenForeignPtr sidx CSwapIndex')
-> (GenSwapIndex sidx
    -> GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex')
-> GenSwapIndex sidx
-> GenForeignPtr sidx CSwapIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx)) CIndex'
-> GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx)) CIndex'
 -> GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex')
-> (GenSwapIndex sidx
    -> GenForeignPtr
         (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx)) CIndex')
-> GenSwapIndex sidx
-> GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenSwapIndex sidx
-> GenForeignPtr
     (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx)) CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex
withMaybeSwapIndex :: Maybe (GenSwapIndex sidx) -> (Ptr CSwapIndex' -> IO b) -> IO b
withMaybeSwapIndex :: forall sidx b.
Maybe (GenSwapIndex sidx) -> (Ptr CSwapIndex' -> IO b) -> IO b
withMaybeSwapIndex Maybe (GenSwapIndex sidx)
x Ptr CSwapIndex' -> IO b
f = IO b
-> (GenSwapIndex sidx -> IO b) -> Maybe (GenSwapIndex sidx) -> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Ptr CSwapIndex' -> IO b
f Ptr CSwapIndex'
forall a. Ptr a
nullPtr) (GenSwapIndex sidx -> (Ptr CSwapIndex' -> IO b) -> IO b
forall sidx b.
GenSwapIndex sidx -> (Ptr CSwapIndex' -> IO b) -> IO b
`withSwapIndex` Ptr CSwapIndex' -> IO b
f) Maybe (GenSwapIndex sidx)
x
newGenSwapIndex :: GenForeignPtr sidx CSwapIndex' -> IO (GenSwapIndex sidx)
newGenSwapIndex :: forall sidx.
GenForeignPtr sidx CSwapIndex' -> IO (GenSwapIndex sidx)
newGenSwapIndex = GenSwapIndex sidx -> IO (GenSwapIndex sidx)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenSwapIndex sidx -> IO (GenSwapIndex sidx))
-> (GenForeignPtr sidx CSwapIndex' -> GenSwapIndex sidx)
-> GenForeignPtr sidx CSwapIndex'
-> IO (GenSwapIndex sidx)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx)) CIndex'
-> GenSwapIndex sidx
forall idx. GenForeignPtr idx CIndex' -> GenIndex idx
GenIndex (GenForeignPtr
   (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx)) CIndex'
 -> GenSwapIndex sidx)
-> (GenForeignPtr sidx CSwapIndex'
    -> GenForeignPtr
         (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx)) CIndex')
-> GenForeignPtr sidx CSwapIndex'
-> GenSwapIndex sidx
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex'
-> GenForeignPtr
     (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx)) CIndex'
GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex'
-> GenForeignPtr
     (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx))
     (Base CInterestRateIndex')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex'
 -> GenForeignPtr
      (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx)) CIndex')
-> (GenForeignPtr sidx CSwapIndex'
    -> GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex')
-> GenForeignPtr sidx CSwapIndex'
-> GenForeignPtr
     (AnyOf CInterestRateIndex' (AnyOf CSwapIndex' sidx)) CIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr sidx CSwapIndex'
-> GenForeignPtr (AnyOf CSwapIndex' sidx) CInterestRateIndex'
GenForeignPtr sidx CSwapIndex'
-> GenForeignPtr (AnyOf CSwapIndex' sidx) (Base CSwapIndex')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf

peekSwapSpreadIndex :: Ptr CSwapSpreadIndex' -> IO SwapSpreadIndex
peekSwapSpreadIndex :: Ptr CSwapSpreadIndex' -> IO SwapSpreadIndex
peekSwapSpreadIndex = Ptr CSwapSpreadIndex'
-> IO
     (GenForeignPtr (ForeignPtr CSwapSpreadIndex') CInterestRateIndex')
Ptr CSwapSpreadIndex'
-> IO
     (GenForeignPtr
        (ForeignPtr CSwapSpreadIndex') (Base CSwapSpreadIndex'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CSwapSpreadIndex'
 -> IO
      (GenForeignPtr (ForeignPtr CSwapSpreadIndex') CInterestRateIndex'))
-> (GenForeignPtr
      (ForeignPtr CSwapSpreadIndex') CInterestRateIndex'
    -> IO SwapSpreadIndex)
-> Ptr CSwapSpreadIndex'
-> IO SwapSpreadIndex
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CSwapSpreadIndex') CInterestRateIndex'
-> IO SwapSpreadIndex
forall ridx.
GenForeignPtr ridx CInterestRateIndex'
-> IO (GenInterestRateIndex ridx)
newGenInterestRateIndex
withSwapSpreadIndex :: SwapSpreadIndex -> (Ptr CSwapSpreadIndex' -> IO b) -> IO b
withSwapSpreadIndex :: forall b.
SwapSpreadIndex -> (Ptr CSwapSpreadIndex' -> IO b) -> IO b
withSwapSpreadIndex = ForeignPtr CSwapSpreadIndex'
-> (Ptr CSwapSpreadIndex' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CSwapSpreadIndex'
 -> (Ptr CSwapSpreadIndex' -> IO b) -> IO b)
-> (SwapSpreadIndex -> ForeignPtr CSwapSpreadIndex')
-> SwapSpreadIndex
-> (Ptr CSwapSpreadIndex' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CSwapSpreadIndex') CInterestRateIndex'
-> ForeignPtr CSwapSpreadIndex'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CSwapSpreadIndex') CInterestRateIndex'
 -> ForeignPtr CSwapSpreadIndex')
-> (SwapSpreadIndex
    -> GenForeignPtr
         (ForeignPtr CSwapSpreadIndex') CInterestRateIndex')
-> SwapSpreadIndex
-> ForeignPtr CSwapSpreadIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CInterestRateIndex' (ForeignPtr CSwapSpreadIndex')) CIndex'
-> GenForeignPtr (ForeignPtr CSwapSpreadIndex') CInterestRateIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CInterestRateIndex' (ForeignPtr CSwapSpreadIndex')) CIndex'
 -> GenForeignPtr
      (ForeignPtr CSwapSpreadIndex') CInterestRateIndex')
-> (SwapSpreadIndex
    -> GenForeignPtr
         (AnyOf CInterestRateIndex' (ForeignPtr CSwapSpreadIndex')) CIndex')
-> SwapSpreadIndex
-> GenForeignPtr (ForeignPtr CSwapSpreadIndex') CInterestRateIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SwapSpreadIndex
-> GenForeignPtr
     (AnyOf CInterestRateIndex' (ForeignPtr CSwapSpreadIndex')) CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex

peekOvernightIndexedSwapIndex :: Ptr COvernightIndexedSwapIndex' -> IO OvernightIndexedSwapIndex
peekOvernightIndexedSwapIndex :: Ptr COvernightIndexedSwapIndex' -> IO OvernightIndexedSwapIndex
peekOvernightIndexedSwapIndex = Ptr COvernightIndexedSwapIndex'
-> IO
     (GenForeignPtr
        (ForeignPtr COvernightIndexedSwapIndex') CSwapIndex')
Ptr COvernightIndexedSwapIndex'
-> IO
     (GenForeignPtr
        (ForeignPtr COvernightIndexedSwapIndex')
        (Base COvernightIndexedSwapIndex'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr COvernightIndexedSwapIndex'
 -> IO
      (GenForeignPtr
         (ForeignPtr COvernightIndexedSwapIndex') CSwapIndex'))
-> (GenForeignPtr
      (ForeignPtr COvernightIndexedSwapIndex') CSwapIndex'
    -> IO OvernightIndexedSwapIndex)
-> Ptr COvernightIndexedSwapIndex'
-> IO OvernightIndexedSwapIndex
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr COvernightIndexedSwapIndex') CSwapIndex'
-> IO OvernightIndexedSwapIndex
forall sidx.
GenForeignPtr sidx CSwapIndex' -> IO (GenSwapIndex sidx)
newGenSwapIndex
withOvernightIndexedSwapIndex :: OvernightIndexedSwapIndex -> (Ptr COvernightIndexedSwapIndex' -> IO b) -> IO b
withOvernightIndexedSwapIndex :: forall b.
OvernightIndexedSwapIndex
-> (Ptr COvernightIndexedSwapIndex' -> IO b) -> IO b
withOvernightIndexedSwapIndex = ForeignPtr COvernightIndexedSwapIndex'
-> (Ptr COvernightIndexedSwapIndex' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr  (ForeignPtr COvernightIndexedSwapIndex'
 -> (Ptr COvernightIndexedSwapIndex' -> IO b) -> IO b)
-> (OvernightIndexedSwapIndex
    -> ForeignPtr COvernightIndexedSwapIndex')
-> OvernightIndexedSwapIndex
-> (Ptr COvernightIndexedSwapIndex' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.GenForeignPtr (ForeignPtr COvernightIndexedSwapIndex') CSwapIndex'
-> ForeignPtr COvernightIndexedSwapIndex'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr COvernightIndexedSwapIndex') CSwapIndex'
 -> ForeignPtr COvernightIndexedSwapIndex')
-> (OvernightIndexedSwapIndex
    -> GenForeignPtr
         (ForeignPtr COvernightIndexedSwapIndex') CSwapIndex')
-> OvernightIndexedSwapIndex
-> ForeignPtr COvernightIndexedSwapIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwapIndex' (ForeignPtr COvernightIndexedSwapIndex'))
  CInterestRateIndex'
-> GenForeignPtr
     (ForeignPtr COvernightIndexedSwapIndex') CSwapIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CSwapIndex' (ForeignPtr COvernightIndexedSwapIndex'))
   CInterestRateIndex'
 -> GenForeignPtr
      (ForeignPtr COvernightIndexedSwapIndex') CSwapIndex')
-> (OvernightIndexedSwapIndex
    -> GenForeignPtr
         (AnyOf CSwapIndex' (ForeignPtr COvernightIndexedSwapIndex'))
         CInterestRateIndex')
-> OvernightIndexedSwapIndex
-> GenForeignPtr
     (ForeignPtr COvernightIndexedSwapIndex') CSwapIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CInterestRateIndex'
     (AnyOf CSwapIndex' (ForeignPtr COvernightIndexedSwapIndex')))
  CIndex'
-> GenForeignPtr
     (AnyOf CSwapIndex' (ForeignPtr COvernightIndexedSwapIndex'))
     CInterestRateIndex'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CInterestRateIndex'
      (AnyOf CSwapIndex' (ForeignPtr COvernightIndexedSwapIndex')))
   CIndex'
 -> GenForeignPtr
      (AnyOf CSwapIndex' (ForeignPtr COvernightIndexedSwapIndex'))
      CInterestRateIndex')
-> (OvernightIndexedSwapIndex
    -> GenForeignPtr
         (AnyOf
            CInterestRateIndex'
            (AnyOf CSwapIndex' (ForeignPtr COvernightIndexedSwapIndex')))
         CIndex')
-> OvernightIndexedSwapIndex
-> GenForeignPtr
     (AnyOf CSwapIndex' (ForeignPtr COvernightIndexedSwapIndex'))
     CInterestRateIndex'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OvernightIndexedSwapIndex
-> GenForeignPtr
     (AnyOf
        CInterestRateIndex'
        (AnyOf CSwapIndex' (ForeignPtr COvernightIndexedSwapIndex')))
     CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex

data CEquityIndex'
type CEquityIndex = ForeignPtr CEquityIndex'
-- |An 'Index'; see the hierarchy under t'GenIndex'.
type EquityIndex = GenIndex CEquityIndex
foreign import ccall unsafe "ql.h &qlFreeEquityIndex" qlFreeEquityIndex :: FinalizerPtr CEquityIndex'
instance Finalizable CEquityIndex' where finalize :: FinalizerPtr CEquityIndex'
finalize = FinalizerPtr CEquityIndex'
qlFreeEquityIndex
foreign import ccall "ql.h qlEquityIndexAsIndex" qlEquityIndexAsIndex :: Ptr CEquityIndex' -> IO (Ptr CIndex')
instance Upcastable CEquityIndex' where {type Base CEquityIndex' = CIndex'; upcast :: Ptr CEquityIndex' -> IO (Ptr (Base CEquityIndex'))
upcast = Ptr CEquityIndex' -> IO (Ptr CIndex')
Ptr CEquityIndex' -> IO (Ptr (Base CEquityIndex'))
qlEquityIndexAsIndex}
peekEquityIndex :: Ptr CEquityIndex' -> IO EquityIndex
peekEquityIndex :: Ptr CEquityIndex' -> IO EquityIndex
peekEquityIndex = GenForeignPtr CEquityIndex CIndex' -> EquityIndex
forall idx. GenForeignPtr idx CIndex' -> GenIndex idx
GenIndex (GenForeignPtr CEquityIndex CIndex' -> EquityIndex)
-> (Ptr CEquityIndex' -> IO (GenForeignPtr CEquityIndex CIndex'))
-> Ptr CEquityIndex'
-> IO EquityIndex
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CEquityIndex' -> IO (GenForeignPtr CEquityIndex CIndex')
Ptr CEquityIndex'
-> IO (GenForeignPtr CEquityIndex (Base CEquityIndex'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
withEquityIndex :: EquityIndex -> (Ptr CEquityIndex' -> IO b) -> IO b
withEquityIndex :: forall b. EquityIndex -> (Ptr CEquityIndex' -> IO b) -> IO b
withEquityIndex = CEquityIndex -> (Ptr CEquityIndex' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (CEquityIndex -> (Ptr CEquityIndex' -> IO b) -> IO b)
-> (EquityIndex -> CEquityIndex)
-> EquityIndex
-> (Ptr CEquityIndex' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr CEquityIndex CIndex' -> CEquityIndex
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr CEquityIndex CIndex' -> CEquityIndex)
-> (EquityIndex -> GenForeignPtr CEquityIndex CIndex')
-> EquityIndex
-> CEquityIndex
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EquityIndex -> GenForeignPtr CEquityIndex CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex

-- | A plain 'Index' leaf, mirroring 'EquityIndex' -- no subclasses upstream.
data CCommodityIndex'
type CCommodityIndex = ForeignPtr CCommodityIndex'
-- |An 'Index'; see the hierarchy under t'GenIndex'.
type CommodityIndex = GenIndex CCommodityIndex
foreign import ccall unsafe "ql.h &qlFreeCommodityIndex" qlFreeCommodityIndex :: FinalizerPtr CCommodityIndex'
instance Finalizable CCommodityIndex' where finalize :: FinalizerPtr CCommodityIndex'
finalize = FinalizerPtr CCommodityIndex'
qlFreeCommodityIndex
foreign import ccall "ql.h qlCommodityIndexAsIndex" qlCommodityIndexAsIndex :: Ptr CCommodityIndex' -> IO (Ptr CIndex')
instance Upcastable CCommodityIndex' where {type Base CCommodityIndex' = CIndex'; upcast :: Ptr CCommodityIndex' -> IO (Ptr (Base CCommodityIndex'))
upcast = Ptr CCommodityIndex' -> IO (Ptr CIndex')
Ptr CCommodityIndex' -> IO (Ptr (Base CCommodityIndex'))
qlCommodityIndexAsIndex}
peekCommodityIndex :: Ptr CCommodityIndex' -> IO CommodityIndex
peekCommodityIndex :: Ptr CCommodityIndex' -> IO CommodityIndex
peekCommodityIndex = GenForeignPtr CCommodityIndex CIndex' -> CommodityIndex
forall idx. GenForeignPtr idx CIndex' -> GenIndex idx
GenIndex (GenForeignPtr CCommodityIndex CIndex' -> CommodityIndex)
-> (Ptr CCommodityIndex'
    -> IO (GenForeignPtr CCommodityIndex CIndex'))
-> Ptr CCommodityIndex'
-> IO CommodityIndex
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCommodityIndex' -> IO (GenForeignPtr CCommodityIndex CIndex')
Ptr CCommodityIndex'
-> IO (GenForeignPtr CCommodityIndex (Base CCommodityIndex'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
withCommodityIndex :: CommodityIndex -> (Ptr CCommodityIndex' -> IO b) -> IO b
withCommodityIndex :: forall b. CommodityIndex -> (Ptr CCommodityIndex' -> IO b) -> IO b
withCommodityIndex = CCommodityIndex -> (Ptr CCommodityIndex' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (CCommodityIndex -> (Ptr CCommodityIndex' -> IO b) -> IO b)
-> (CommodityIndex -> CCommodityIndex)
-> CommodityIndex
-> (Ptr CCommodityIndex' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr CCommodityIndex CIndex' -> CCommodityIndex
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr CCommodityIndex CIndex' -> CCommodityIndex)
-> (CommodityIndex -> GenForeignPtr CCommodityIndex CIndex')
-> CommodityIndex
-> CCommodityIndex
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CommodityIndex -> GenForeignPtr CCommodityIndex CIndex'
forall idx. GenIndex idx -> GenForeignPtr idx CIndex'
getIndex

-- |The root of the hierarchy shown under t'GenTermStructure'.
type TermStructure = GenTermStructure CTermStructure
data CTermStructure'
data CVolatilityTermStructure'
data COptionletVolatilityStructure'
data CRelinkableOptionletVolatilityStructure'
data CSwaptionVolatilityStructure'
data CRelinkableSwaptionVolatilityStructure'
data CSabrSwaptionVolatilityCube'
data CNoArbSabrSwaptionVolatilityCube'
data CZabrSwaptionVolatilityCube'
data CInterpolatedSwaptionVolatilityCube'
data CCapFloorTermVolatilityStructure'
data CCapFloorTermVolCurve'
data CCapFloorTermVolSurface'
data CLocalVolTermStructure'
data CGridModelLocalVolSurface'
data CAndreasenHugeVolatilityInterpl
data CYoYOptionletVolatilitySurface'
data CCPIVolatilitySurface'
data CBlackVolTermStructure'
data CRelinkableBlackVolTermStructure'
data CBlackVarianceCurve'
data CBlackVolatilitySurfaceDelta'
data CYieldTermStructure'
data CFittedBondDiscountCurve'
data CRelinkableYieldTermStructure'
data CCallableBondVolatilityStructure'
data CDefaultProbabilityTermStructure'
data CAffineHazardRateCurve'
data CZeroInflationTermStructure'
data CYoYInflationTermStructure'
data CCommodityCurve'
-- | > TermStructure = GenTermStructure t
-- >  YieldTermStructure = GenYieldTermStructure y = GenTermStructure t
-- >    FittedBondDiscountCurve = GenYieldTermStructure ...
-- >    RelinkableYieldTermStructure = GenYieldTermStructure ...
-- >  VolatilityTermStructure
-- >    OptionletVolatilityStructure
-- >      RelinkableOptionletVolatilityStructure
-- >    BlackVolTermStructure
-- >      BlackVarianceCurve
-- >      BlackVolatilitySurfaceDelta
-- >      RelinkableBlackVolTermStructure
-- >    SwaptionVolatilityStructure
-- >      RelinkableSwaptionVolatilityStructure
-- >      SabrSwaptionVolatilityCube
-- >      NoArbSabrSwaptionVolatilityCube
-- >      ZabrSwaptionVolatilityCube
-- >      InterpolatedSwaptionVolatilityCube
-- >      SwaptionVolatilityMatrix
-- >    CapFloorTermVolatilityStructure*
-- >      CapFloorTermVolCurve
-- >      CapFloorTermVolSurface
-- >    BlackAtmVolCurve*
-- >      AbcdAtmVolCurve
-- >      BlackVolSurface*
-- >        SabrVolSurface
-- >    LocalVolTermStructure
-- >      GridModelLocalVolSurface
-- >    YoYOptionletVolatilitySurface
-- >    CPIVolatilitySurface
-- >  CallableBondVolatilityStructure
-- >  DefaultProbabilityTermStructure = GenDefaultProbabilityTermStructure d = GenTermStructure t
-- >    AffineHazardRateCurve = GenDefaultProbabilityTermStructure ...
-- >  ZeroInflationTermStructure
-- >  YoYInflationTermStructure
-- >  YoYCapFloorTermPriceSurface
-- >  CPICapFloorTermPriceSurface
-- >  CommodityCurve
newtype GenTermStructure t = GenTermStructure {forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure :: GenForeignPtr t CTermStructure'}
type CTermStructure = ForeignPtr CTermStructure'
-- |A 'YieldTermStructure' or one of its leaves; see the hierarchy under t'GenTermStructure'.
type GenYieldTermStructure y = GenTermStructure (AnyOf CYieldTermStructure' y)
type CYieldTermStructure = ForeignPtr CYieldTermStructure'
-- |A 'TermStructure'; see the hierarchy under t'GenTermStructure'.
type YieldTermStructure = GenYieldTermStructure CYieldTermStructure
type CFittedBondDiscountCurve = ForeignPtr CFittedBondDiscountCurve'
-- |A 'YieldTermStructure'; see the hierarchy under t'GenTermStructure'.
type FittedBondDiscountCurve = GenYieldTermStructure CFittedBondDiscountCurve
type CRelinkableYieldTermStructure = ForeignPtr CRelinkableYieldTermStructure'
-- | A curve held behind a relinkable handle. It /is/ a 'YieldTermStructure' -- pass it
-- anywhere a curve is expected and it upcasts like any other hierarchy member, sharing its
-- @Link@ so that a later 'QuantLib.TermStructure.Yield.linkTo' reaches everything already
-- built on it.
-- See the hierarchy under t'GenTermStructure'.
type RelinkableYieldTermStructure = GenYieldTermStructure CRelinkableYieldTermStructure
-- |A 'VolatilityTermStructure' or one of its leaves; see the hierarchy under t'GenTermStructure'.
type GenVolatilityTermStructure v = GenTermStructure (AnyOf CVolatilityTermStructure' v)
type CVolatilityTermStructure = ForeignPtr CVolatilityTermStructure'
-- |A 'TermStructure'; see the hierarchy under t'GenTermStructure'.
type VolatilityTermStructure = GenVolatilityTermStructure CVolatilityTermStructure
-- |An 'OptionletVolatilityStructure' or one of its leaves; see the hierarchy under t'GenTermStructure'.
type GenOptionletVolatilityStructure ov = GenVolatilityTermStructure (AnyOf COptionletVolatilityStructure' ov)
type COptionletVolatilityStructure = ForeignPtr COptionletVolatilityStructure'
-- |A 'VolatilityTermStructure'; see the hierarchy under t'GenTermStructure'.
type OptionletVolatilityStructure = GenOptionletVolatilityStructure COptionletVolatilityStructure
type CRelinkableOptionletVolatilityStructure = ForeignPtr CRelinkableOptionletVolatilityStructure'
-- | An optionlet vol surface held behind a relinkable handle. It /is/ an
-- 'OptionletVolatilityStructure' -- pass it anywhere one is expected and it upcasts like any
-- other hierarchy member, sharing its @Link@ so that a later
-- 'QuantLib.TermStructure.Volatility.linkOptionletVolTo' reaches everything already built on
-- it. Mirrors 'RelinkableSwaptionVolatilityStructure'.
-- See the hierarchy under t'GenTermStructure'.
type RelinkableOptionletVolatilityStructure = GenOptionletVolatilityStructure CRelinkableOptionletVolatilityStructure
-- |A 'CapFloorTermVolatilityStructure' or one of its leaves; see the hierarchy under t'GenTermStructure'.
type GenCapFloorTermVolatilityStructure c = GenVolatilityTermStructure (AnyOf CCapFloorTermVolatilityStructure' c)
type CCapFloorTermVolatilityStructure = ForeignPtr CCapFloorTermVolatilityStructure'
-- | The abstract root shared by 'ConstantCapFloorTermVolatility' (erased straight to this type at
-- construction, having no calc\/getter of its own beyond 'capFloorVolatility',
-- mirroring 'ConstantOptionletVolatility' \/\'OptionletVolatilityStructure'), and the two dedicated
-- leaves below. Promoted out of a flat 'VolatilityTermStructure' leaf (the way
-- 'YoYOptionletVolatilitySurface' still is) specifically so 'capFloorVolatility' -- declared on
-- @CapFloorTermVolatilityStructure@ upstream, not on 'VolatilityTermStructure' -- can be bound
-- generically without a @dynamic_pointer_cast@ in the shim.
-- See the hierarchy under t'GenTermStructure'.
type CapFloorTermVolatilityStructure = GenCapFloorTermVolatilityStructure CCapFloorTermVolatilityStructure
type CCapFloorTermVolCurve = ForeignPtr CCapFloorTermVolCurve'
-- | An ATM-only cap\/floor term vol curve (no strike dimension, unlike 'CapFloorTermVolSurface').
-- Gets its own dedicated leaf (rather than erasing to 'CapFloorTermVolatilityStructure' the way
-- 'ConstantCapFloorTermVolatility' does) so a future binding of @OptionletStripper2@ -- which takes
-- a concrete @Handle\<CapFloorTermVolCurve\>@ upstream -- has a type to reach for without another
-- breaking change here.
-- See the hierarchy under t'GenTermStructure'.
type CapFloorTermVolCurve = GenCapFloorTermVolatilityStructure CCapFloorTermVolCurve
type CCapFloorTermVolSurface = ForeignPtr CCapFloorTermVolSurface'
-- |A 'CapFloorTermVolatilityStructure'; see the hierarchy under t'GenTermStructure'.
type CapFloorTermVolSurface = GenCapFloorTermVolatilityStructure CCapFloorTermVolSurface
type GenSwaptionVolatilityStructure sv = GenVolatilityTermStructure (AnyOf CSwaptionVolatilityStructure' sv)
type CSwaptionVolatilityStructure = ForeignPtr CSwaptionVolatilityStructure'
-- |A 'VolatilityTermStructure'; see the hierarchy under t'GenTermStructure'.
type SwaptionVolatilityStructure = GenSwaptionVolatilityStructure CSwaptionVolatilityStructure
type CRelinkableSwaptionVolatilityStructure = ForeignPtr CRelinkableSwaptionVolatilityStructure'
-- | A swaption vol surface held behind a relinkable handle. It /is/ a
-- 'SwaptionVolatilityStructure' -- pass it anywhere one is expected and it upcasts like any
-- other hierarchy member, sharing its @Link@ so that a later
-- 'QuantLib.TermStructure.Volatility.linkSwaptionVolTo' reaches everything already built on
-- it. Mirrors 'RelinkableBlackVolTermStructure'.
-- See the hierarchy under t'GenTermStructure'.
type RelinkableSwaptionVolatilityStructure = GenSwaptionVolatilityStructure CRelinkableSwaptionVolatilityStructure
type CSabrSwaptionVolatilityCube = ForeignPtr CSabrSwaptionVolatilityCube'
-- | A SABR-calibrated swaption vol cube. It /is/ a 'SwaptionVolatilityStructure' -- pass it
-- anywhere one is expected. Its own extra getters (sparse\/dense SABR parameters, market\/ATM-
-- calibrated vol cubes, ATM strike) are bound directly against this concrete type rather than
-- via a downcast: it has real calculations of its own beyond the generic interface, so per the
-- API-design rule in CLAUDE.md it earns a dedicated leaf.
-- See the hierarchy under t'GenTermStructure'.
type SabrSwaptionVolatilityCube = GenSwaptionVolatilityStructure CSabrSwaptionVolatilityCube
type CNoArbSabrSwaptionVolatilityCube = ForeignPtr CNoArbSabrSwaptionVolatilityCube'
-- | An arbitrage-free (Doust) SABR-calibrated swaption vol cube -- the same underlying
-- @XabrSwaptionVolatilityCube@ template as 'SabrSwaptionVolatilityCube', one model policy over
-- (@SwaptionVolCubeNoArbSabrModel@ instead of @SwaptionVolCubeSabrModel@), same dedicated-leaf
-- reasoning and identical getter surface.
-- See the hierarchy under t'GenTermStructure'.
type NoArbSabrSwaptionVolatilityCube = GenSwaptionVolatilityStructure CNoArbSabrSwaptionVolatilityCube
type CZabrSwaptionVolatilityCube = ForeignPtr CZabrSwaptionVolatilityCube'
-- | A ZABR-calibrated swaption vol cube: the same @XabrSwaptionVolatilityCube@ template as
-- 'SabrSwaptionVolatilityCube' with the default ZABR model policy and a fifth (gamma) parameter.
-- See the hierarchy under t'GenTermStructure'.
type ZabrSwaptionVolatilityCube = GenSwaptionVolatilityStructure CZabrSwaptionVolatilityCube
type CInterpolatedSwaptionVolatilityCube = ForeignPtr CInterpolatedSwaptionVolatilityCube'
-- | The non-SABR, linear-interpolation swaption vol cube. It /is/ a
-- 'SwaptionVolatilityStructure' -- pass it anywhere one is expected. Gets the same dedicated-leaf
-- treatment as 'SabrSwaptionVolatilityCube' for its 'atmStrike' getter (inherited, in upstream,
-- from the same abstract @SwaptionVolatilityCube@ base both concrete cubes share).
-- See the hierarchy under t'GenTermStructure'.
type InterpolatedSwaptionVolatilityCube = GenSwaptionVolatilityStructure CInterpolatedSwaptionVolatilityCube
data CSwaptionVolatilityMatrix'
type CSwaptionVolatilityMatrix = ForeignPtr CSwaptionVolatilityMatrix'
-- | A discrete grid of swaption volatilities, interpolated between nodes. It /is/ a
-- 'SwaptionVolatilityStructure' -- pass it anywhere one is expected. Gets a dedicated leaf for
-- its own 'swaptionVolatilityMatrixLocate' inspector (the lower grid-corner indexes surrounding
-- a given option date\/swap tenor), same reasoning as 'SabrSwaptionVolatilityCube'\/
-- 'InterpolatedSwaptionVolatilityCube' above.
-- See the hierarchy under t'GenTermStructure'.
type SwaptionVolatilityMatrix = GenSwaptionVolatilityStructure CSwaptionVolatilityMatrix
-- | Black at-the-money (no-smile) volatility curve, abstract here (hasquant binds no
-- @qlBlackAtmVolCurve@ constructor -- @BlackAtmVolCurve@ has no bindable constructor upstream
-- either, only its concrete subclasses do). A sibling of 'OptionletVolatilityStructure'\/
-- 'CapFloorTermVolatilityStructure'\/'SwaptionVolatilityStructure' directly off
-- 'VolatilityTermStructure'. Reachable as a value via 'SabrVolSurface''s @atmCurve@ getter (any
-- concrete member may be held there), and as the argument type of 'sabrVolSurface'.
-- See the hierarchy under t'GenTermStructure'.
type GenBlackAtmVolCurve b = GenVolatilityTermStructure (AnyOf CBlackAtmVolCurve' b)
data CBlackAtmVolCurve'
type CBlackAtmVolCurve = ForeignPtr CBlackAtmVolCurve'
-- |A 'VolatilityTermStructure'; see the hierarchy under t'GenTermStructure'.
type BlackAtmVolCurve = GenBlackAtmVolCurve CBlackAtmVolCurve
-- | Black volatility (smile) surface: adds a strike\/smile dimension over 'BlackAtmVolCurve'.
-- Abstract here (no bindable constructor of its own -- only 'SabrVolSurface' constructs one in
-- this binding), but earns its own hierarchy level rather than folding into 'BlackAtmVolCurve'
-- (unlike @InterestRateVolSurface@, deliberately not given its own level -- see 'SabrVolSurface')
-- because its own calculation, @smileSection@, is the defining feature of the "surface" vs
-- "curve" distinction, not a thin pass-through inspector.
-- See the hierarchy under t'GenTermStructure'.
type GenBlackVolSurface b = GenBlackAtmVolCurve (AnyOf CBlackVolSurface' b)
data CBlackVolSurface'
type CBlackVolSurface = ForeignPtr CBlackVolSurface'
-- |A 'BlackAtmVolCurve'; see the hierarchy under t'GenTermStructure'.
type BlackVolSurface = GenBlackVolSurface CBlackVolSurface
data CAbcdAtmVolCurve'
type CAbcdAtmVolCurve = ForeignPtr CAbcdAtmVolCurve'
-- | ABCD-parametric fit to a set of (tenor, quote) at-the-money vols. A dedicated
-- 'BlackAtmVolCurve' leaf (real calc\/getters of its own -- @a@\/@b@\/@c@\/@d@\/@rmsError@\/etc --
-- per the API-design rule in CLAUDE.md), one 'AnyOf' layer under 'GenBlackAtmVolCurve', same depth
-- as 'CapFloorTermVolCurve' under 'GenCapFloorTermVolatilityStructure'.
-- See the hierarchy under t'GenTermStructure'.
type AbcdAtmVolCurve = GenBlackAtmVolCurve CAbcdAtmVolCurve
data CSabrVolSurface'
type CSabrVolSurface = ForeignPtr CSabrVolSurface'
-- | SABR-smile surface built from an interest-rate index, an ATM 'BlackAtmVolCurve', and
-- per-tenor vol spreads. A dedicated 'BlackVolSurface' leaf (own getters: @atmCurve@,
-- @sabrVolatilitySpreads@; plus @index@\/@optionDateFromTenor@ folded in directly from upstream's
-- @InterestRateVolSurface@, which is not given its own hierarchy level here since
-- 'SabrVolSurface' is its only concrete member in this binding -- per CLAUDE.md's "don't mirror
-- the C++ hierarchy 1:1" rule). Two 'AnyOf' layers under 'GenBlackVolSurface' (mirrors
-- 'VanillaSwap' under 'FixedVsFloatingSwap' under 'GenSwap').
-- See the hierarchy under t'GenTermStructure'.
type SabrVolSurface = GenBlackVolSurface CSabrVolSurface
-- |A 'LocalVolTermStructure' or one of its leaves; see the hierarchy under t'GenTermStructure'.
type GenLocalVolTermStructure lv = GenVolatilityTermStructure (AnyOf CLocalVolTermStructure' lv)
type CLocalVolTermStructure = ForeignPtr CLocalVolTermStructure'
-- |A 'VolatilityTermStructure'; see the hierarchy under t'GenTermStructure'.
type LocalVolTermStructure = GenLocalVolTermStructure CLocalVolTermStructure
type CGridModelLocalVolSurface = ForeignPtr CGridModelLocalVolSurface'
-- |A 'LocalVolTermStructure'; see the hierarchy under t'GenTermStructure'.
type GridModelLocalVolSurface = GenLocalVolTermStructure CGridModelLocalVolSurface
type AndreasenHugeVolatilityInterpl = Standalone CAndreasenHugeVolatilityInterpl
type CYoYOptionletVolatilitySurface = ForeignPtr CYoYOptionletVolatilitySurface'
-- | A YoY-inflation optionlet vol surface, quoted via 'volatility'\/'totalVariance' at
-- (maturity, strike) pairs rather than QuantLib's usual (option date, tenor, strike) grid, since
-- inflation caplets observe a single index fixing rather than a forward rate. A plain
-- 'VolatilityTermStructure' leaf like 'CapFloorTermVolSurface', constructed and consumed via a
-- @Handle@ (mirroring 'OptionletVolatilityStructure', since it feeds
-- 'QuantLib.PricingEngine.yoyInflationBlackCapFloorEngine' et al. exactly the way
-- 'OptionletVolatilityStructure' feeds 'QuantLib.PricingEngine.blackCapFloorEngineFromVolatilityStructure').
-- See the hierarchy under t'GenTermStructure'.
type YoYOptionletVolatilitySurface = GenVolatilityTermStructure CYoYOptionletVolatilitySurface
type CCPIVolatilitySurface = ForeignPtr CCPIVolatilitySurface'
-- | A CPI (zero-inflation) volatility surface, quoted via 'volatility'\/'totalVariance' at
-- (maturity, strike) pairs -- same shape as 'YoYOptionletVolatilitySurface', a plain
-- 'VolatilityTermStructure' leaf constructed and consumed via a @Handle@. Unlike
-- 'YoYOptionletVolatilitySurface' it feeds no pricing engine in QL 1.43: 'CPICapFloor' prices
-- purely off 'QuantLib.TermStructure.InflationVolatility.CPICapFloorTermPriceSurface' via
-- 'QuantLib.PricingEngine.interpolatingCpiCapFloorEngine', and 'CPICouponPricer' (the type that
-- would consume this) is itself explicitly unfinished upstream for vol-dependent coupons (no
-- concrete descendant exists to bind, unlike 'YoYInflationCouponPricer's three) -- so this type
-- stands alone as a queryable surface, not (yet) as engine\/pricer plumbing.
-- See the hierarchy under t'GenTermStructure'.
type CPIVolatilitySurface = GenVolatilityTermStructure CCPIVolatilitySurface
-- |A 'BlackVolTermStructure' or one of its leaves; see the hierarchy under t'GenTermStructure'.
type GenBlackVolTermStructure bv = GenVolatilityTermStructure (AnyOf CBlackVolTermStructure' bv)
type CBlackVolTermStructure = ForeignPtr CBlackVolTermStructure'
-- |A 'VolatilityTermStructure'; see the hierarchy under t'GenTermStructure'.
type BlackVolTermStructure = GenBlackVolTermStructure CBlackVolTermStructure
type CRelinkableBlackVolTermStructure = ForeignPtr CRelinkableBlackVolTermStructure'
-- | A Black vol surface held behind a relinkable handle. It /is/ a 'BlackVolTermStructure' --
-- pass it anywhere one is expected and it upcasts like any other hierarchy member, sharing its
-- @Link@ so that a later 'QuantLib.TermStructure.Volatility.linkBlackVolTo' reaches everything
-- already built on it. Mirrors 'RelinkableYieldTermStructure'.
-- See the hierarchy under t'GenTermStructure'.
type RelinkableBlackVolTermStructure = GenBlackVolTermStructure CRelinkableBlackVolTermStructure
type CBlackVarianceCurve = ForeignPtr CBlackVarianceCurve'
-- |A 'BlackVolTermStructure'; see the hierarchy under t'GenTermStructure'.
type BlackVarianceCurve = GenBlackVolTermStructure CBlackVarianceCurve
type CBlackVolatilitySurfaceDelta = ForeignPtr CBlackVolatilitySurfaceDelta'
-- |A 'BlackVolTermStructure'; see the hierarchy under t'GenTermStructure'.
type BlackVolatilitySurfaceDelta = GenBlackVolTermStructure CBlackVolatilitySurfaceDelta
type CCallableBondVolatilityStructure = ForeignPtr CCallableBondVolatilityStructure'
-- |A 'TermStructure'; see the hierarchy under t'GenTermStructure'.
type CallableBondVolatilityStructure = GenTermStructure CCallableBondVolatilityStructure
-- |A 'DefaultProbabilityTermStructure' or one of its leaves; see the hierarchy under t'GenTermStructure'.
type GenDefaultProbabilityTermStructure d = GenTermStructure (AnyOf CDefaultProbabilityTermStructure' d)
type CDefaultProbabilityTermStructure = ForeignPtr CDefaultProbabilityTermStructure'
-- |A 'TermStructure'; see the hierarchy under t'GenTermStructure'.
type DefaultProbabilityTermStructure = GenDefaultProbabilityTermStructure CDefaultProbabilityTermStructure
type CAffineHazardRateCurve = ForeignPtr CAffineHazardRateCurve'
-- |A 'DefaultProbabilityTermStructure'; see the hierarchy under t'GenTermStructure'.
type AffineHazardRateCurve = GenDefaultProbabilityTermStructure CAffineHazardRateCurve
withDefaultProbabilityTermStructureArray :: [DefaultProbabilityTermStructure] -> ((CUInt, Ptr (Ptr CDefaultProbabilityTermStructure')) -> IO b) -> IO b
withDefaultProbabilityTermStructureArray :: forall b.
[DefaultProbabilityTermStructure]
-> ((CUInt, Ptr (Ptr CDefaultProbabilityTermStructure')) -> IO b)
-> IO b
withDefaultProbabilityTermStructureArray = (DefaultProbabilityTermStructure
 -> (Ptr CDefaultProbabilityTermStructure' -> IO b) -> IO b)
-> [DefaultProbabilityTermStructure]
-> ((CUInt, Ptr (Ptr CDefaultProbabilityTermStructure')) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray DefaultProbabilityTermStructure
-> (Ptr CDefaultProbabilityTermStructure' -> IO b) -> IO b
forall d b.
GenDefaultProbabilityTermStructure d
-> (Ptr CDefaultProbabilityTermStructure' -> IO b) -> IO b
withDefaultProbabilityTermStructure
withDefaultProbabilityTermStructureArrayRaw :: [DefaultProbabilityTermStructure] -> (Ptr (Ptr CDefaultProbabilityTermStructure') -> IO b) -> IO b
withDefaultProbabilityTermStructureArrayRaw :: forall b.
[DefaultProbabilityTermStructure]
-> (Ptr (Ptr CDefaultProbabilityTermStructure') -> IO b) -> IO b
withDefaultProbabilityTermStructureArrayRaw [DefaultProbabilityTermStructure]
x Ptr (Ptr CDefaultProbabilityTermStructure') -> IO b
f = (DefaultProbabilityTermStructure
 -> (Ptr CDefaultProbabilityTermStructure' -> IO b) -> IO b)
-> [DefaultProbabilityTermStructure]
-> ([Ptr CDefaultProbabilityTermStructure'] -> IO b)
-> IO b
forall a b res.
(a -> (b -> res) -> res) -> [a] -> ([b] -> res) -> res
withMany DefaultProbabilityTermStructure
-> (Ptr CDefaultProbabilityTermStructure' -> IO b) -> IO b
forall d b.
GenDefaultProbabilityTermStructure d
-> (Ptr CDefaultProbabilityTermStructure' -> IO b) -> IO b
withDefaultProbabilityTermStructure [DefaultProbabilityTermStructure]
x ([Ptr CDefaultProbabilityTermStructure']
-> (Ptr (Ptr CDefaultProbabilityTermStructure') -> IO b) -> IO b
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
`withArray` Ptr (Ptr CDefaultProbabilityTermStructure') -> IO b
f)

-- CREDIT: separate types encode tranche-loss and digital-loss capabilities.
data CDefaultProbKey
newtype DefaultProbKey = DefaultProbKey {DefaultProbKey -> Standalone CDefaultProbKey
getCDefaultProbKey :: Standalone CDefaultProbKey}
foreign import ccall unsafe "ql.h &qlFreeDefaultProbKey" qlFreeDefaultProbKey :: FinalizerPtr CDefaultProbKey
instance Finalizable CDefaultProbKey where finalize :: FinalizerPtr CDefaultProbKey
finalize = FinalizerPtr CDefaultProbKey
qlFreeDefaultProbKey
peekDefaultProbKey :: Ptr CDefaultProbKey -> IO DefaultProbKey
peekDefaultProbKey :: Ptr CDefaultProbKey -> IO DefaultProbKey
peekDefaultProbKey = Standalone CDefaultProbKey -> DefaultProbKey
DefaultProbKey (Standalone CDefaultProbKey -> DefaultProbKey)
-> (Ptr CDefaultProbKey -> IO (Standalone CDefaultProbKey))
-> Ptr CDefaultProbKey
-> IO DefaultProbKey
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CDefaultProbKey -> IO (Standalone CDefaultProbKey)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withDefaultProbKey :: DefaultProbKey -> (Ptr CDefaultProbKey -> IO b) -> IO b
withDefaultProbKey :: forall b. DefaultProbKey -> (Ptr CDefaultProbKey -> IO b) -> IO b
withDefaultProbKey = Standalone CDefaultProbKey -> (Ptr CDefaultProbKey -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CDefaultProbKey
 -> (Ptr CDefaultProbKey -> IO b) -> IO b)
-> (DefaultProbKey -> Standalone CDefaultProbKey)
-> DefaultProbKey
-> (Ptr CDefaultProbKey -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DefaultProbKey -> Standalone CDefaultProbKey
getCDefaultProbKey
withDefaultProbKeyArray :: [DefaultProbKey] -> ((CUInt, Ptr (Ptr CDefaultProbKey)) -> IO b) -> IO b
withDefaultProbKeyArray :: forall b.
[DefaultProbKey]
-> ((CUInt, Ptr (Ptr CDefaultProbKey)) -> IO b) -> IO b
withDefaultProbKeyArray = (DefaultProbKey -> Standalone CDefaultProbKey)
-> [DefaultProbKey]
-> ((CUInt, Ptr (Ptr CDefaultProbKey)) -> IO b)
-> IO b
forall t a b.
(t -> Standalone a)
-> [t] -> ((CUInt, Ptr (Ptr a)) -> IO b) -> IO b
withStandaloneArray DefaultProbKey -> Standalone CDefaultProbKey
getCDefaultProbKey
withDefaultProbKeyArrayRaw :: [DefaultProbKey] -> (Ptr (Ptr CDefaultProbKey) -> IO b) -> IO b
withDefaultProbKeyArrayRaw :: forall b.
[DefaultProbKey] -> (Ptr (Ptr CDefaultProbKey) -> IO b) -> IO b
withDefaultProbKeyArrayRaw [DefaultProbKey]
x Ptr (Ptr CDefaultProbKey) -> IO b
f = (DefaultProbKey -> (Ptr CDefaultProbKey -> IO b) -> IO b)
-> [DefaultProbKey] -> ([Ptr CDefaultProbKey] -> IO b) -> IO b
forall a b res.
(a -> (b -> res) -> res) -> [a] -> ([b] -> res) -> res
withMany DefaultProbKey -> (Ptr CDefaultProbKey -> IO b) -> IO b
forall b. DefaultProbKey -> (Ptr CDefaultProbKey -> IO b) -> IO b
withDefaultProbKey [DefaultProbKey]
x ([Ptr CDefaultProbKey]
-> (Ptr (Ptr CDefaultProbKey) -> IO b) -> IO b
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
`withArray` Ptr (Ptr CDefaultProbKey) -> IO b
f)

data CIssuer
newtype Issuer = Issuer {Issuer -> Standalone CIssuer
getCIssuer :: Standalone CIssuer}
foreign import ccall unsafe "ql.h &qlFreeIssuer" qlFreeIssuer :: FinalizerPtr CIssuer
instance Finalizable CIssuer where finalize :: FinalizerPtr CIssuer
finalize = FinalizerPtr CIssuer
qlFreeIssuer
peekIssuer :: Ptr CIssuer -> IO Issuer
peekIssuer :: Ptr CIssuer -> IO Issuer
peekIssuer = Standalone CIssuer -> Issuer
Issuer (Standalone CIssuer -> Issuer)
-> (Ptr CIssuer -> IO (Standalone CIssuer))
-> Ptr CIssuer
-> IO Issuer
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CIssuer -> IO (Standalone CIssuer)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withIssuer :: Issuer -> (Ptr CIssuer -> IO b) -> IO b
withIssuer :: forall b. Issuer -> (Ptr CIssuer -> IO b) -> IO b
withIssuer = Standalone CIssuer -> (Ptr CIssuer -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CIssuer -> (Ptr CIssuer -> IO b) -> IO b)
-> (Issuer -> Standalone CIssuer)
-> Issuer
-> (Ptr CIssuer -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Issuer -> Standalone CIssuer
getCIssuer
withIssuerArray :: [Issuer] -> ((CUInt, Ptr (Ptr CIssuer)) -> IO b) -> IO b
withIssuerArray :: forall b. [Issuer] -> ((CUInt, Ptr (Ptr CIssuer)) -> IO b) -> IO b
withIssuerArray = (Issuer -> Standalone CIssuer)
-> [Issuer] -> ((CUInt, Ptr (Ptr CIssuer)) -> IO b) -> IO b
forall t a b.
(t -> Standalone a)
-> [t] -> ((CUInt, Ptr (Ptr a)) -> IO b) -> IO b
withStandaloneArray Issuer -> Standalone CIssuer
getCIssuer
withIssuerArrayRaw :: [Issuer] -> (Ptr (Ptr CIssuer) -> IO b) -> IO b
withIssuerArrayRaw :: forall b. [Issuer] -> (Ptr (Ptr CIssuer) -> IO b) -> IO b
withIssuerArrayRaw [Issuer]
x Ptr (Ptr CIssuer) -> IO b
f = (Issuer -> (Ptr CIssuer -> IO b) -> IO b)
-> [Issuer] -> ([Ptr CIssuer] -> IO b) -> IO b
forall a b res.
(a -> (b -> res) -> res) -> [a] -> ([b] -> res) -> res
withMany Issuer -> (Ptr CIssuer -> IO b) -> IO b
forall b. Issuer -> (Ptr CIssuer -> IO b) -> IO b
withIssuer [Issuer]
x ([Ptr CIssuer] -> (Ptr (Ptr CIssuer) -> IO b) -> IO b
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
`withArray` Ptr (Ptr CIssuer) -> IO b
f)

data CPool
newtype Pool = Pool {Pool -> Standalone CPool
getCPool :: Standalone CPool}
foreign import ccall unsafe "ql.h &qlFreePool" qlFreePool :: FinalizerPtr CPool
instance Finalizable CPool where finalize :: FinalizerPtr CPool
finalize = FinalizerPtr CPool
qlFreePool
peekPool :: Ptr CPool -> IO Pool
peekPool :: Ptr CPool -> IO Pool
peekPool = Standalone CPool -> Pool
Pool (Standalone CPool -> Pool)
-> (Ptr CPool -> IO (Standalone CPool)) -> Ptr CPool -> IO Pool
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CPool -> IO (Standalone CPool)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withPool :: Pool -> (Ptr CPool -> IO b) -> IO b
withPool :: forall b. Pool -> (Ptr CPool -> IO b) -> IO b
withPool = Standalone CPool -> (Ptr CPool -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CPool -> (Ptr CPool -> IO b) -> IO b)
-> (Pool -> Standalone CPool)
-> Pool
-> (Ptr CPool -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Pool -> Standalone CPool
getCPool

data CBasket
-- Named 'CreditBasket' to avoid the Payoff ADT's 'Basket' constructor.
newtype Basket = CreditBasket {Basket -> Standalone CBasket
getCBasket :: Standalone CBasket}
foreign import ccall unsafe "ql.h &qlFreeBasket" qlFreeBasket :: FinalizerPtr CBasket
instance Finalizable CBasket where finalize :: FinalizerPtr CBasket
finalize = FinalizerPtr CBasket
qlFreeBasket
peekBasket :: Ptr CBasket -> IO Basket
peekBasket :: Ptr CBasket -> IO Basket
peekBasket = Standalone CBasket -> Basket
CreditBasket (Standalone CBasket -> Basket)
-> (Ptr CBasket -> IO (Standalone CBasket))
-> Ptr CBasket
-> IO Basket
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CBasket -> IO (Standalone CBasket)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withBasket :: Basket -> (Ptr CBasket -> IO b) -> IO b
withBasket :: forall b. Basket -> (Ptr CBasket -> IO b) -> IO b
withBasket = Standalone CBasket -> (Ptr CBasket -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CBasket -> (Ptr CBasket -> IO b) -> IO b)
-> (Basket -> Standalone CBasket)
-> Basket
-> (Ptr CBasket -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Basket -> Standalone CBasket
getCBasket

-- A basket with a tranche-loss model, for CDO pricing.
newtype TrancheBasket = TrancheBasket {TrancheBasket -> Basket
trancheBasketAsBasket :: Basket}
peekTrancheBasket :: Ptr CBasket -> IO TrancheBasket
peekTrancheBasket :: Ptr CBasket -> IO TrancheBasket
peekTrancheBasket = Basket -> TrancheBasket
TrancheBasket (Basket -> TrancheBasket)
-> (Ptr CBasket -> IO Basket) -> Ptr CBasket -> IO TrancheBasket
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CBasket -> IO Basket
peekBasket
withTrancheBasket :: TrancheBasket -> (Ptr CBasket -> IO b) -> IO b
withTrancheBasket :: forall b. TrancheBasket -> (Ptr CBasket -> IO b) -> IO b
withTrancheBasket = Basket -> (Ptr CBasket -> IO b) -> IO b
forall b. Basket -> (Ptr CBasket -> IO b) -> IO b
withBasket (Basket -> (Ptr CBasket -> IO b) -> IO b)
-> (TrancheBasket -> Basket)
-> TrancheBasket
-> (Ptr CBasket -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TrancheBasket -> Basket
trancheBasketAsBasket

-- A basket with a digital-loss model, for nth-to-default pricing.
newtype DigitalBasket = DigitalBasket {DigitalBasket -> Basket
digitalBasketAsBasket :: Basket}
peekDigitalBasket :: Ptr CBasket -> IO DigitalBasket
peekDigitalBasket :: Ptr CBasket -> IO DigitalBasket
peekDigitalBasket = Basket -> DigitalBasket
DigitalBasket (Basket -> DigitalBasket)
-> (Ptr CBasket -> IO Basket) -> Ptr CBasket -> IO DigitalBasket
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CBasket -> IO Basket
peekBasket
withDigitalBasket :: DigitalBasket -> (Ptr CBasket -> IO b) -> IO b
withDigitalBasket :: forall b. DigitalBasket -> (Ptr CBasket -> IO b) -> IO b
withDigitalBasket = Basket -> (Ptr CBasket -> IO b) -> IO b
forall b. Basket -> (Ptr CBasket -> IO b) -> IO b
withBasket (Basket -> (Ptr CBasket -> IO b) -> IO b)
-> (DigitalBasket -> Basket)
-> DigitalBasket
-> (Ptr CBasket -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DigitalBasket -> Basket
digitalBasketAsBasket

data CDefaultLossModel
newtype DefaultLossModel = DefaultLossModel {DefaultLossModel -> Standalone CDefaultLossModel
getCDefaultLossModel :: Standalone CDefaultLossModel}
foreign import ccall unsafe "ql.h &qlFreeDefaultLossModel" qlFreeDefaultLossModel :: FinalizerPtr CDefaultLossModel
instance Finalizable CDefaultLossModel where finalize :: FinalizerPtr CDefaultLossModel
finalize = FinalizerPtr CDefaultLossModel
qlFreeDefaultLossModel
peekDefaultLossModel :: Ptr CDefaultLossModel -> IO DefaultLossModel
peekDefaultLossModel :: Ptr CDefaultLossModel -> IO DefaultLossModel
peekDefaultLossModel = Standalone CDefaultLossModel -> DefaultLossModel
DefaultLossModel (Standalone CDefaultLossModel -> DefaultLossModel)
-> (Ptr CDefaultLossModel -> IO (Standalone CDefaultLossModel))
-> Ptr CDefaultLossModel
-> IO DefaultLossModel
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CDefaultLossModel -> IO (Standalone CDefaultLossModel)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withDefaultLossModel :: DefaultLossModel -> (Ptr CDefaultLossModel -> IO b) -> IO b
withDefaultLossModel :: forall b.
DefaultLossModel -> (Ptr CDefaultLossModel -> IO b) -> IO b
withDefaultLossModel = Standalone CDefaultLossModel
-> (Ptr CDefaultLossModel -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CDefaultLossModel
 -> (Ptr CDefaultLossModel -> IO b) -> IO b)
-> (DefaultLossModel -> Standalone CDefaultLossModel)
-> DefaultLossModel
-> (Ptr CDefaultLossModel -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DefaultLossModel -> Standalone CDefaultLossModel
getCDefaultLossModel

-- Distinct type prevents mixing digital and tranche-loss models.
newtype DigitalLossModel = DigitalLossModel {DigitalLossModel -> Standalone CDefaultLossModel
getCDigitalLossModel :: Standalone CDefaultLossModel}
peekDigitalLossModel :: Ptr CDefaultLossModel -> IO DigitalLossModel
peekDigitalLossModel :: Ptr CDefaultLossModel -> IO DigitalLossModel
peekDigitalLossModel = Standalone CDefaultLossModel -> DigitalLossModel
DigitalLossModel (Standalone CDefaultLossModel -> DigitalLossModel)
-> (Ptr CDefaultLossModel -> IO (Standalone CDefaultLossModel))
-> Ptr CDefaultLossModel
-> IO DigitalLossModel
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CDefaultLossModel -> IO (Standalone CDefaultLossModel)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withDigitalLossModel :: DigitalLossModel -> (Ptr CDefaultLossModel -> IO b) -> IO b
withDigitalLossModel :: forall b.
DigitalLossModel -> (Ptr CDefaultLossModel -> IO b) -> IO b
withDigitalLossModel = Standalone CDefaultLossModel
-> (Ptr CDefaultLossModel -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CDefaultLossModel
 -> (Ptr CDefaultLossModel -> IO b) -> IO b)
-> (DigitalLossModel -> Standalone CDefaultLossModel)
-> DigitalLossModel
-> (Ptr CDefaultLossModel -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DigitalLossModel -> Standalone CDefaultLossModel
getCDigitalLossModel

type CZeroInflationTermStructure = ForeignPtr CZeroInflationTermStructure'
-- |A 'TermStructure'; see the hierarchy under t'GenTermStructure'.
type ZeroInflationTermStructure = GenTermStructure CZeroInflationTermStructure
type CYoYInflationTermStructure = ForeignPtr CYoYInflationTermStructure'
-- |A 'TermStructure'; see the hierarchy under t'GenTermStructure'.
type YoYInflationTermStructure = GenTermStructure CYoYInflationTermStructure
type CCommodityCurve = ForeignPtr CCommodityCurve'
-- | A plain 'TermStructure' leaf (not a 'YieldTermStructure' -- it has no discount-factor
-- semantics, just an interpolated price curve), constructed and consumed by @shared_ptr@ like
-- 'CallableBondVolatilityStructure'\/'DefaultProbabilityTermStructure', never a @Handle@.
-- See the hierarchy under t'GenTermStructure'.
type CommodityCurve = GenTermStructure CCommodityCurve
data CYoYCapFloorTermPriceSurface'
type CYoYCapFloorTermPriceSurface = ForeignPtr CYoYCapFloorTermPriceSurface'
-- | Prices YoY cap\/floors by cap\/floor-surface intersection and put\/call parity, deriving an
-- ATM YoY swap curve as a side effect -- the market-data input the YoY optionlet stripper
-- ('QuantLib.TermStructure.InflationVolatility.kInterpolatedYoyOptionletVolatilitySurfaceBlack'
-- et al.) bootstraps from. A plain 'TermStructure' leaf, constructed and consumed by
-- @shared_ptr@ like 'CPICapFloorTermPriceSurface', never a @Handle@. Takes independent
-- 'Interpolation2D' (cap\/floor price grid) and 'Interpolation' (per-maturity) choices --
-- a different template (@InterpolatedYoYCapFloorTermPriceSurface@) from
-- 'CPICapFloorTermPriceSurface's @InterpolatedCPICapFloorTermPriceSurface@, hence the separate
-- 2-D\/1-D pair rather than 'CPICapFloorTermPriceSurface's single 'Interpolation2D'.
-- See the hierarchy under t'GenTermStructure'.
type YoYCapFloorTermPriceSurface = GenTermStructure CYoYCapFloorTermPriceSurface
data CCPICapFloorTermPriceSurface'
type CCPICapFloorTermPriceSurface = ForeignPtr CCPICapFloorTermPriceSurface'
-- | Prices CPI cap\/floors by interpolation and put\/call parity off a market strike\/maturity
-- price grid, not by any vol model (see 'CPICapFloor's own comment) -- a plain 'TermStructure'
-- leaf, constructed and consumed by @shared_ptr@ like 'CommodityCurve', never a @Handle@ (wrapped
-- into one at the point of use, e.g. 'QuantLib.PricingEngine.interpolatingCpiCapFloorEngine').
-- Takes an 'Interpolation2D' choice for the cap\/floor price grid -- a different template
-- (@InterpolatedCPICapFloorTermPriceSurface@) from 'YoYCapFloorTermPriceSurface's
-- @InterpolatedYoYCapFloorTermPriceSurface@, hence its own single 2-D slot rather than
-- 'YoYCapFloorTermPriceSurface's separate 2-D\/1-D pair.
-- See the hierarchy under t'GenTermStructure'.
type CPICapFloorTermPriceSurface = GenTermStructure CCPICapFloorTermPriceSurface
foreign import ccall unsafe "ql.h &qlFreeTermStructure" qlFreeTermStructure :: FinalizerPtr CTermStructure'
foreign import ccall unsafe "ql.h &qlFreeVolatilityTermStructure" qlFreeVolatilityTermStructure :: FinalizerPtr CVolatilityTermStructure'
foreign import ccall unsafe "ql.h &qlFreeOptionletVolatilityStructure" qlFreeOptionletVolatilityStructure :: FinalizerPtr COptionletVolatilityStructure'
foreign import ccall unsafe "ql.h &qlFreeRelinkableOptionletVolatilityStructure" qlFreeRelinkableOptionletVolatilityStructure :: FinalizerPtr CRelinkableOptionletVolatilityStructure'
foreign import ccall unsafe "ql.h &qlFreeSwaptionVolatilityStructure" qlFreeSwaptionVolatilityStructure :: FinalizerPtr CSwaptionVolatilityStructure'
foreign import ccall unsafe "ql.h &qlFreeRelinkableSwaptionVolatilityStructure" qlFreeRelinkableSwaptionVolatilityStructure :: FinalizerPtr CRelinkableSwaptionVolatilityStructure'
foreign import ccall unsafe "ql.h &qlFreeSabrSwaptionVolatilityCube" qlFreeSabrSwaptionVolatilityCube :: FinalizerPtr CSabrSwaptionVolatilityCube'
foreign import ccall unsafe "ql.h &qlFreeNoArbSabrSwaptionVolatilityCube" qlFreeNoArbSabrSwaptionVolatilityCube :: FinalizerPtr CNoArbSabrSwaptionVolatilityCube'
foreign import ccall unsafe "ql.h &qlFreeZabrSwaptionVolatilityCube" qlFreeZabrSwaptionVolatilityCube :: FinalizerPtr CZabrSwaptionVolatilityCube'
foreign import ccall unsafe "ql.h &qlFreeInterpolatedSwaptionVolatilityCube" qlFreeInterpolatedSwaptionVolatilityCube :: FinalizerPtr CInterpolatedSwaptionVolatilityCube'
foreign import ccall unsafe "ql.h &qlFreeSwaptionVolatilityMatrix" qlFreeSwaptionVolatilityMatrix :: FinalizerPtr CSwaptionVolatilityMatrix'
foreign import ccall unsafe "ql.h &qlFreeCapFloorTermVolatilityStructure" qlFreeCapFloorTermVolatilityStructure :: FinalizerPtr CCapFloorTermVolatilityStructure'
foreign import ccall unsafe "ql.h &qlFreeCapFloorTermVolCurve" qlFreeCapFloorTermVolCurve :: FinalizerPtr CCapFloorTermVolCurve'
foreign import ccall unsafe "ql.h &qlFreeCapFloorTermVolSurface" qlFreeCapFloorTermVolSurface :: FinalizerPtr CCapFloorTermVolSurface'
foreign import ccall unsafe "ql.h &qlFreeBlackAtmVolCurve" qlFreeBlackAtmVolCurve :: FinalizerPtr CBlackAtmVolCurve'
foreign import ccall unsafe "ql.h &qlFreeBlackVolSurface" qlFreeBlackVolSurface :: FinalizerPtr CBlackVolSurface'
foreign import ccall unsafe "ql.h &qlFreeAbcdAtmVolCurve" qlFreeAbcdAtmVolCurve :: FinalizerPtr CAbcdAtmVolCurve'
foreign import ccall unsafe "ql.h &qlFreeSabrVolSurface" qlFreeSabrVolSurface :: FinalizerPtr CSabrVolSurface'
foreign import ccall unsafe "ql.h &qlFreeLocalVolTermStructure" qlFreeLocalVolTermStructure :: FinalizerPtr CLocalVolTermStructure'
foreign import ccall unsafe "ql.h &qlFreeGridModelLocalVolSurface" qlFreeGridModelLocalVolSurface :: FinalizerPtr CGridModelLocalVolSurface'
foreign import ccall unsafe "ql.h &qlFreeAndreasenHugeVolatilityInterpl" qlFreeAndreasenHugeVolatilityInterpl :: FinalizerPtr CAndreasenHugeVolatilityInterpl
foreign import ccall unsafe "ql.h &qlFreeYoYOptionletVolatilitySurface" qlFreeYoYOptionletVolatilitySurface :: FinalizerPtr CYoYOptionletVolatilitySurface'
foreign import ccall unsafe "ql.h &qlFreeCPIVolatilitySurface" qlFreeCPIVolatilitySurface :: FinalizerPtr CCPIVolatilitySurface'
foreign import ccall unsafe "ql.h &qlFreeBlackVolTermStructure" qlFreeBlackVolTermStructure :: FinalizerPtr CBlackVolTermStructure'
foreign import ccall unsafe "ql.h &qlFreeRelinkableBlackVolTermStructure" qlFreeRelinkableBlackVolTermStructure :: FinalizerPtr CRelinkableBlackVolTermStructure'
foreign import ccall unsafe "ql.h &qlFreeBlackVarianceCurve" qlFreeBlackVarianceCurve :: FinalizerPtr CBlackVarianceCurve'
foreign import ccall unsafe "ql.h &qlFreeBlackVolatilitySurfaceDelta" qlFreeBlackVolatilitySurfaceDelta :: FinalizerPtr CBlackVolatilitySurfaceDelta'
foreign import ccall unsafe "ql.h &qlFreeYieldTermStructure" qlFreeYieldTermStructure :: FinalizerPtr CYieldTermStructure'
foreign import ccall unsafe "ql.h &qlFreeFittedBondDiscountCurve" qlFreeFittedBondDiscountCurve :: FinalizerPtr CFittedBondDiscountCurve'
foreign import ccall unsafe "ql.h &qlFreeRelinkableYieldTermStructure" qlFreeRelinkableYieldTermStructure :: FinalizerPtr CRelinkableYieldTermStructure'
foreign import ccall unsafe "ql.h &qlFreeCallableBondVolatilityStructure" qlFreeCallableBondVolatilityStructure :: FinalizerPtr CCallableBondVolatilityStructure'
foreign import ccall unsafe "ql.h &qlFreeDefaultProbabilityTermStructure" qlFreeDefaultProbabilityTermStructure :: FinalizerPtr CDefaultProbabilityTermStructure'
foreign import ccall unsafe "ql.h &qlFreeAffineHazardRateCurve" qlFreeAffineHazardRateCurve :: FinalizerPtr CAffineHazardRateCurve'
foreign import ccall unsafe "ql.h &qlFreeZeroInflationTermStructure" qlFreeZeroInflationTermStructure :: FinalizerPtr CZeroInflationTermStructure'
foreign import ccall unsafe "ql.h &qlFreeYoYInflationTermStructure" qlFreeYoYInflationTermStructure :: FinalizerPtr CYoYInflationTermStructure'
foreign import ccall unsafe "ql.h &qlFreeYoYCapFloorTermPriceSurface" qlFreeYoYCapFloorTermPriceSurface :: FinalizerPtr CYoYCapFloorTermPriceSurface'
foreign import ccall unsafe "ql.h &qlFreeCPICapFloorTermPriceSurface" qlFreeCPICapFloorTermPriceSurface :: FinalizerPtr CCPICapFloorTermPriceSurface'
foreign import ccall unsafe "ql.h &qlFreeCommodityCurve" qlFreeCommodityCurve :: FinalizerPtr CCommodityCurve'
instance Finalizable CTermStructure' where finalize :: FinalizerPtr CTermStructure'
finalize = FinalizerPtr CTermStructure'
qlFreeTermStructure
instance Finalizable CVolatilityTermStructure' where finalize :: FinalizerPtr CVolatilityTermStructure'
finalize = FinalizerPtr CVolatilityTermStructure'
qlFreeVolatilityTermStructure
instance Finalizable COptionletVolatilityStructure' where finalize :: FinalizerPtr COptionletVolatilityStructure'
finalize = FinalizerPtr COptionletVolatilityStructure'
qlFreeOptionletVolatilityStructure
instance Finalizable CRelinkableOptionletVolatilityStructure' where finalize :: FinalizerPtr CRelinkableOptionletVolatilityStructure'
finalize = FinalizerPtr CRelinkableOptionletVolatilityStructure'
qlFreeRelinkableOptionletVolatilityStructure
instance Finalizable CSwaptionVolatilityStructure' where finalize :: FinalizerPtr CSwaptionVolatilityStructure'
finalize = FinalizerPtr CSwaptionVolatilityStructure'
qlFreeSwaptionVolatilityStructure
instance Finalizable CRelinkableSwaptionVolatilityStructure' where finalize :: FinalizerPtr CRelinkableSwaptionVolatilityStructure'
finalize = FinalizerPtr CRelinkableSwaptionVolatilityStructure'
qlFreeRelinkableSwaptionVolatilityStructure
instance Finalizable CSabrSwaptionVolatilityCube' where finalize :: FinalizerPtr CSabrSwaptionVolatilityCube'
finalize = FinalizerPtr CSabrSwaptionVolatilityCube'
qlFreeSabrSwaptionVolatilityCube
instance Finalizable CNoArbSabrSwaptionVolatilityCube' where finalize :: FinalizerPtr CNoArbSabrSwaptionVolatilityCube'
finalize = FinalizerPtr CNoArbSabrSwaptionVolatilityCube'
qlFreeNoArbSabrSwaptionVolatilityCube
instance Finalizable CZabrSwaptionVolatilityCube' where finalize :: FinalizerPtr CZabrSwaptionVolatilityCube'
finalize = FinalizerPtr CZabrSwaptionVolatilityCube'
qlFreeZabrSwaptionVolatilityCube
instance Finalizable CInterpolatedSwaptionVolatilityCube' where finalize :: FinalizerPtr CInterpolatedSwaptionVolatilityCube'
finalize = FinalizerPtr CInterpolatedSwaptionVolatilityCube'
qlFreeInterpolatedSwaptionVolatilityCube
instance Finalizable CSwaptionVolatilityMatrix' where finalize :: FinalizerPtr CSwaptionVolatilityMatrix'
finalize = FinalizerPtr CSwaptionVolatilityMatrix'
qlFreeSwaptionVolatilityMatrix
instance Finalizable CCapFloorTermVolatilityStructure' where finalize :: FinalizerPtr CCapFloorTermVolatilityStructure'
finalize = FinalizerPtr CCapFloorTermVolatilityStructure'
qlFreeCapFloorTermVolatilityStructure
instance Finalizable CCapFloorTermVolCurve' where finalize :: FinalizerPtr CCapFloorTermVolCurve'
finalize = FinalizerPtr CCapFloorTermVolCurve'
qlFreeCapFloorTermVolCurve
instance Finalizable CCapFloorTermVolSurface' where finalize :: FinalizerPtr CCapFloorTermVolSurface'
finalize = FinalizerPtr CCapFloorTermVolSurface'
qlFreeCapFloorTermVolSurface
instance Finalizable CBlackAtmVolCurve' where finalize :: FinalizerPtr CBlackAtmVolCurve'
finalize = FinalizerPtr CBlackAtmVolCurve'
qlFreeBlackAtmVolCurve
instance Finalizable CBlackVolSurface' where finalize :: FinalizerPtr CBlackVolSurface'
finalize = FinalizerPtr CBlackVolSurface'
qlFreeBlackVolSurface
instance Finalizable CAbcdAtmVolCurve' where finalize :: FinalizerPtr CAbcdAtmVolCurve'
finalize = FinalizerPtr CAbcdAtmVolCurve'
qlFreeAbcdAtmVolCurve
instance Finalizable CSabrVolSurface' where finalize :: FinalizerPtr CSabrVolSurface'
finalize = FinalizerPtr CSabrVolSurface'
qlFreeSabrVolSurface
instance Finalizable CLocalVolTermStructure' where finalize :: FinalizerPtr CLocalVolTermStructure'
finalize = FinalizerPtr CLocalVolTermStructure'
qlFreeLocalVolTermStructure
instance Finalizable CGridModelLocalVolSurface' where finalize :: FinalizerPtr CGridModelLocalVolSurface'
finalize = FinalizerPtr CGridModelLocalVolSurface'
qlFreeGridModelLocalVolSurface
instance Finalizable CAndreasenHugeVolatilityInterpl where finalize :: FinalizerPtr CAndreasenHugeVolatilityInterpl
finalize = FinalizerPtr CAndreasenHugeVolatilityInterpl
qlFreeAndreasenHugeVolatilityInterpl
instance Finalizable CYoYOptionletVolatilitySurface' where finalize :: FinalizerPtr CYoYOptionletVolatilitySurface'
finalize = FinalizerPtr CYoYOptionletVolatilitySurface'
qlFreeYoYOptionletVolatilitySurface
instance Finalizable CCPIVolatilitySurface' where finalize :: FinalizerPtr CCPIVolatilitySurface'
finalize = FinalizerPtr CCPIVolatilitySurface'
qlFreeCPIVolatilitySurface
instance Finalizable CBlackVolTermStructure' where finalize :: FinalizerPtr CBlackVolTermStructure'
finalize = FinalizerPtr CBlackVolTermStructure'
qlFreeBlackVolTermStructure
instance Finalizable CRelinkableBlackVolTermStructure' where finalize :: FinalizerPtr CRelinkableBlackVolTermStructure'
finalize = FinalizerPtr CRelinkableBlackVolTermStructure'
qlFreeRelinkableBlackVolTermStructure
instance Finalizable CBlackVarianceCurve' where finalize :: FinalizerPtr CBlackVarianceCurve'
finalize = FinalizerPtr CBlackVarianceCurve'
qlFreeBlackVarianceCurve
instance Finalizable CBlackVolatilitySurfaceDelta' where finalize :: FinalizerPtr CBlackVolatilitySurfaceDelta'
finalize = FinalizerPtr CBlackVolatilitySurfaceDelta'
qlFreeBlackVolatilitySurfaceDelta
instance Finalizable CYieldTermStructure' where finalize :: FinalizerPtr CYieldTermStructure'
finalize = FinalizerPtr CYieldTermStructure'
qlFreeYieldTermStructure
instance Finalizable CFittedBondDiscountCurve' where finalize :: FinalizerPtr CFittedBondDiscountCurve'
finalize = FinalizerPtr CFittedBondDiscountCurve'
qlFreeFittedBondDiscountCurve
instance Finalizable CRelinkableYieldTermStructure' where finalize :: FinalizerPtr CRelinkableYieldTermStructure'
finalize = FinalizerPtr CRelinkableYieldTermStructure'
qlFreeRelinkableYieldTermStructure
instance Finalizable CCallableBondVolatilityStructure' where finalize :: FinalizerPtr CCallableBondVolatilityStructure'
finalize = FinalizerPtr CCallableBondVolatilityStructure'
qlFreeCallableBondVolatilityStructure
instance Finalizable CDefaultProbabilityTermStructure' where finalize :: FinalizerPtr CDefaultProbabilityTermStructure'
finalize = FinalizerPtr CDefaultProbabilityTermStructure'
qlFreeDefaultProbabilityTermStructure
instance Finalizable CAffineHazardRateCurve' where finalize :: FinalizerPtr CAffineHazardRateCurve'
finalize = FinalizerPtr CAffineHazardRateCurve'
qlFreeAffineHazardRateCurve
instance Finalizable CZeroInflationTermStructure' where finalize :: FinalizerPtr CZeroInflationTermStructure'
finalize = FinalizerPtr CZeroInflationTermStructure'
qlFreeZeroInflationTermStructure
instance Finalizable CYoYInflationTermStructure' where finalize :: FinalizerPtr CYoYInflationTermStructure'
finalize = FinalizerPtr CYoYInflationTermStructure'
qlFreeYoYInflationTermStructure
instance Finalizable CYoYCapFloorTermPriceSurface' where finalize :: FinalizerPtr CYoYCapFloorTermPriceSurface'
finalize = FinalizerPtr CYoYCapFloorTermPriceSurface'
qlFreeYoYCapFloorTermPriceSurface
instance Finalizable CCPICapFloorTermPriceSurface' where finalize :: FinalizerPtr CCPICapFloorTermPriceSurface'
finalize = FinalizerPtr CCPICapFloorTermPriceSurface'
qlFreeCPICapFloorTermPriceSurface
instance Finalizable CCommodityCurve' where finalize :: FinalizerPtr CCommodityCurve'
finalize = FinalizerPtr CCommodityCurve'
qlFreeCommodityCurve
foreign import ccall "ql.h qlYieldTermStructureAsTermStructure" qlYieldTermStructureAsTermStructure :: Ptr CYieldTermStructure' -> IO (Ptr CTermStructure')
foreign import ccall "ql.h qlFittedBondDiscountCurveAsYieldTermStructure" qlFittedBondDiscountCurveAsYieldTermStructure :: Ptr CFittedBondDiscountCurve' -> IO (Ptr CYieldTermStructure')
foreign import ccall "ql.h qlRelinkableYieldTermStructureAsYieldTermStructure" qlRelinkableYieldTermStructureAsYieldTermStructure :: Ptr CRelinkableYieldTermStructure' -> IO (Ptr CYieldTermStructure')
foreign import ccall "ql.h qlVolatilityTermStructureAsTermStructure" qlVolatilityTermStructureAsTermStructure :: Ptr CVolatilityTermStructure' -> IO (Ptr CTermStructure')
foreign import ccall "ql.h qlOptionletVolatilityStructureAsVolatilityTermStructure" qlOptionletVolatilityStructureAsVolatilityTermStructure :: Ptr COptionletVolatilityStructure' -> IO (Ptr CVolatilityTermStructure')
foreign import ccall "ql.h qlRelinkableOptionletVolatilityStructureAsOptionletVolatilityStructure" qlRelinkableOptionletVolatilityStructureAsOptionletVolatilityStructure :: Ptr CRelinkableOptionletVolatilityStructure' -> IO (Ptr COptionletVolatilityStructure')
foreign import ccall "ql.h qlBlackVolTermStructureAsVolatilityTermStructure" qlBlackVolTermStructureAsVolatilityTermStructure :: Ptr CBlackVolTermStructure' -> IO (Ptr CVolatilityTermStructure')
foreign import ccall "ql.h qlRelinkableBlackVolTermStructureAsBlackVolTermStructure" qlRelinkableBlackVolTermStructureAsBlackVolTermStructure :: Ptr CRelinkableBlackVolTermStructure' -> IO (Ptr CBlackVolTermStructure')
foreign import ccall "ql.h qlBlackVarianceCurveAsBlackVolTermStructure" qlBlackVarianceCurveAsBlackVolTermStructure :: Ptr CBlackVarianceCurve' -> IO (Ptr CBlackVolTermStructure')
foreign import ccall "ql.h qlBlackVolatilitySurfaceDeltaAsBlackVolTermStructure" qlBlackVolatilitySurfaceDeltaAsBlackVolTermStructure :: Ptr CBlackVolatilitySurfaceDelta' -> IO (Ptr CBlackVolTermStructure')
foreign import ccall "ql.h qlSwaptionVolatilityStructureAsVolatilityTermStructure" qlSwaptionVolatilityStructureAsVolatilityTermStructure :: Ptr CSwaptionVolatilityStructure' -> IO (Ptr CVolatilityTermStructure')
foreign import ccall "ql.h qlRelinkableSwaptionVolatilityStructureAsSwaptionVolatilityStructure" qlRelinkableSwaptionVolatilityStructureAsSwaptionVolatilityStructure :: Ptr CRelinkableSwaptionVolatilityStructure' -> IO (Ptr CSwaptionVolatilityStructure')
foreign import ccall "ql.h qlSabrSwaptionVolatilityCubeAsSwaptionVolatilityStructure" qlSabrSwaptionVolatilityCubeAsSwaptionVolatilityStructure :: Ptr CSabrSwaptionVolatilityCube' -> IO (Ptr CSwaptionVolatilityStructure')
foreign import ccall "ql.h qlNoArbSabrSwaptionVolatilityCubeAsSwaptionVolatilityStructure" qlNoArbSabrSwaptionVolatilityCubeAsSwaptionVolatilityStructure :: Ptr CNoArbSabrSwaptionVolatilityCube' -> IO (Ptr CSwaptionVolatilityStructure')
foreign import ccall "ql.h qlZabrSwaptionVolatilityCubeAsSwaptionVolatilityStructure" qlZabrSwaptionVolatilityCubeAsSwaptionVolatilityStructure :: Ptr CZabrSwaptionVolatilityCube' -> IO (Ptr CSwaptionVolatilityStructure')
foreign import ccall "ql.h qlInterpolatedSwaptionVolatilityCubeAsSwaptionVolatilityStructure" qlInterpolatedSwaptionVolatilityCubeAsSwaptionVolatilityStructure :: Ptr CInterpolatedSwaptionVolatilityCube' -> IO (Ptr CSwaptionVolatilityStructure')
foreign import ccall "ql.h qlSwaptionVolatilityMatrixAsSwaptionVolatilityStructure" qlSwaptionVolatilityMatrixAsSwaptionVolatilityStructure :: Ptr CSwaptionVolatilityMatrix' -> IO (Ptr CSwaptionVolatilityStructure')
foreign import ccall "ql.h qlCapFloorTermVolatilityStructureAsVolatilityTermStructure" qlCapFloorTermVolatilityStructureAsVolatilityTermStructure :: Ptr CCapFloorTermVolatilityStructure' -> IO (Ptr CVolatilityTermStructure')
foreign import ccall "ql.h qlCapFloorTermVolCurveAsCapFloorTermVolatilityStructure" qlCapFloorTermVolCurveAsCapFloorTermVolatilityStructure :: Ptr CCapFloorTermVolCurve' -> IO (Ptr CCapFloorTermVolatilityStructure')
foreign import ccall "ql.h qlCapFloorTermVolSurfaceAsCapFloorTermVolatilityStructure" qlCapFloorTermVolSurfaceAsCapFloorTermVolatilityStructure :: Ptr CCapFloorTermVolSurface' -> IO (Ptr CCapFloorTermVolatilityStructure')
foreign import ccall "ql.h qlBlackAtmVolCurveAsVolatilityTermStructure" qlBlackAtmVolCurveAsVolatilityTermStructure :: Ptr CBlackAtmVolCurve' -> IO (Ptr CVolatilityTermStructure')
foreign import ccall "ql.h qlBlackVolSurfaceAsBlackAtmVolCurve" qlBlackVolSurfaceAsBlackAtmVolCurve :: Ptr CBlackVolSurface' -> IO (Ptr CBlackAtmVolCurve')
foreign import ccall "ql.h qlAbcdAtmVolCurveAsBlackAtmVolCurve" qlAbcdAtmVolCurveAsBlackAtmVolCurve :: Ptr CAbcdAtmVolCurve' -> IO (Ptr CBlackAtmVolCurve')
foreign import ccall "ql.h qlSabrVolSurfaceAsBlackVolSurface" qlSabrVolSurfaceAsBlackVolSurface :: Ptr CSabrVolSurface' -> IO (Ptr CBlackVolSurface')
foreign import ccall "ql.h qlLocalVolTermStructureAsVolatilityTermStructure" qlLocalVolTermStructureAsVolatilityTermStructure :: Ptr CLocalVolTermStructure' -> IO (Ptr CVolatilityTermStructure')
foreign import ccall "ql.h qlGridModelLocalVolSurfaceAsLocalVolTermStructure" qlGridModelLocalVolSurfaceAsLocalVolTermStructure :: Ptr CGridModelLocalVolSurface' -> IO (Ptr CLocalVolTermStructure')
foreign import ccall "ql.h qlYoYOptionletVolatilitySurfaceAsVolatilityTermStructure" qlYoYOptionletVolatilitySurfaceAsVolatilityTermStructure :: Ptr CYoYOptionletVolatilitySurface' -> IO (Ptr CVolatilityTermStructure')
foreign import ccall "ql.h qlCPIVolatilitySurfaceAsVolatilityTermStructure" qlCPIVolatilitySurfaceAsVolatilityTermStructure :: Ptr CCPIVolatilitySurface' -> IO (Ptr CVolatilityTermStructure')
foreign import ccall "ql.h qlCallableBondVolatilityStructureAsTermStructure" qlCallableBondVolatilityStructureAsTermStructure :: Ptr CCallableBondVolatilityStructure' -> IO (Ptr CTermStructure')
foreign import ccall "ql.h qlDefaultProbabilityTermStructureAsTermStructure" qlDefaultProbabilityTermStructureAsTermStructure :: Ptr CDefaultProbabilityTermStructure' -> IO (Ptr CTermStructure')
foreign import ccall "ql.h qlAffineHazardRateCurveAsDefaultProbabilityTermStructure" qlAffineHazardRateCurveAsDefaultProbabilityTermStructure :: Ptr CAffineHazardRateCurve' -> IO (Ptr CDefaultProbabilityTermStructure')
foreign import ccall "ql.h qlZeroInflationTermStructureAsTermStructure" qlZeroInflationTermStructureAsTermStructure :: Ptr CZeroInflationTermStructure' -> IO (Ptr CTermStructure')
foreign import ccall "ql.h qlYoYInflationTermStructureAsTermStructure" qlYoYInflationTermStructureAsTermStructure :: Ptr CYoYInflationTermStructure' -> IO (Ptr CTermStructure')
foreign import ccall "ql.h qlYoYCapFloorTermPriceSurfaceAsTermStructure" qlYoYCapFloorTermPriceSurfaceAsTermStructure :: Ptr CYoYCapFloorTermPriceSurface' -> IO (Ptr CTermStructure')
foreign import ccall "ql.h qlCPICapFloorTermPriceSurfaceAsTermStructure" qlCPICapFloorTermPriceSurfaceAsTermStructure :: Ptr CCPICapFloorTermPriceSurface' -> IO (Ptr CTermStructure')
foreign import ccall "ql.h qlCommodityCurveAsTermStructure" qlCommodityCurveAsTermStructure :: Ptr CCommodityCurve' -> IO (Ptr CTermStructure')
instance Upcastable CYieldTermStructure' where {type Base CYieldTermStructure' = CTermStructure'; upcast :: Ptr CYieldTermStructure' -> IO (Ptr (Base CYieldTermStructure'))
upcast = Ptr CYieldTermStructure' -> IO (Ptr CTermStructure')
Ptr CYieldTermStructure' -> IO (Ptr (Base CYieldTermStructure'))
qlYieldTermStructureAsTermStructure}
instance Upcastable CFittedBondDiscountCurve' where {type Base CFittedBondDiscountCurve' = CYieldTermStructure'; upcast :: Ptr CFittedBondDiscountCurve'
-> IO (Ptr (Base CFittedBondDiscountCurve'))
upcast = Ptr CFittedBondDiscountCurve' -> IO (Ptr CYieldTermStructure')
Ptr CFittedBondDiscountCurve'
-> IO (Ptr (Base CFittedBondDiscountCurve'))
qlFittedBondDiscountCurveAsYieldTermStructure}
instance Upcastable CRelinkableYieldTermStructure' where {type Base CRelinkableYieldTermStructure' = CYieldTermStructure'; upcast :: Ptr CRelinkableYieldTermStructure'
-> IO (Ptr (Base CRelinkableYieldTermStructure'))
upcast = Ptr CRelinkableYieldTermStructure' -> IO (Ptr CYieldTermStructure')
Ptr CRelinkableYieldTermStructure'
-> IO (Ptr (Base CRelinkableYieldTermStructure'))
qlRelinkableYieldTermStructureAsYieldTermStructure}
instance Upcastable CVolatilityTermStructure' where {type Base CVolatilityTermStructure' = CTermStructure'; upcast :: Ptr CVolatilityTermStructure'
-> IO (Ptr (Base CVolatilityTermStructure'))
upcast = Ptr CVolatilityTermStructure' -> IO (Ptr CTermStructure')
Ptr CVolatilityTermStructure'
-> IO (Ptr (Base CVolatilityTermStructure'))
qlVolatilityTermStructureAsTermStructure}
instance Upcastable CCallableBondVolatilityStructure' where {type Base CCallableBondVolatilityStructure' = CTermStructure'; upcast :: Ptr CCallableBondVolatilityStructure'
-> IO (Ptr (Base CCallableBondVolatilityStructure'))
upcast = Ptr CCallableBondVolatilityStructure' -> IO (Ptr CTermStructure')
Ptr CCallableBondVolatilityStructure'
-> IO (Ptr (Base CCallableBondVolatilityStructure'))
qlCallableBondVolatilityStructureAsTermStructure}
instance Upcastable CDefaultProbabilityTermStructure' where {type Base CDefaultProbabilityTermStructure' = CTermStructure'; upcast :: Ptr CDefaultProbabilityTermStructure'
-> IO (Ptr (Base CDefaultProbabilityTermStructure'))
upcast = Ptr CDefaultProbabilityTermStructure' -> IO (Ptr CTermStructure')
Ptr CDefaultProbabilityTermStructure'
-> IO (Ptr (Base CDefaultProbabilityTermStructure'))
qlDefaultProbabilityTermStructureAsTermStructure}
instance Upcastable CAffineHazardRateCurve' where {type Base CAffineHazardRateCurve' = CDefaultProbabilityTermStructure'; upcast :: Ptr CAffineHazardRateCurve'
-> IO (Ptr (Base CAffineHazardRateCurve'))
upcast = Ptr CAffineHazardRateCurve'
-> IO (Ptr CDefaultProbabilityTermStructure')
Ptr CAffineHazardRateCurve'
-> IO (Ptr (Base CAffineHazardRateCurve'))
qlAffineHazardRateCurveAsDefaultProbabilityTermStructure}
instance Upcastable CZeroInflationTermStructure' where {type Base CZeroInflationTermStructure' = CTermStructure'; upcast :: Ptr CZeroInflationTermStructure'
-> IO (Ptr (Base CZeroInflationTermStructure'))
upcast = Ptr CZeroInflationTermStructure' -> IO (Ptr CTermStructure')
Ptr CZeroInflationTermStructure'
-> IO (Ptr (Base CZeroInflationTermStructure'))
qlZeroInflationTermStructureAsTermStructure}
instance Upcastable CYoYInflationTermStructure' where {type Base CYoYInflationTermStructure' = CTermStructure'; upcast :: Ptr CYoYInflationTermStructure'
-> IO (Ptr (Base CYoYInflationTermStructure'))
upcast = Ptr CYoYInflationTermStructure' -> IO (Ptr CTermStructure')
Ptr CYoYInflationTermStructure'
-> IO (Ptr (Base CYoYInflationTermStructure'))
qlYoYInflationTermStructureAsTermStructure}
instance Upcastable CYoYCapFloorTermPriceSurface' where {type Base CYoYCapFloorTermPriceSurface' = CTermStructure'; upcast :: Ptr CYoYCapFloorTermPriceSurface'
-> IO (Ptr (Base CYoYCapFloorTermPriceSurface'))
upcast = Ptr CYoYCapFloorTermPriceSurface' -> IO (Ptr CTermStructure')
Ptr CYoYCapFloorTermPriceSurface'
-> IO (Ptr (Base CYoYCapFloorTermPriceSurface'))
qlYoYCapFloorTermPriceSurfaceAsTermStructure}
instance Upcastable CCPICapFloorTermPriceSurface' where {type Base CCPICapFloorTermPriceSurface' = CTermStructure'; upcast :: Ptr CCPICapFloorTermPriceSurface'
-> IO (Ptr (Base CCPICapFloorTermPriceSurface'))
upcast = Ptr CCPICapFloorTermPriceSurface' -> IO (Ptr CTermStructure')
Ptr CCPICapFloorTermPriceSurface'
-> IO (Ptr (Base CCPICapFloorTermPriceSurface'))
qlCPICapFloorTermPriceSurfaceAsTermStructure}
instance Upcastable CCommodityCurve' where {type Base CCommodityCurve' = CTermStructure'; upcast :: Ptr CCommodityCurve' -> IO (Ptr (Base CCommodityCurve'))
upcast = Ptr CCommodityCurve' -> IO (Ptr CTermStructure')
Ptr CCommodityCurve' -> IO (Ptr (Base CCommodityCurve'))
qlCommodityCurveAsTermStructure}
instance Upcastable CBlackVolTermStructure' where {type Base CBlackVolTermStructure' = CVolatilityTermStructure'; upcast :: Ptr CBlackVolTermStructure'
-> IO (Ptr (Base CBlackVolTermStructure'))
upcast = Ptr CBlackVolTermStructure' -> IO (Ptr CVolatilityTermStructure')
Ptr CBlackVolTermStructure'
-> IO (Ptr (Base CBlackVolTermStructure'))
qlBlackVolTermStructureAsVolatilityTermStructure}
instance Upcastable CRelinkableBlackVolTermStructure' where {type Base CRelinkableBlackVolTermStructure' = CBlackVolTermStructure'; upcast :: Ptr CRelinkableBlackVolTermStructure'
-> IO (Ptr (Base CRelinkableBlackVolTermStructure'))
upcast = Ptr CRelinkableBlackVolTermStructure'
-> IO (Ptr CBlackVolTermStructure')
Ptr CRelinkableBlackVolTermStructure'
-> IO (Ptr (Base CRelinkableBlackVolTermStructure'))
qlRelinkableBlackVolTermStructureAsBlackVolTermStructure}
instance Upcastable CBlackVarianceCurve' where {type Base CBlackVarianceCurve' = CBlackVolTermStructure'; upcast :: Ptr CBlackVarianceCurve' -> IO (Ptr (Base CBlackVarianceCurve'))
upcast = Ptr CBlackVarianceCurve' -> IO (Ptr CBlackVolTermStructure')
Ptr CBlackVarianceCurve' -> IO (Ptr (Base CBlackVarianceCurve'))
qlBlackVarianceCurveAsBlackVolTermStructure}
instance Upcastable CBlackVolatilitySurfaceDelta' where {type Base CBlackVolatilitySurfaceDelta' = CBlackVolTermStructure'; upcast :: Ptr CBlackVolatilitySurfaceDelta'
-> IO (Ptr (Base CBlackVolatilitySurfaceDelta'))
upcast = Ptr CBlackVolatilitySurfaceDelta'
-> IO (Ptr CBlackVolTermStructure')
Ptr CBlackVolatilitySurfaceDelta'
-> IO (Ptr (Base CBlackVolatilitySurfaceDelta'))
qlBlackVolatilitySurfaceDeltaAsBlackVolTermStructure}
instance Upcastable COptionletVolatilityStructure' where {type Base COptionletVolatilityStructure' = CVolatilityTermStructure'; upcast :: Ptr COptionletVolatilityStructure'
-> IO (Ptr (Base COptionletVolatilityStructure'))
upcast = Ptr COptionletVolatilityStructure'
-> IO (Ptr CVolatilityTermStructure')
Ptr COptionletVolatilityStructure'
-> IO (Ptr (Base COptionletVolatilityStructure'))
qlOptionletVolatilityStructureAsVolatilityTermStructure}
instance Upcastable CRelinkableOptionletVolatilityStructure' where {type Base CRelinkableOptionletVolatilityStructure' = COptionletVolatilityStructure'; upcast :: Ptr CRelinkableOptionletVolatilityStructure'
-> IO (Ptr (Base CRelinkableOptionletVolatilityStructure'))
upcast = Ptr CRelinkableOptionletVolatilityStructure'
-> IO (Ptr COptionletVolatilityStructure')
Ptr CRelinkableOptionletVolatilityStructure'
-> IO (Ptr (Base CRelinkableOptionletVolatilityStructure'))
qlRelinkableOptionletVolatilityStructureAsOptionletVolatilityStructure}
instance Upcastable CSwaptionVolatilityStructure' where {type Base CSwaptionVolatilityStructure' = CVolatilityTermStructure'; upcast :: Ptr CSwaptionVolatilityStructure'
-> IO (Ptr (Base CSwaptionVolatilityStructure'))
upcast = Ptr CSwaptionVolatilityStructure'
-> IO (Ptr CVolatilityTermStructure')
Ptr CSwaptionVolatilityStructure'
-> IO (Ptr (Base CSwaptionVolatilityStructure'))
qlSwaptionVolatilityStructureAsVolatilityTermStructure}
instance Upcastable CRelinkableSwaptionVolatilityStructure' where {type Base CRelinkableSwaptionVolatilityStructure' = CSwaptionVolatilityStructure'; upcast :: Ptr CRelinkableSwaptionVolatilityStructure'
-> IO (Ptr (Base CRelinkableSwaptionVolatilityStructure'))
upcast = Ptr CRelinkableSwaptionVolatilityStructure'
-> IO (Ptr CSwaptionVolatilityStructure')
Ptr CRelinkableSwaptionVolatilityStructure'
-> IO (Ptr (Base CRelinkableSwaptionVolatilityStructure'))
qlRelinkableSwaptionVolatilityStructureAsSwaptionVolatilityStructure}
instance Upcastable CSabrSwaptionVolatilityCube' where {type Base CSabrSwaptionVolatilityCube' = CSwaptionVolatilityStructure'; upcast :: Ptr CSabrSwaptionVolatilityCube'
-> IO (Ptr (Base CSabrSwaptionVolatilityCube'))
upcast = Ptr CSabrSwaptionVolatilityCube'
-> IO (Ptr CSwaptionVolatilityStructure')
Ptr CSabrSwaptionVolatilityCube'
-> IO (Ptr (Base CSabrSwaptionVolatilityCube'))
qlSabrSwaptionVolatilityCubeAsSwaptionVolatilityStructure}
instance Upcastable CNoArbSabrSwaptionVolatilityCube' where {type Base CNoArbSabrSwaptionVolatilityCube' = CSwaptionVolatilityStructure'; upcast :: Ptr CNoArbSabrSwaptionVolatilityCube'
-> IO (Ptr (Base CNoArbSabrSwaptionVolatilityCube'))
upcast = Ptr CNoArbSabrSwaptionVolatilityCube'
-> IO (Ptr CSwaptionVolatilityStructure')
Ptr CNoArbSabrSwaptionVolatilityCube'
-> IO (Ptr (Base CNoArbSabrSwaptionVolatilityCube'))
qlNoArbSabrSwaptionVolatilityCubeAsSwaptionVolatilityStructure}
instance Upcastable CZabrSwaptionVolatilityCube' where {type Base CZabrSwaptionVolatilityCube' = CSwaptionVolatilityStructure'; upcast :: Ptr CZabrSwaptionVolatilityCube'
-> IO (Ptr (Base CZabrSwaptionVolatilityCube'))
upcast = Ptr CZabrSwaptionVolatilityCube'
-> IO (Ptr CSwaptionVolatilityStructure')
Ptr CZabrSwaptionVolatilityCube'
-> IO (Ptr (Base CZabrSwaptionVolatilityCube'))
qlZabrSwaptionVolatilityCubeAsSwaptionVolatilityStructure}
instance Upcastable CInterpolatedSwaptionVolatilityCube' where {type Base CInterpolatedSwaptionVolatilityCube' = CSwaptionVolatilityStructure'; upcast :: Ptr CInterpolatedSwaptionVolatilityCube'
-> IO (Ptr (Base CInterpolatedSwaptionVolatilityCube'))
upcast = Ptr CInterpolatedSwaptionVolatilityCube'
-> IO (Ptr CSwaptionVolatilityStructure')
Ptr CInterpolatedSwaptionVolatilityCube'
-> IO (Ptr (Base CInterpolatedSwaptionVolatilityCube'))
qlInterpolatedSwaptionVolatilityCubeAsSwaptionVolatilityStructure}
instance Upcastable CSwaptionVolatilityMatrix' where {type Base CSwaptionVolatilityMatrix' = CSwaptionVolatilityStructure'; upcast :: Ptr CSwaptionVolatilityMatrix'
-> IO (Ptr (Base CSwaptionVolatilityMatrix'))
upcast = Ptr CSwaptionVolatilityMatrix'
-> IO (Ptr CSwaptionVolatilityStructure')
Ptr CSwaptionVolatilityMatrix'
-> IO (Ptr (Base CSwaptionVolatilityMatrix'))
qlSwaptionVolatilityMatrixAsSwaptionVolatilityStructure}
instance Upcastable CCapFloorTermVolatilityStructure' where {type Base CCapFloorTermVolatilityStructure' = CVolatilityTermStructure'; upcast :: Ptr CCapFloorTermVolatilityStructure'
-> IO (Ptr (Base CCapFloorTermVolatilityStructure'))
upcast = Ptr CCapFloorTermVolatilityStructure'
-> IO (Ptr CVolatilityTermStructure')
Ptr CCapFloorTermVolatilityStructure'
-> IO (Ptr (Base CCapFloorTermVolatilityStructure'))
qlCapFloorTermVolatilityStructureAsVolatilityTermStructure}
instance Upcastable CCapFloorTermVolCurve' where {type Base CCapFloorTermVolCurve' = CCapFloorTermVolatilityStructure'; upcast :: Ptr CCapFloorTermVolCurve'
-> IO (Ptr (Base CCapFloorTermVolCurve'))
upcast = Ptr CCapFloorTermVolCurve'
-> IO (Ptr CCapFloorTermVolatilityStructure')
Ptr CCapFloorTermVolCurve'
-> IO (Ptr (Base CCapFloorTermVolCurve'))
qlCapFloorTermVolCurveAsCapFloorTermVolatilityStructure}
instance Upcastable CCapFloorTermVolSurface' where {type Base CCapFloorTermVolSurface' = CCapFloorTermVolatilityStructure'; upcast :: Ptr CCapFloorTermVolSurface'
-> IO (Ptr (Base CCapFloorTermVolSurface'))
upcast = Ptr CCapFloorTermVolSurface'
-> IO (Ptr CCapFloorTermVolatilityStructure')
Ptr CCapFloorTermVolSurface'
-> IO (Ptr (Base CCapFloorTermVolSurface'))
qlCapFloorTermVolSurfaceAsCapFloorTermVolatilityStructure}
instance Upcastable CBlackAtmVolCurve' where {type Base CBlackAtmVolCurve' = CVolatilityTermStructure'; upcast :: Ptr CBlackAtmVolCurve' -> IO (Ptr (Base CBlackAtmVolCurve'))
upcast = Ptr CBlackAtmVolCurve' -> IO (Ptr CVolatilityTermStructure')
Ptr CBlackAtmVolCurve' -> IO (Ptr (Base CBlackAtmVolCurve'))
qlBlackAtmVolCurveAsVolatilityTermStructure}
instance Upcastable CBlackVolSurface' where {type Base CBlackVolSurface' = CBlackAtmVolCurve'; upcast :: Ptr CBlackVolSurface' -> IO (Ptr (Base CBlackVolSurface'))
upcast = Ptr CBlackVolSurface' -> IO (Ptr CBlackAtmVolCurve')
Ptr CBlackVolSurface' -> IO (Ptr (Base CBlackVolSurface'))
qlBlackVolSurfaceAsBlackAtmVolCurve}
instance Upcastable CAbcdAtmVolCurve' where {type Base CAbcdAtmVolCurve' = CBlackAtmVolCurve'; upcast :: Ptr CAbcdAtmVolCurve' -> IO (Ptr (Base CAbcdAtmVolCurve'))
upcast = Ptr CAbcdAtmVolCurve' -> IO (Ptr CBlackAtmVolCurve')
Ptr CAbcdAtmVolCurve' -> IO (Ptr (Base CAbcdAtmVolCurve'))
qlAbcdAtmVolCurveAsBlackAtmVolCurve}
instance Upcastable CSabrVolSurface' where {type Base CSabrVolSurface' = CBlackVolSurface'; upcast :: Ptr CSabrVolSurface' -> IO (Ptr (Base CSabrVolSurface'))
upcast = Ptr CSabrVolSurface' -> IO (Ptr CBlackVolSurface')
Ptr CSabrVolSurface' -> IO (Ptr (Base CSabrVolSurface'))
qlSabrVolSurfaceAsBlackVolSurface}
instance Upcastable CLocalVolTermStructure' where {type Base CLocalVolTermStructure' = CVolatilityTermStructure'; upcast :: Ptr CLocalVolTermStructure'
-> IO (Ptr (Base CLocalVolTermStructure'))
upcast = Ptr CLocalVolTermStructure' -> IO (Ptr CVolatilityTermStructure')
Ptr CLocalVolTermStructure'
-> IO (Ptr (Base CLocalVolTermStructure'))
qlLocalVolTermStructureAsVolatilityTermStructure}
instance Upcastable CGridModelLocalVolSurface' where {type Base CGridModelLocalVolSurface' = CLocalVolTermStructure'; upcast :: Ptr CGridModelLocalVolSurface'
-> IO (Ptr (Base CGridModelLocalVolSurface'))
upcast = Ptr CGridModelLocalVolSurface' -> IO (Ptr CLocalVolTermStructure')
Ptr CGridModelLocalVolSurface'
-> IO (Ptr (Base CGridModelLocalVolSurface'))
qlGridModelLocalVolSurfaceAsLocalVolTermStructure}
instance Upcastable CYoYOptionletVolatilitySurface' where {type Base CYoYOptionletVolatilitySurface' = CVolatilityTermStructure'; upcast :: Ptr CYoYOptionletVolatilitySurface'
-> IO (Ptr (Base CYoYOptionletVolatilitySurface'))
upcast = Ptr CYoYOptionletVolatilitySurface'
-> IO (Ptr CVolatilityTermStructure')
Ptr CYoYOptionletVolatilitySurface'
-> IO (Ptr (Base CYoYOptionletVolatilitySurface'))
qlYoYOptionletVolatilitySurfaceAsVolatilityTermStructure}
instance Upcastable CCPIVolatilitySurface' where {type Base CCPIVolatilitySurface' = CVolatilityTermStructure'; upcast :: Ptr CCPIVolatilitySurface'
-> IO (Ptr (Base CCPIVolatilitySurface'))
upcast = Ptr CCPIVolatilitySurface' -> IO (Ptr CVolatilityTermStructure')
Ptr CCPIVolatilitySurface'
-> IO (Ptr (Base CCPIVolatilitySurface'))
qlCPIVolatilitySurfaceAsVolatilityTermStructure}
asTermStructure :: GenTermStructure t -> IO TermStructure
asTermStructure :: forall t. GenTermStructure t -> IO TermStructure
asTermStructure = (Ptr CTermStructure' -> IO TermStructure)
-> GenForeignPtr t CTermStructure' -> IO TermStructure
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CTermStructure' -> IO TermStructure
peekTermStructure (GenForeignPtr t CTermStructure' -> IO TermStructure)
-> (GenTermStructure t -> GenForeignPtr t CTermStructure')
-> GenTermStructure t
-> IO TermStructure
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenTermStructure t -> GenForeignPtr t CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
withTermStructure :: GenTermStructure t  -> (Ptr CTermStructure' -> IO b) -> IO b
withTermStructure :: forall t b.
GenTermStructure t -> (Ptr CTermStructure' -> IO b) -> IO b
withTermStructure = GenForeignPtr t CTermStructure'
-> (Ptr CTermStructure' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr t CTermStructure'
 -> (Ptr CTermStructure' -> IO b) -> IO b)
-> (GenTermStructure t -> GenForeignPtr t CTermStructure')
-> GenTermStructure t
-> (Ptr CTermStructure' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenTermStructure t -> GenForeignPtr t CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
withGenTermStructure :: GenTermStructure (ForeignPtr t) -> (Ptr t -> IO b) -> IO b
withGenTermStructure :: forall t b.
GenTermStructure (ForeignPtr t) -> (Ptr t -> IO b) -> IO b
withGenTermStructure = ForeignPtr t -> (Ptr t -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr t -> (Ptr t -> IO b) -> IO b)
-> (GenTermStructure (ForeignPtr t) -> ForeignPtr t)
-> GenTermStructure (ForeignPtr t)
-> (Ptr t -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr t) CTermStructure' -> ForeignPtr t
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr t) CTermStructure' -> ForeignPtr t)
-> (GenTermStructure (ForeignPtr t)
    -> GenForeignPtr (ForeignPtr t) CTermStructure')
-> GenTermStructure (ForeignPtr t)
-> ForeignPtr t
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenTermStructure (ForeignPtr t)
-> GenForeignPtr (ForeignPtr t) CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekTermStructure :: Ptr CTermStructure' -> IO TermStructure
peekTermStructure :: Ptr CTermStructure' -> IO TermStructure
peekTermStructure = GenForeignPtr CTermStructure CTermStructure' -> TermStructure
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr CTermStructure CTermStructure' -> TermStructure)
-> (Ptr CTermStructure'
    -> IO (GenForeignPtr CTermStructure CTermStructure'))
-> Ptr CTermStructure'
-> IO TermStructure
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CTermStructure'
-> IO (GenForeignPtr CTermStructure CTermStructure')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr

asVolatilityTermStructure :: GenVolatilityTermStructure v -> IO VolatilityTermStructure
asVolatilityTermStructure :: forall v.
GenVolatilityTermStructure v -> IO VolatilityTermStructure
asVolatilityTermStructure = (Ptr CVolatilityTermStructure' -> IO VolatilityTermStructure)
-> GenForeignPtr v CVolatilityTermStructure'
-> IO VolatilityTermStructure
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CVolatilityTermStructure' -> IO VolatilityTermStructure
peekVolatilityTermStructure (GenForeignPtr v CVolatilityTermStructure'
 -> IO VolatilityTermStructure)
-> (GenVolatilityTermStructure v
    -> GenForeignPtr v CVolatilityTermStructure')
-> GenVolatilityTermStructure v
-> IO VolatilityTermStructure
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CVolatilityTermStructure' v) CTermStructure'
-> GenForeignPtr v CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CVolatilityTermStructure' v) CTermStructure'
 -> GenForeignPtr v CVolatilityTermStructure')
-> (GenVolatilityTermStructure v
    -> GenForeignPtr
         (AnyOf CVolatilityTermStructure' v) CTermStructure')
-> GenVolatilityTermStructure v
-> GenForeignPtr v CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenVolatilityTermStructure v
-> GenForeignPtr
     (AnyOf CVolatilityTermStructure' v) CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekVolatilityTermStructure :: Ptr CVolatilityTermStructure' -> IO VolatilityTermStructure
peekVolatilityTermStructure :: Ptr CVolatilityTermStructure' -> IO VolatilityTermStructure
peekVolatilityTermStructure = Ptr CVolatilityTermStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CVolatilityTermStructure') CVolatilityTermStructure')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CVolatilityTermStructure'
 -> IO
      (GenForeignPtr
         (ForeignPtr CVolatilityTermStructure') CVolatilityTermStructure'))
-> (GenForeignPtr
      (ForeignPtr CVolatilityTermStructure') CVolatilityTermStructure'
    -> IO VolatilityTermStructure)
-> Ptr CVolatilityTermStructure'
-> IO VolatilityTermStructure
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CVolatilityTermStructure') CVolatilityTermStructure'
-> IO VolatilityTermStructure
forall v.
GenForeignPtr v CVolatilityTermStructure'
-> IO (GenVolatilityTermStructure v)
newGenVolatilityTermStructure
peekGenVolatilityTermStructure :: (Finalizable v, Upcastable v, Base v ~ CVolatilityTermStructure') => Ptr v -> IO (GenVolatilityTermStructure (ForeignPtr v))
peekGenVolatilityTermStructure :: forall v.
(Finalizable v, Upcastable v,
 Base v ~ CVolatilityTermStructure') =>
Ptr v -> IO (GenVolatilityTermStructure (ForeignPtr v))
peekGenVolatilityTermStructure = Ptr v
-> IO (GenForeignPtr (ForeignPtr v) CVolatilityTermStructure')
Ptr v -> IO (GenForeignPtr (ForeignPtr v) (Base v))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr v
 -> IO (GenForeignPtr (ForeignPtr v) CVolatilityTermStructure'))
-> (GenForeignPtr (ForeignPtr v) CVolatilityTermStructure'
    -> IO (GenVolatilityTermStructure (ForeignPtr v)))
-> Ptr v
-> IO (GenVolatilityTermStructure (ForeignPtr v))
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr v) CVolatilityTermStructure'
-> IO (GenVolatilityTermStructure (ForeignPtr v))
forall v.
GenForeignPtr v CVolatilityTermStructure'
-> IO (GenVolatilityTermStructure v)
newGenVolatilityTermStructure
withVolatilityTermStructure :: GenVolatilityTermStructure v -> (Ptr CVolatilityTermStructure' -> IO b) -> IO b
withVolatilityTermStructure :: forall v b.
GenVolatilityTermStructure v
-> (Ptr CVolatilityTermStructure' -> IO b) -> IO b
withVolatilityTermStructure = GenForeignPtr v CVolatilityTermStructure'
-> (Ptr CVolatilityTermStructure' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr v CVolatilityTermStructure'
 -> (Ptr CVolatilityTermStructure' -> IO b) -> IO b)
-> (GenVolatilityTermStructure v
    -> GenForeignPtr v CVolatilityTermStructure')
-> GenVolatilityTermStructure v
-> (Ptr CVolatilityTermStructure' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CVolatilityTermStructure' v) CTermStructure'
-> GenForeignPtr v CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CVolatilityTermStructure' v) CTermStructure'
 -> GenForeignPtr v CVolatilityTermStructure')
-> (GenVolatilityTermStructure v
    -> GenForeignPtr
         (AnyOf CVolatilityTermStructure' v) CTermStructure')
-> GenVolatilityTermStructure v
-> GenForeignPtr v CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenVolatilityTermStructure v
-> GenForeignPtr
     (AnyOf CVolatilityTermStructure' v) CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
withGenVolatilityTermStructure :: GenVolatilityTermStructure (ForeignPtr v) -> (Ptr v -> IO b) -> IO b
withGenVolatilityTermStructure :: forall v b.
GenVolatilityTermStructure (ForeignPtr v)
-> (Ptr v -> IO b) -> IO b
withGenVolatilityTermStructure = ForeignPtr v -> (Ptr v -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr v -> (Ptr v -> IO b) -> IO b)
-> (GenVolatilityTermStructure (ForeignPtr v) -> ForeignPtr v)
-> GenVolatilityTermStructure (ForeignPtr v)
-> (Ptr v -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr v) CVolatilityTermStructure'
-> ForeignPtr v
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr v) CVolatilityTermStructure'
 -> ForeignPtr v)
-> (GenVolatilityTermStructure (ForeignPtr v)
    -> GenForeignPtr (ForeignPtr v) CVolatilityTermStructure')
-> GenVolatilityTermStructure (ForeignPtr v)
-> ForeignPtr v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CVolatilityTermStructure' (ForeignPtr v)) CTermStructure'
-> GenForeignPtr (ForeignPtr v) CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CVolatilityTermStructure' (ForeignPtr v)) CTermStructure'
 -> GenForeignPtr (ForeignPtr v) CVolatilityTermStructure')
-> (GenVolatilityTermStructure (ForeignPtr v)
    -> GenForeignPtr
         (AnyOf CVolatilityTermStructure' (ForeignPtr v)) CTermStructure')
-> GenVolatilityTermStructure (ForeignPtr v)
-> GenForeignPtr (ForeignPtr v) CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenVolatilityTermStructure (ForeignPtr v)
-> GenForeignPtr
     (AnyOf CVolatilityTermStructure' (ForeignPtr v)) CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
newGenVolatilityTermStructure :: GenForeignPtr v CVolatilityTermStructure' -> IO (GenVolatilityTermStructure v)
newGenVolatilityTermStructure :: forall v.
GenForeignPtr v CVolatilityTermStructure'
-> IO (GenVolatilityTermStructure v)
newGenVolatilityTermStructure = GenVolatilityTermStructure v -> IO (GenVolatilityTermStructure v)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenVolatilityTermStructure v -> IO (GenVolatilityTermStructure v))
-> (GenForeignPtr v CVolatilityTermStructure'
    -> GenVolatilityTermStructure v)
-> GenForeignPtr v CVolatilityTermStructure'
-> IO (GenVolatilityTermStructure v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CVolatilityTermStructure' v) CTermStructure'
-> GenVolatilityTermStructure v
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr (AnyOf CVolatilityTermStructure' v) CTermStructure'
 -> GenVolatilityTermStructure v)
-> (GenForeignPtr v CVolatilityTermStructure'
    -> GenForeignPtr
         (AnyOf CVolatilityTermStructure' v) CTermStructure')
-> GenForeignPtr v CVolatilityTermStructure'
-> GenVolatilityTermStructure v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr v CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf CVolatilityTermStructure' v) CTermStructure'
GenForeignPtr v CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf CVolatilityTermStructure' v)
     (Base CVolatilityTermStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf

asBlackVolTermStructure :: GenBlackVolTermStructure bv -> IO BlackVolTermStructure
asBlackVolTermStructure :: forall bv. GenBlackVolTermStructure bv -> IO BlackVolTermStructure
asBlackVolTermStructure = (Ptr CBlackVolTermStructure' -> IO BlackVolTermStructure)
-> GenForeignPtr bv CBlackVolTermStructure'
-> IO BlackVolTermStructure
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CBlackVolTermStructure' -> IO BlackVolTermStructure
peekBlackVolTermStructure (GenForeignPtr bv CBlackVolTermStructure'
 -> IO BlackVolTermStructure)
-> (GenBlackVolTermStructure bv
    -> GenForeignPtr bv CBlackVolTermStructure')
-> GenBlackVolTermStructure bv
-> IO BlackVolTermStructure
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure'
-> GenForeignPtr bv CBlackVolTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure'
 -> GenForeignPtr bv CBlackVolTermStructure')
-> (GenBlackVolTermStructure bv
    -> GenForeignPtr
         (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure')
-> GenBlackVolTermStructure bv
-> GenForeignPtr bv CBlackVolTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
  CTermStructure'
-> GenForeignPtr
     (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure')
-> (GenBlackVolTermStructure bv
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
         CTermStructure')
-> GenBlackVolTermStructure bv
-> GenForeignPtr
     (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBlackVolTermStructure bv
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekBlackVolTermStructure :: Ptr CBlackVolTermStructure' -> IO BlackVolTermStructure
peekBlackVolTermStructure :: Ptr CBlackVolTermStructure' -> IO BlackVolTermStructure
peekBlackVolTermStructure = Ptr CBlackVolTermStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CBlackVolTermStructure') CBlackVolTermStructure')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CBlackVolTermStructure'
 -> IO
      (GenForeignPtr
         (ForeignPtr CBlackVolTermStructure') CBlackVolTermStructure'))
-> (GenForeignPtr
      (ForeignPtr CBlackVolTermStructure') CBlackVolTermStructure'
    -> IO BlackVolTermStructure)
-> Ptr CBlackVolTermStructure'
-> IO BlackVolTermStructure
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CBlackVolTermStructure') CBlackVolTermStructure'
-> IO BlackVolTermStructure
forall bv.
GenForeignPtr bv CBlackVolTermStructure'
-> IO (GenBlackVolTermStructure bv)
newGenBlackVolTermStructure
withBlackVolTermStructure :: GenBlackVolTermStructure bv -> (Ptr CBlackVolTermStructure' -> IO b) -> IO b
withBlackVolTermStructure :: forall bv b.
GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO b) -> IO b
withBlackVolTermStructure = GenForeignPtr bv CBlackVolTermStructure'
-> (Ptr CBlackVolTermStructure' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr bv CBlackVolTermStructure'
 -> (Ptr CBlackVolTermStructure' -> IO b) -> IO b)
-> (GenBlackVolTermStructure bv
    -> GenForeignPtr bv CBlackVolTermStructure')
-> GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure'
-> GenForeignPtr bv CBlackVolTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure'
 -> GenForeignPtr bv CBlackVolTermStructure')
-> (GenBlackVolTermStructure bv
    -> GenForeignPtr
         (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure')
-> GenBlackVolTermStructure bv
-> GenForeignPtr bv CBlackVolTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
  CTermStructure'
-> GenForeignPtr
     (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure')
-> (GenBlackVolTermStructure bv
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
         CTermStructure')
-> GenBlackVolTermStructure bv
-> GenForeignPtr
     (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBlackVolTermStructure bv
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
withMaybeBlackVolTermStructure :: Maybe (GenBlackVolTermStructure bv) -> (Ptr CBlackVolTermStructure' -> IO b) -> IO b
withMaybeBlackVolTermStructure :: forall bv b.
Maybe (GenBlackVolTermStructure bv)
-> (Ptr CBlackVolTermStructure' -> IO b) -> IO b
withMaybeBlackVolTermStructure Maybe (GenBlackVolTermStructure bv)
x Ptr CBlackVolTermStructure' -> IO b
f = IO b
-> (GenBlackVolTermStructure bv -> IO b)
-> Maybe (GenBlackVolTermStructure bv)
-> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Ptr CBlackVolTermStructure' -> IO b
f Ptr CBlackVolTermStructure'
forall a. Ptr a
nullPtr) (GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO b) -> IO b
forall bv b.
GenBlackVolTermStructure bv
-> (Ptr CBlackVolTermStructure' -> IO b) -> IO b
`withBlackVolTermStructure` Ptr CBlackVolTermStructure' -> IO b
f) Maybe (GenBlackVolTermStructure bv)
x
newGenBlackVolTermStructure :: GenForeignPtr bv CBlackVolTermStructure' -> IO (GenBlackVolTermStructure bv)
newGenBlackVolTermStructure :: forall bv.
GenForeignPtr bv CBlackVolTermStructure'
-> IO (GenBlackVolTermStructure bv)
newGenBlackVolTermStructure = GenBlackVolTermStructure bv -> IO (GenBlackVolTermStructure bv)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenBlackVolTermStructure bv -> IO (GenBlackVolTermStructure bv))
-> (GenForeignPtr bv CBlackVolTermStructure'
    -> GenBlackVolTermStructure bv)
-> GenForeignPtr bv CBlackVolTermStructure'
-> IO (GenBlackVolTermStructure bv)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
  CTermStructure'
-> GenBlackVolTermStructure bv
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
   CTermStructure'
 -> GenBlackVolTermStructure bv)
-> (GenForeignPtr bv CBlackVolTermStructure'
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
         CTermStructure')
-> GenForeignPtr bv CBlackVolTermStructure'
-> GenBlackVolTermStructure bv
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
     CTermStructure'
GenForeignPtr
  (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
     (Base CVolatilityTermStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr
   (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure'
 -> GenForeignPtr
      (AnyOf
         CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
      CTermStructure')
-> (GenForeignPtr bv CBlackVolTermStructure'
    -> GenForeignPtr
         (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure')
-> GenForeignPtr bv CBlackVolTermStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure' (AnyOf CBlackVolTermStructure' bv))
     CTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr bv CBlackVolTermStructure'
-> GenForeignPtr
     (AnyOf CBlackVolTermStructure' bv) CVolatilityTermStructure'
GenForeignPtr bv CBlackVolTermStructure'
-> GenForeignPtr
     (AnyOf CBlackVolTermStructure' bv) (Base CBlackVolTermStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf

peekBlackVarianceCurve :: Ptr CBlackVarianceCurve' -> IO BlackVarianceCurve
peekBlackVarianceCurve :: Ptr CBlackVarianceCurve' -> IO BlackVarianceCurve
peekBlackVarianceCurve = Ptr CBlackVarianceCurve'
-> IO
     (GenForeignPtr
        (ForeignPtr CBlackVarianceCurve') CBlackVolTermStructure')
Ptr CBlackVarianceCurve'
-> IO
     (GenForeignPtr
        (ForeignPtr CBlackVarianceCurve') (Base CBlackVarianceCurve'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CBlackVarianceCurve'
 -> IO
      (GenForeignPtr
         (ForeignPtr CBlackVarianceCurve') CBlackVolTermStructure'))
-> (GenForeignPtr
      (ForeignPtr CBlackVarianceCurve') CBlackVolTermStructure'
    -> IO BlackVarianceCurve)
-> Ptr CBlackVarianceCurve'
-> IO BlackVarianceCurve
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CBlackVarianceCurve') CBlackVolTermStructure'
-> IO BlackVarianceCurve
forall bv.
GenForeignPtr bv CBlackVolTermStructure'
-> IO (GenBlackVolTermStructure bv)
newGenBlackVolTermStructure
peekRelinkableBlackVolTermStructure :: Ptr CRelinkableBlackVolTermStructure' -> IO RelinkableBlackVolTermStructure
peekRelinkableBlackVolTermStructure :: Ptr CRelinkableBlackVolTermStructure'
-> IO RelinkableBlackVolTermStructure
peekRelinkableBlackVolTermStructure = Ptr CRelinkableBlackVolTermStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CRelinkableBlackVolTermStructure')
        CBlackVolTermStructure')
Ptr CRelinkableBlackVolTermStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CRelinkableBlackVolTermStructure')
        (Base CRelinkableBlackVolTermStructure'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CRelinkableBlackVolTermStructure'
 -> IO
      (GenForeignPtr
         (ForeignPtr CRelinkableBlackVolTermStructure')
         CBlackVolTermStructure'))
-> (GenForeignPtr
      (ForeignPtr CRelinkableBlackVolTermStructure')
      CBlackVolTermStructure'
    -> IO RelinkableBlackVolTermStructure)
-> Ptr CRelinkableBlackVolTermStructure'
-> IO RelinkableBlackVolTermStructure
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CRelinkableBlackVolTermStructure')
  CBlackVolTermStructure'
-> IO RelinkableBlackVolTermStructure
forall bv.
GenForeignPtr bv CBlackVolTermStructure'
-> IO (GenBlackVolTermStructure bv)
newGenBlackVolTermStructure
withRelinkableBlackVolTermStructure :: RelinkableBlackVolTermStructure -> (Ptr CRelinkableBlackVolTermStructure' -> IO b) -> IO b
withRelinkableBlackVolTermStructure :: forall b.
RelinkableBlackVolTermStructure
-> (Ptr CRelinkableBlackVolTermStructure' -> IO b) -> IO b
withRelinkableBlackVolTermStructure = ForeignPtr CRelinkableBlackVolTermStructure'
-> (Ptr CRelinkableBlackVolTermStructure' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CRelinkableBlackVolTermStructure'
 -> (Ptr CRelinkableBlackVolTermStructure' -> IO b) -> IO b)
-> (RelinkableBlackVolTermStructure
    -> ForeignPtr CRelinkableBlackVolTermStructure')
-> RelinkableBlackVolTermStructure
-> (Ptr CRelinkableBlackVolTermStructure' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CRelinkableBlackVolTermStructure')
  CBlackVolTermStructure'
-> ForeignPtr CRelinkableBlackVolTermStructure'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CRelinkableBlackVolTermStructure')
   CBlackVolTermStructure'
 -> ForeignPtr CRelinkableBlackVolTermStructure')
-> (RelinkableBlackVolTermStructure
    -> GenForeignPtr
         (ForeignPtr CRelinkableBlackVolTermStructure')
         CBlackVolTermStructure')
-> RelinkableBlackVolTermStructure
-> ForeignPtr CRelinkableBlackVolTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CBlackVolTermStructure'
     (ForeignPtr CRelinkableBlackVolTermStructure'))
  CVolatilityTermStructure'
-> GenForeignPtr
     (ForeignPtr CRelinkableBlackVolTermStructure')
     CBlackVolTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CBlackVolTermStructure'
      (ForeignPtr CRelinkableBlackVolTermStructure'))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (ForeignPtr CRelinkableBlackVolTermStructure')
      CBlackVolTermStructure')
-> (RelinkableBlackVolTermStructure
    -> GenForeignPtr
         (AnyOf
            CBlackVolTermStructure'
            (ForeignPtr CRelinkableBlackVolTermStructure'))
         CVolatilityTermStructure')
-> RelinkableBlackVolTermStructure
-> GenForeignPtr
     (ForeignPtr CRelinkableBlackVolTermStructure')
     CBlackVolTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf
        CBlackVolTermStructure'
        (ForeignPtr CRelinkableBlackVolTermStructure')))
  CTermStructure'
-> GenForeignPtr
     (AnyOf
        CBlackVolTermStructure'
        (ForeignPtr CRelinkableBlackVolTermStructure'))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf
         CBlackVolTermStructure'
         (ForeignPtr CRelinkableBlackVolTermStructure')))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf
         CBlackVolTermStructure'
         (ForeignPtr CRelinkableBlackVolTermStructure'))
      CVolatilityTermStructure')
-> (RelinkableBlackVolTermStructure
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf
               CBlackVolTermStructure'
               (ForeignPtr CRelinkableBlackVolTermStructure')))
         CTermStructure')
-> RelinkableBlackVolTermStructure
-> GenForeignPtr
     (AnyOf
        CBlackVolTermStructure'
        (ForeignPtr CRelinkableBlackVolTermStructure'))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RelinkableBlackVolTermStructure
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf
           CBlackVolTermStructure'
           (ForeignPtr CRelinkableBlackVolTermStructure')))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
withBlackVarianceCurve :: BlackVarianceCurve -> (Ptr CBlackVarianceCurve' -> IO b) -> IO b
withBlackVarianceCurve :: forall b.
BlackVarianceCurve -> (Ptr CBlackVarianceCurve' -> IO b) -> IO b
withBlackVarianceCurve = ForeignPtr CBlackVarianceCurve'
-> (Ptr CBlackVarianceCurve' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CBlackVarianceCurve'
 -> (Ptr CBlackVarianceCurve' -> IO b) -> IO b)
-> (BlackVarianceCurve -> ForeignPtr CBlackVarianceCurve')
-> BlackVarianceCurve
-> (Ptr CBlackVarianceCurve' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CBlackVarianceCurve') CBlackVolTermStructure'
-> ForeignPtr CBlackVarianceCurve'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CBlackVarianceCurve') CBlackVolTermStructure'
 -> ForeignPtr CBlackVarianceCurve')
-> (BlackVarianceCurve
    -> GenForeignPtr
         (ForeignPtr CBlackVarianceCurve') CBlackVolTermStructure')
-> BlackVarianceCurve
-> ForeignPtr CBlackVarianceCurve'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackVolTermStructure' (ForeignPtr CBlackVarianceCurve'))
  CVolatilityTermStructure'
-> GenForeignPtr
     (ForeignPtr CBlackVarianceCurve') CBlackVolTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBlackVolTermStructure' (ForeignPtr CBlackVarianceCurve'))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (ForeignPtr CBlackVarianceCurve') CBlackVolTermStructure')
-> (BlackVarianceCurve
    -> GenForeignPtr
         (AnyOf CBlackVolTermStructure' (ForeignPtr CBlackVarianceCurve'))
         CVolatilityTermStructure')
-> BlackVarianceCurve
-> GenForeignPtr
     (ForeignPtr CBlackVarianceCurve') CBlackVolTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf CBlackVolTermStructure' (ForeignPtr CBlackVarianceCurve')))
  CTermStructure'
-> GenForeignPtr
     (AnyOf CBlackVolTermStructure' (ForeignPtr CBlackVarianceCurve'))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf CBlackVolTermStructure' (ForeignPtr CBlackVarianceCurve')))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf CBlackVolTermStructure' (ForeignPtr CBlackVarianceCurve'))
      CVolatilityTermStructure')
-> (BlackVarianceCurve
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf CBlackVolTermStructure' (ForeignPtr CBlackVarianceCurve')))
         CTermStructure')
-> BlackVarianceCurve
-> GenForeignPtr
     (AnyOf CBlackVolTermStructure' (ForeignPtr CBlackVarianceCurve'))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlackVarianceCurve
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf CBlackVolTermStructure' (ForeignPtr CBlackVarianceCurve')))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekBlackVolatilitySurfaceDelta :: Ptr CBlackVolatilitySurfaceDelta' -> IO BlackVolatilitySurfaceDelta
peekBlackVolatilitySurfaceDelta :: Ptr CBlackVolatilitySurfaceDelta' -> IO BlackVolatilitySurfaceDelta
peekBlackVolatilitySurfaceDelta = Ptr CBlackVolatilitySurfaceDelta'
-> IO
     (GenForeignPtr
        (ForeignPtr CBlackVolatilitySurfaceDelta') CBlackVolTermStructure')
Ptr CBlackVolatilitySurfaceDelta'
-> IO
     (GenForeignPtr
        (ForeignPtr CBlackVolatilitySurfaceDelta')
        (Base CBlackVolatilitySurfaceDelta'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CBlackVolatilitySurfaceDelta'
 -> IO
      (GenForeignPtr
         (ForeignPtr CBlackVolatilitySurfaceDelta')
         CBlackVolTermStructure'))
-> (GenForeignPtr
      (ForeignPtr CBlackVolatilitySurfaceDelta') CBlackVolTermStructure'
    -> IO BlackVolatilitySurfaceDelta)
-> Ptr CBlackVolatilitySurfaceDelta'
-> IO BlackVolatilitySurfaceDelta
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CBlackVolatilitySurfaceDelta') CBlackVolTermStructure'
-> IO BlackVolatilitySurfaceDelta
forall bv.
GenForeignPtr bv CBlackVolTermStructure'
-> IO (GenBlackVolTermStructure bv)
newGenBlackVolTermStructure
withBlackVolatilitySurfaceDelta :: BlackVolatilitySurfaceDelta -> (Ptr CBlackVolatilitySurfaceDelta' -> IO b) -> IO b
withBlackVolatilitySurfaceDelta :: forall b.
BlackVolatilitySurfaceDelta
-> (Ptr CBlackVolatilitySurfaceDelta' -> IO b) -> IO b
withBlackVolatilitySurfaceDelta = ForeignPtr CBlackVolatilitySurfaceDelta'
-> (Ptr CBlackVolatilitySurfaceDelta' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CBlackVolatilitySurfaceDelta'
 -> (Ptr CBlackVolatilitySurfaceDelta' -> IO b) -> IO b)
-> (BlackVolatilitySurfaceDelta
    -> ForeignPtr CBlackVolatilitySurfaceDelta')
-> BlackVolatilitySurfaceDelta
-> (Ptr CBlackVolatilitySurfaceDelta' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CBlackVolatilitySurfaceDelta') CBlackVolTermStructure'
-> ForeignPtr CBlackVolatilitySurfaceDelta'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CBlackVolatilitySurfaceDelta') CBlackVolTermStructure'
 -> ForeignPtr CBlackVolatilitySurfaceDelta')
-> (BlackVolatilitySurfaceDelta
    -> GenForeignPtr
         (ForeignPtr CBlackVolatilitySurfaceDelta') CBlackVolTermStructure')
-> BlackVolatilitySurfaceDelta
-> ForeignPtr CBlackVolatilitySurfaceDelta'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CBlackVolTermStructure' (ForeignPtr CBlackVolatilitySurfaceDelta'))
  CVolatilityTermStructure'
-> GenForeignPtr
     (ForeignPtr CBlackVolatilitySurfaceDelta') CBlackVolTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CBlackVolTermStructure' (ForeignPtr CBlackVolatilitySurfaceDelta'))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (ForeignPtr CBlackVolatilitySurfaceDelta') CBlackVolTermStructure')
-> (BlackVolatilitySurfaceDelta
    -> GenForeignPtr
         (AnyOf
            CBlackVolTermStructure' (ForeignPtr CBlackVolatilitySurfaceDelta'))
         CVolatilityTermStructure')
-> BlackVolatilitySurfaceDelta
-> GenForeignPtr
     (ForeignPtr CBlackVolatilitySurfaceDelta') CBlackVolTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf
        CBlackVolTermStructure'
        (ForeignPtr CBlackVolatilitySurfaceDelta')))
  CTermStructure'
-> GenForeignPtr
     (AnyOf
        CBlackVolTermStructure' (ForeignPtr CBlackVolatilitySurfaceDelta'))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf
         CBlackVolTermStructure'
         (ForeignPtr CBlackVolatilitySurfaceDelta')))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf
         CBlackVolTermStructure' (ForeignPtr CBlackVolatilitySurfaceDelta'))
      CVolatilityTermStructure')
-> (BlackVolatilitySurfaceDelta
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf
               CBlackVolTermStructure'
               (ForeignPtr CBlackVolatilitySurfaceDelta')))
         CTermStructure')
-> BlackVolatilitySurfaceDelta
-> GenForeignPtr
     (AnyOf
        CBlackVolTermStructure' (ForeignPtr CBlackVolatilitySurfaceDelta'))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlackVolatilitySurfaceDelta
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf
           CBlackVolTermStructure'
           (ForeignPtr CBlackVolatilitySurfaceDelta')))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure

peekOptionletVolatilityStructure :: Ptr COptionletVolatilityStructure' -> IO OptionletVolatilityStructure
peekOptionletVolatilityStructure :: Ptr COptionletVolatilityStructure'
-> IO OptionletVolatilityStructure
peekOptionletVolatilityStructure = Ptr COptionletVolatilityStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr COptionletVolatilityStructure')
        COptionletVolatilityStructure')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr COptionletVolatilityStructure'
 -> IO
      (GenForeignPtr
         (ForeignPtr COptionletVolatilityStructure')
         COptionletVolatilityStructure'))
-> (GenForeignPtr
      (ForeignPtr COptionletVolatilityStructure')
      COptionletVolatilityStructure'
    -> IO OptionletVolatilityStructure)
-> Ptr COptionletVolatilityStructure'
-> IO OptionletVolatilityStructure
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr COptionletVolatilityStructure')
  COptionletVolatilityStructure'
-> IO OptionletVolatilityStructure
forall ov.
GenForeignPtr ov COptionletVolatilityStructure'
-> IO (GenOptionletVolatilityStructure ov)
newGenOptionletVolatilityStructure
withOptionletVolatilityStructure :: GenOptionletVolatilityStructure ov -> (Ptr COptionletVolatilityStructure' -> IO b) -> IO b
withOptionletVolatilityStructure :: forall ov b.
GenOptionletVolatilityStructure ov
-> (Ptr COptionletVolatilityStructure' -> IO b) -> IO b
withOptionletVolatilityStructure = GenForeignPtr ov COptionletVolatilityStructure'
-> (Ptr COptionletVolatilityStructure' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr ov COptionletVolatilityStructure'
 -> (Ptr COptionletVolatilityStructure' -> IO b) -> IO b)
-> (GenOptionletVolatilityStructure ov
    -> GenForeignPtr ov COptionletVolatilityStructure')
-> GenOptionletVolatilityStructure ov
-> (Ptr COptionletVolatilityStructure' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COptionletVolatilityStructure' ov) CVolatilityTermStructure'
-> GenForeignPtr ov COptionletVolatilityStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COptionletVolatilityStructure' ov) CVolatilityTermStructure'
 -> GenForeignPtr ov COptionletVolatilityStructure')
-> (GenOptionletVolatilityStructure ov
    -> GenForeignPtr
         (AnyOf COptionletVolatilityStructure' ov)
         CVolatilityTermStructure')
-> GenOptionletVolatilityStructure ov
-> GenForeignPtr ov COptionletVolatilityStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf COptionletVolatilityStructure' ov))
  CTermStructure'
-> GenForeignPtr
     (AnyOf COptionletVolatilityStructure' ov) CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf COptionletVolatilityStructure' ov))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf COptionletVolatilityStructure' ov)
      CVolatilityTermStructure')
-> (GenOptionletVolatilityStructure ov
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf COptionletVolatilityStructure' ov))
         CTermStructure')
-> GenOptionletVolatilityStructure ov
-> GenForeignPtr
     (AnyOf COptionletVolatilityStructure' ov) CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenOptionletVolatilityStructure ov
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf COptionletVolatilityStructure' ov))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
withMaybeOptionletVolatilityStructure :: Maybe (GenOptionletVolatilityStructure ov) -> (Ptr COptionletVolatilityStructure' -> IO b) -> IO b
withMaybeOptionletVolatilityStructure :: forall ov b.
Maybe (GenOptionletVolatilityStructure ov)
-> (Ptr COptionletVolatilityStructure' -> IO b) -> IO b
withMaybeOptionletVolatilityStructure Maybe (GenOptionletVolatilityStructure ov)
x Ptr COptionletVolatilityStructure' -> IO b
f = IO b
-> (GenOptionletVolatilityStructure ov -> IO b)
-> Maybe (GenOptionletVolatilityStructure ov)
-> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Ptr COptionletVolatilityStructure' -> IO b
f Ptr COptionletVolatilityStructure'
forall a. Ptr a
nullPtr) (GenOptionletVolatilityStructure ov
-> (Ptr COptionletVolatilityStructure' -> IO b) -> IO b
forall ov b.
GenOptionletVolatilityStructure ov
-> (Ptr COptionletVolatilityStructure' -> IO b) -> IO b
`withOptionletVolatilityStructure` Ptr COptionletVolatilityStructure' -> IO b
f) Maybe (GenOptionletVolatilityStructure ov)
x
newGenOptionletVolatilityStructure :: GenForeignPtr ov COptionletVolatilityStructure' -> IO (GenOptionletVolatilityStructure ov)
newGenOptionletVolatilityStructure :: forall ov.
GenForeignPtr ov COptionletVolatilityStructure'
-> IO (GenOptionletVolatilityStructure ov)
newGenOptionletVolatilityStructure = GenOptionletVolatilityStructure ov
-> IO (GenOptionletVolatilityStructure ov)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenOptionletVolatilityStructure ov
 -> IO (GenOptionletVolatilityStructure ov))
-> (GenForeignPtr ov COptionletVolatilityStructure'
    -> GenOptionletVolatilityStructure ov)
-> GenForeignPtr ov COptionletVolatilityStructure'
-> IO (GenOptionletVolatilityStructure ov)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf COptionletVolatilityStructure' ov))
  CTermStructure'
-> GenOptionletVolatilityStructure ov
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf COptionletVolatilityStructure' ov))
   CTermStructure'
 -> GenOptionletVolatilityStructure ov)
-> (GenForeignPtr ov COptionletVolatilityStructure'
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf COptionletVolatilityStructure' ov))
         CTermStructure')
-> GenForeignPtr ov COptionletVolatilityStructure'
-> GenOptionletVolatilityStructure ov
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COptionletVolatilityStructure' ov) CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf COptionletVolatilityStructure' ov))
     CTermStructure'
GenForeignPtr
  (AnyOf COptionletVolatilityStructure' ov) CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf COptionletVolatilityStructure' ov))
     (Base CVolatilityTermStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr
   (AnyOf COptionletVolatilityStructure' ov) CVolatilityTermStructure'
 -> GenForeignPtr
      (AnyOf
         CVolatilityTermStructure'
         (AnyOf COptionletVolatilityStructure' ov))
      CTermStructure')
-> (GenForeignPtr ov COptionletVolatilityStructure'
    -> GenForeignPtr
         (AnyOf COptionletVolatilityStructure' ov)
         CVolatilityTermStructure')
-> GenForeignPtr ov COptionletVolatilityStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf COptionletVolatilityStructure' ov))
     CTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr ov COptionletVolatilityStructure'
-> GenForeignPtr
     (AnyOf COptionletVolatilityStructure' ov) CVolatilityTermStructure'
GenForeignPtr ov COptionletVolatilityStructure'
-> GenForeignPtr
     (AnyOf COptionletVolatilityStructure' ov)
     (Base COptionletVolatilityStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekRelinkableOptionletVolatilityStructure :: Ptr CRelinkableOptionletVolatilityStructure' -> IO RelinkableOptionletVolatilityStructure
peekRelinkableOptionletVolatilityStructure :: Ptr CRelinkableOptionletVolatilityStructure'
-> IO RelinkableOptionletVolatilityStructure
peekRelinkableOptionletVolatilityStructure = Ptr CRelinkableOptionletVolatilityStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CRelinkableOptionletVolatilityStructure')
        COptionletVolatilityStructure')
Ptr CRelinkableOptionletVolatilityStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CRelinkableOptionletVolatilityStructure')
        (Base CRelinkableOptionletVolatilityStructure'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CRelinkableOptionletVolatilityStructure'
 -> IO
      (GenForeignPtr
         (ForeignPtr CRelinkableOptionletVolatilityStructure')
         COptionletVolatilityStructure'))
-> (GenForeignPtr
      (ForeignPtr CRelinkableOptionletVolatilityStructure')
      COptionletVolatilityStructure'
    -> IO RelinkableOptionletVolatilityStructure)
-> Ptr CRelinkableOptionletVolatilityStructure'
-> IO RelinkableOptionletVolatilityStructure
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CRelinkableOptionletVolatilityStructure')
  COptionletVolatilityStructure'
-> IO RelinkableOptionletVolatilityStructure
forall ov.
GenForeignPtr ov COptionletVolatilityStructure'
-> IO (GenOptionletVolatilityStructure ov)
newGenOptionletVolatilityStructure
withRelinkableOptionletVolatilityStructure :: RelinkableOptionletVolatilityStructure -> (Ptr CRelinkableOptionletVolatilityStructure' -> IO b) -> IO b
withRelinkableOptionletVolatilityStructure :: forall b.
RelinkableOptionletVolatilityStructure
-> (Ptr CRelinkableOptionletVolatilityStructure' -> IO b) -> IO b
withRelinkableOptionletVolatilityStructure = ForeignPtr CRelinkableOptionletVolatilityStructure'
-> (Ptr CRelinkableOptionletVolatilityStructure' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CRelinkableOptionletVolatilityStructure'
 -> (Ptr CRelinkableOptionletVolatilityStructure' -> IO b) -> IO b)
-> (RelinkableOptionletVolatilityStructure
    -> ForeignPtr CRelinkableOptionletVolatilityStructure')
-> RelinkableOptionletVolatilityStructure
-> (Ptr CRelinkableOptionletVolatilityStructure' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CRelinkableOptionletVolatilityStructure')
  COptionletVolatilityStructure'
-> ForeignPtr CRelinkableOptionletVolatilityStructure'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CRelinkableOptionletVolatilityStructure')
   COptionletVolatilityStructure'
 -> ForeignPtr CRelinkableOptionletVolatilityStructure')
-> (RelinkableOptionletVolatilityStructure
    -> GenForeignPtr
         (ForeignPtr CRelinkableOptionletVolatilityStructure')
         COptionletVolatilityStructure')
-> RelinkableOptionletVolatilityStructure
-> ForeignPtr CRelinkableOptionletVolatilityStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     COptionletVolatilityStructure'
     (ForeignPtr CRelinkableOptionletVolatilityStructure'))
  CVolatilityTermStructure'
-> GenForeignPtr
     (ForeignPtr CRelinkableOptionletVolatilityStructure')
     COptionletVolatilityStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      COptionletVolatilityStructure'
      (ForeignPtr CRelinkableOptionletVolatilityStructure'))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (ForeignPtr CRelinkableOptionletVolatilityStructure')
      COptionletVolatilityStructure')
-> (RelinkableOptionletVolatilityStructure
    -> GenForeignPtr
         (AnyOf
            COptionletVolatilityStructure'
            (ForeignPtr CRelinkableOptionletVolatilityStructure'))
         CVolatilityTermStructure')
-> RelinkableOptionletVolatilityStructure
-> GenForeignPtr
     (ForeignPtr CRelinkableOptionletVolatilityStructure')
     COptionletVolatilityStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf
        COptionletVolatilityStructure'
        (ForeignPtr CRelinkableOptionletVolatilityStructure')))
  CTermStructure'
-> GenForeignPtr
     (AnyOf
        COptionletVolatilityStructure'
        (ForeignPtr CRelinkableOptionletVolatilityStructure'))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf
         COptionletVolatilityStructure'
         (ForeignPtr CRelinkableOptionletVolatilityStructure')))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf
         COptionletVolatilityStructure'
         (ForeignPtr CRelinkableOptionletVolatilityStructure'))
      CVolatilityTermStructure')
-> (RelinkableOptionletVolatilityStructure
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf
               COptionletVolatilityStructure'
               (ForeignPtr CRelinkableOptionletVolatilityStructure')))
         CTermStructure')
-> RelinkableOptionletVolatilityStructure
-> GenForeignPtr
     (AnyOf
        COptionletVolatilityStructure'
        (ForeignPtr CRelinkableOptionletVolatilityStructure'))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RelinkableOptionletVolatilityStructure
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf
           COptionletVolatilityStructure'
           (ForeignPtr CRelinkableOptionletVolatilityStructure')))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekSwaptionVolatilityStructure :: Ptr CSwaptionVolatilityStructure' -> IO SwaptionVolatilityStructure
peekSwaptionVolatilityStructure :: Ptr CSwaptionVolatilityStructure' -> IO SwaptionVolatilityStructure
peekSwaptionVolatilityStructure = Ptr CSwaptionVolatilityStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CSwaptionVolatilityStructure')
        CSwaptionVolatilityStructure')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CSwaptionVolatilityStructure'
 -> IO
      (GenForeignPtr
         (ForeignPtr CSwaptionVolatilityStructure')
         CSwaptionVolatilityStructure'))
-> (GenForeignPtr
      (ForeignPtr CSwaptionVolatilityStructure')
      CSwaptionVolatilityStructure'
    -> IO SwaptionVolatilityStructure)
-> Ptr CSwaptionVolatilityStructure'
-> IO SwaptionVolatilityStructure
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CSwaptionVolatilityStructure')
  CSwaptionVolatilityStructure'
-> IO SwaptionVolatilityStructure
forall sv.
GenForeignPtr sv CSwaptionVolatilityStructure'
-> IO (GenSwaptionVolatilityStructure sv)
newGenSwaptionVolatilityStructure
withSwaptionVolatilityStructure :: GenSwaptionVolatilityStructure sv -> (Ptr CSwaptionVolatilityStructure' -> IO b) -> IO b
withSwaptionVolatilityStructure :: forall sv b.
GenSwaptionVolatilityStructure sv
-> (Ptr CSwaptionVolatilityStructure' -> IO b) -> IO b
withSwaptionVolatilityStructure = GenForeignPtr sv CSwaptionVolatilityStructure'
-> (Ptr CSwaptionVolatilityStructure' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr sv CSwaptionVolatilityStructure'
 -> (Ptr CSwaptionVolatilityStructure' -> IO b) -> IO b)
-> (GenSwaptionVolatilityStructure sv
    -> GenForeignPtr sv CSwaptionVolatilityStructure')
-> GenSwaptionVolatilityStructure sv
-> (Ptr CSwaptionVolatilityStructure' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwaptionVolatilityStructure' sv) CVolatilityTermStructure'
-> GenForeignPtr sv CSwaptionVolatilityStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CSwaptionVolatilityStructure' sv) CVolatilityTermStructure'
 -> GenForeignPtr sv CSwaptionVolatilityStructure')
-> (GenSwaptionVolatilityStructure sv
    -> GenForeignPtr
         (AnyOf CSwaptionVolatilityStructure' sv) CVolatilityTermStructure')
-> GenSwaptionVolatilityStructure sv
-> GenForeignPtr sv CSwaptionVolatilityStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure' (AnyOf CSwaptionVolatilityStructure' sv))
  CTermStructure'
-> GenForeignPtr
     (AnyOf CSwaptionVolatilityStructure' sv) CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure' (AnyOf CSwaptionVolatilityStructure' sv))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf CSwaptionVolatilityStructure' sv) CVolatilityTermStructure')
-> (GenSwaptionVolatilityStructure sv
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure' (AnyOf CSwaptionVolatilityStructure' sv))
         CTermStructure')
-> GenSwaptionVolatilityStructure sv
-> GenForeignPtr
     (AnyOf CSwaptionVolatilityStructure' sv) CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenSwaptionVolatilityStructure sv
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure' (AnyOf CSwaptionVolatilityStructure' sv))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
withMaybeSwaptionVolatilityStructure :: Maybe (GenSwaptionVolatilityStructure sv) -> (Ptr CSwaptionVolatilityStructure' -> IO b) -> IO b
withMaybeSwaptionVolatilityStructure :: forall sv b.
Maybe (GenSwaptionVolatilityStructure sv)
-> (Ptr CSwaptionVolatilityStructure' -> IO b) -> IO b
withMaybeSwaptionVolatilityStructure Maybe (GenSwaptionVolatilityStructure sv)
x Ptr CSwaptionVolatilityStructure' -> IO b
f = IO b
-> (GenSwaptionVolatilityStructure sv -> IO b)
-> Maybe (GenSwaptionVolatilityStructure sv)
-> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Ptr CSwaptionVolatilityStructure' -> IO b
f Ptr CSwaptionVolatilityStructure'
forall a. Ptr a
nullPtr) (GenSwaptionVolatilityStructure sv
-> (Ptr CSwaptionVolatilityStructure' -> IO b) -> IO b
forall sv b.
GenSwaptionVolatilityStructure sv
-> (Ptr CSwaptionVolatilityStructure' -> IO b) -> IO b
`withSwaptionVolatilityStructure` Ptr CSwaptionVolatilityStructure' -> IO b
f) Maybe (GenSwaptionVolatilityStructure sv)
x
newGenSwaptionVolatilityStructure :: GenForeignPtr sv CSwaptionVolatilityStructure' -> IO (GenSwaptionVolatilityStructure sv)
newGenSwaptionVolatilityStructure :: forall sv.
GenForeignPtr sv CSwaptionVolatilityStructure'
-> IO (GenSwaptionVolatilityStructure sv)
newGenSwaptionVolatilityStructure = GenSwaptionVolatilityStructure sv
-> IO (GenSwaptionVolatilityStructure sv)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenSwaptionVolatilityStructure sv
 -> IO (GenSwaptionVolatilityStructure sv))
-> (GenForeignPtr sv CSwaptionVolatilityStructure'
    -> GenSwaptionVolatilityStructure sv)
-> GenForeignPtr sv CSwaptionVolatilityStructure'
-> IO (GenSwaptionVolatilityStructure sv)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure' (AnyOf CSwaptionVolatilityStructure' sv))
  CTermStructure'
-> GenSwaptionVolatilityStructure sv
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure' (AnyOf CSwaptionVolatilityStructure' sv))
   CTermStructure'
 -> GenSwaptionVolatilityStructure sv)
-> (GenForeignPtr sv CSwaptionVolatilityStructure'
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure' (AnyOf CSwaptionVolatilityStructure' sv))
         CTermStructure')
-> GenForeignPtr sv CSwaptionVolatilityStructure'
-> GenSwaptionVolatilityStructure sv
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwaptionVolatilityStructure' sv) CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure' (AnyOf CSwaptionVolatilityStructure' sv))
     CTermStructure'
GenForeignPtr
  (AnyOf CSwaptionVolatilityStructure' sv) CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure' (AnyOf CSwaptionVolatilityStructure' sv))
     (Base CVolatilityTermStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr
   (AnyOf CSwaptionVolatilityStructure' sv) CVolatilityTermStructure'
 -> GenForeignPtr
      (AnyOf
         CVolatilityTermStructure' (AnyOf CSwaptionVolatilityStructure' sv))
      CTermStructure')
-> (GenForeignPtr sv CSwaptionVolatilityStructure'
    -> GenForeignPtr
         (AnyOf CSwaptionVolatilityStructure' sv) CVolatilityTermStructure')
-> GenForeignPtr sv CSwaptionVolatilityStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure' (AnyOf CSwaptionVolatilityStructure' sv))
     CTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr sv CSwaptionVolatilityStructure'
-> GenForeignPtr
     (AnyOf CSwaptionVolatilityStructure' sv) CVolatilityTermStructure'
GenForeignPtr sv CSwaptionVolatilityStructure'
-> GenForeignPtr
     (AnyOf CSwaptionVolatilityStructure' sv)
     (Base CSwaptionVolatilityStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekRelinkableSwaptionVolatilityStructure :: Ptr CRelinkableSwaptionVolatilityStructure' -> IO RelinkableSwaptionVolatilityStructure
peekRelinkableSwaptionVolatilityStructure :: Ptr CRelinkableSwaptionVolatilityStructure'
-> IO RelinkableSwaptionVolatilityStructure
peekRelinkableSwaptionVolatilityStructure = Ptr CRelinkableSwaptionVolatilityStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CRelinkableSwaptionVolatilityStructure')
        CSwaptionVolatilityStructure')
Ptr CRelinkableSwaptionVolatilityStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CRelinkableSwaptionVolatilityStructure')
        (Base CRelinkableSwaptionVolatilityStructure'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CRelinkableSwaptionVolatilityStructure'
 -> IO
      (GenForeignPtr
         (ForeignPtr CRelinkableSwaptionVolatilityStructure')
         CSwaptionVolatilityStructure'))
-> (GenForeignPtr
      (ForeignPtr CRelinkableSwaptionVolatilityStructure')
      CSwaptionVolatilityStructure'
    -> IO RelinkableSwaptionVolatilityStructure)
-> Ptr CRelinkableSwaptionVolatilityStructure'
-> IO RelinkableSwaptionVolatilityStructure
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CRelinkableSwaptionVolatilityStructure')
  CSwaptionVolatilityStructure'
-> IO RelinkableSwaptionVolatilityStructure
forall sv.
GenForeignPtr sv CSwaptionVolatilityStructure'
-> IO (GenSwaptionVolatilityStructure sv)
newGenSwaptionVolatilityStructure
withRelinkableSwaptionVolatilityStructure :: RelinkableSwaptionVolatilityStructure -> (Ptr CRelinkableSwaptionVolatilityStructure' -> IO b) -> IO b
withRelinkableSwaptionVolatilityStructure :: forall b.
RelinkableSwaptionVolatilityStructure
-> (Ptr CRelinkableSwaptionVolatilityStructure' -> IO b) -> IO b
withRelinkableSwaptionVolatilityStructure = ForeignPtr CRelinkableSwaptionVolatilityStructure'
-> (Ptr CRelinkableSwaptionVolatilityStructure' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CRelinkableSwaptionVolatilityStructure'
 -> (Ptr CRelinkableSwaptionVolatilityStructure' -> IO b) -> IO b)
-> (RelinkableSwaptionVolatilityStructure
    -> ForeignPtr CRelinkableSwaptionVolatilityStructure')
-> RelinkableSwaptionVolatilityStructure
-> (Ptr CRelinkableSwaptionVolatilityStructure' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CRelinkableSwaptionVolatilityStructure')
  CSwaptionVolatilityStructure'
-> ForeignPtr CRelinkableSwaptionVolatilityStructure'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CRelinkableSwaptionVolatilityStructure')
   CSwaptionVolatilityStructure'
 -> ForeignPtr CRelinkableSwaptionVolatilityStructure')
-> (RelinkableSwaptionVolatilityStructure
    -> GenForeignPtr
         (ForeignPtr CRelinkableSwaptionVolatilityStructure')
         CSwaptionVolatilityStructure')
-> RelinkableSwaptionVolatilityStructure
-> ForeignPtr CRelinkableSwaptionVolatilityStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CSwaptionVolatilityStructure'
     (ForeignPtr CRelinkableSwaptionVolatilityStructure'))
  CVolatilityTermStructure'
-> GenForeignPtr
     (ForeignPtr CRelinkableSwaptionVolatilityStructure')
     CSwaptionVolatilityStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CSwaptionVolatilityStructure'
      (ForeignPtr CRelinkableSwaptionVolatilityStructure'))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (ForeignPtr CRelinkableSwaptionVolatilityStructure')
      CSwaptionVolatilityStructure')
-> (RelinkableSwaptionVolatilityStructure
    -> GenForeignPtr
         (AnyOf
            CSwaptionVolatilityStructure'
            (ForeignPtr CRelinkableSwaptionVolatilityStructure'))
         CVolatilityTermStructure')
-> RelinkableSwaptionVolatilityStructure
-> GenForeignPtr
     (ForeignPtr CRelinkableSwaptionVolatilityStructure')
     CSwaptionVolatilityStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CRelinkableSwaptionVolatilityStructure')))
  CTermStructure'
-> GenForeignPtr
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CRelinkableSwaptionVolatilityStructure'))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf
         CSwaptionVolatilityStructure'
         (ForeignPtr CRelinkableSwaptionVolatilityStructure')))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf
         CSwaptionVolatilityStructure'
         (ForeignPtr CRelinkableSwaptionVolatilityStructure'))
      CVolatilityTermStructure')
-> (RelinkableSwaptionVolatilityStructure
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf
               CSwaptionVolatilityStructure'
               (ForeignPtr CRelinkableSwaptionVolatilityStructure')))
         CTermStructure')
-> RelinkableSwaptionVolatilityStructure
-> GenForeignPtr
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CRelinkableSwaptionVolatilityStructure'))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RelinkableSwaptionVolatilityStructure
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf
           CSwaptionVolatilityStructure'
           (ForeignPtr CRelinkableSwaptionVolatilityStructure')))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekSabrSwaptionVolatilityCube :: Ptr CSabrSwaptionVolatilityCube' -> IO SabrSwaptionVolatilityCube
peekSabrSwaptionVolatilityCube :: Ptr CSabrSwaptionVolatilityCube' -> IO SabrSwaptionVolatilityCube
peekSabrSwaptionVolatilityCube = Ptr CSabrSwaptionVolatilityCube'
-> IO
     (GenForeignPtr
        (ForeignPtr CSabrSwaptionVolatilityCube')
        CSwaptionVolatilityStructure')
Ptr CSabrSwaptionVolatilityCube'
-> IO
     (GenForeignPtr
        (ForeignPtr CSabrSwaptionVolatilityCube')
        (Base CSabrSwaptionVolatilityCube'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CSabrSwaptionVolatilityCube'
 -> IO
      (GenForeignPtr
         (ForeignPtr CSabrSwaptionVolatilityCube')
         CSwaptionVolatilityStructure'))
-> (GenForeignPtr
      (ForeignPtr CSabrSwaptionVolatilityCube')
      CSwaptionVolatilityStructure'
    -> IO SabrSwaptionVolatilityCube)
-> Ptr CSabrSwaptionVolatilityCube'
-> IO SabrSwaptionVolatilityCube
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CSabrSwaptionVolatilityCube')
  CSwaptionVolatilityStructure'
-> IO SabrSwaptionVolatilityCube
forall sv.
GenForeignPtr sv CSwaptionVolatilityStructure'
-> IO (GenSwaptionVolatilityStructure sv)
newGenSwaptionVolatilityStructure
withSabrSwaptionVolatilityCube :: SabrSwaptionVolatilityCube -> (Ptr CSabrSwaptionVolatilityCube' -> IO b) -> IO b
withSabrSwaptionVolatilityCube :: forall b.
SabrSwaptionVolatilityCube
-> (Ptr CSabrSwaptionVolatilityCube' -> IO b) -> IO b
withSabrSwaptionVolatilityCube = ForeignPtr CSabrSwaptionVolatilityCube'
-> (Ptr CSabrSwaptionVolatilityCube' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CSabrSwaptionVolatilityCube'
 -> (Ptr CSabrSwaptionVolatilityCube' -> IO b) -> IO b)
-> (SabrSwaptionVolatilityCube
    -> ForeignPtr CSabrSwaptionVolatilityCube')
-> SabrSwaptionVolatilityCube
-> (Ptr CSabrSwaptionVolatilityCube' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CSabrSwaptionVolatilityCube')
  CSwaptionVolatilityStructure'
-> ForeignPtr CSabrSwaptionVolatilityCube'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CSabrSwaptionVolatilityCube')
   CSwaptionVolatilityStructure'
 -> ForeignPtr CSabrSwaptionVolatilityCube')
-> (SabrSwaptionVolatilityCube
    -> GenForeignPtr
         (ForeignPtr CSabrSwaptionVolatilityCube')
         CSwaptionVolatilityStructure')
-> SabrSwaptionVolatilityCube
-> ForeignPtr CSabrSwaptionVolatilityCube'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CSwaptionVolatilityStructure'
     (ForeignPtr CSabrSwaptionVolatilityCube'))
  CVolatilityTermStructure'
-> GenForeignPtr
     (ForeignPtr CSabrSwaptionVolatilityCube')
     CSwaptionVolatilityStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CSwaptionVolatilityStructure'
      (ForeignPtr CSabrSwaptionVolatilityCube'))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (ForeignPtr CSabrSwaptionVolatilityCube')
      CSwaptionVolatilityStructure')
-> (SabrSwaptionVolatilityCube
    -> GenForeignPtr
         (AnyOf
            CSwaptionVolatilityStructure'
            (ForeignPtr CSabrSwaptionVolatilityCube'))
         CVolatilityTermStructure')
-> SabrSwaptionVolatilityCube
-> GenForeignPtr
     (ForeignPtr CSabrSwaptionVolatilityCube')
     CSwaptionVolatilityStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CSabrSwaptionVolatilityCube')))
  CTermStructure'
-> GenForeignPtr
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CSabrSwaptionVolatilityCube'))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf
         CSwaptionVolatilityStructure'
         (ForeignPtr CSabrSwaptionVolatilityCube')))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf
         CSwaptionVolatilityStructure'
         (ForeignPtr CSabrSwaptionVolatilityCube'))
      CVolatilityTermStructure')
-> (SabrSwaptionVolatilityCube
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf
               CSwaptionVolatilityStructure'
               (ForeignPtr CSabrSwaptionVolatilityCube')))
         CTermStructure')
-> SabrSwaptionVolatilityCube
-> GenForeignPtr
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CSabrSwaptionVolatilityCube'))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SabrSwaptionVolatilityCube
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf
           CSwaptionVolatilityStructure'
           (ForeignPtr CSabrSwaptionVolatilityCube')))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekSwaptionVolatilityMatrix :: Ptr CSwaptionVolatilityMatrix' -> IO SwaptionVolatilityMatrix
peekSwaptionVolatilityMatrix :: Ptr CSwaptionVolatilityMatrix' -> IO SwaptionVolatilityMatrix
peekSwaptionVolatilityMatrix = Ptr CSwaptionVolatilityMatrix'
-> IO
     (GenForeignPtr
        (ForeignPtr CSwaptionVolatilityMatrix')
        CSwaptionVolatilityStructure')
Ptr CSwaptionVolatilityMatrix'
-> IO
     (GenForeignPtr
        (ForeignPtr CSwaptionVolatilityMatrix')
        (Base CSwaptionVolatilityMatrix'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CSwaptionVolatilityMatrix'
 -> IO
      (GenForeignPtr
         (ForeignPtr CSwaptionVolatilityMatrix')
         CSwaptionVolatilityStructure'))
-> (GenForeignPtr
      (ForeignPtr CSwaptionVolatilityMatrix')
      CSwaptionVolatilityStructure'
    -> IO SwaptionVolatilityMatrix)
-> Ptr CSwaptionVolatilityMatrix'
-> IO SwaptionVolatilityMatrix
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CSwaptionVolatilityMatrix')
  CSwaptionVolatilityStructure'
-> IO SwaptionVolatilityMatrix
forall sv.
GenForeignPtr sv CSwaptionVolatilityStructure'
-> IO (GenSwaptionVolatilityStructure sv)
newGenSwaptionVolatilityStructure
withSwaptionVolatilityMatrix :: SwaptionVolatilityMatrix -> (Ptr CSwaptionVolatilityMatrix' -> IO b) -> IO b
withSwaptionVolatilityMatrix :: forall b.
SwaptionVolatilityMatrix
-> (Ptr CSwaptionVolatilityMatrix' -> IO b) -> IO b
withSwaptionVolatilityMatrix = ForeignPtr CSwaptionVolatilityMatrix'
-> (Ptr CSwaptionVolatilityMatrix' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CSwaptionVolatilityMatrix'
 -> (Ptr CSwaptionVolatilityMatrix' -> IO b) -> IO b)
-> (SwaptionVolatilityMatrix
    -> ForeignPtr CSwaptionVolatilityMatrix')
-> SwaptionVolatilityMatrix
-> (Ptr CSwaptionVolatilityMatrix' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CSwaptionVolatilityMatrix')
  CSwaptionVolatilityStructure'
-> ForeignPtr CSwaptionVolatilityMatrix'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CSwaptionVolatilityMatrix')
   CSwaptionVolatilityStructure'
 -> ForeignPtr CSwaptionVolatilityMatrix')
-> (SwaptionVolatilityMatrix
    -> GenForeignPtr
         (ForeignPtr CSwaptionVolatilityMatrix')
         CSwaptionVolatilityStructure')
-> SwaptionVolatilityMatrix
-> ForeignPtr CSwaptionVolatilityMatrix'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CSwaptionVolatilityStructure'
     (ForeignPtr CSwaptionVolatilityMatrix'))
  CVolatilityTermStructure'
-> GenForeignPtr
     (ForeignPtr CSwaptionVolatilityMatrix')
     CSwaptionVolatilityStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CSwaptionVolatilityStructure'
      (ForeignPtr CSwaptionVolatilityMatrix'))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (ForeignPtr CSwaptionVolatilityMatrix')
      CSwaptionVolatilityStructure')
-> (SwaptionVolatilityMatrix
    -> GenForeignPtr
         (AnyOf
            CSwaptionVolatilityStructure'
            (ForeignPtr CSwaptionVolatilityMatrix'))
         CVolatilityTermStructure')
-> SwaptionVolatilityMatrix
-> GenForeignPtr
     (ForeignPtr CSwaptionVolatilityMatrix')
     CSwaptionVolatilityStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CSwaptionVolatilityMatrix')))
  CTermStructure'
-> GenForeignPtr
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CSwaptionVolatilityMatrix'))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf
         CSwaptionVolatilityStructure'
         (ForeignPtr CSwaptionVolatilityMatrix')))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf
         CSwaptionVolatilityStructure'
         (ForeignPtr CSwaptionVolatilityMatrix'))
      CVolatilityTermStructure')
-> (SwaptionVolatilityMatrix
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf
               CSwaptionVolatilityStructure'
               (ForeignPtr CSwaptionVolatilityMatrix')))
         CTermStructure')
-> SwaptionVolatilityMatrix
-> GenForeignPtr
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CSwaptionVolatilityMatrix'))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SwaptionVolatilityMatrix
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf
           CSwaptionVolatilityStructure'
           (ForeignPtr CSwaptionVolatilityMatrix')))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekNoArbSabrSwaptionVolatilityCube :: Ptr CNoArbSabrSwaptionVolatilityCube' -> IO NoArbSabrSwaptionVolatilityCube
peekNoArbSabrSwaptionVolatilityCube :: Ptr CNoArbSabrSwaptionVolatilityCube'
-> IO NoArbSabrSwaptionVolatilityCube
peekNoArbSabrSwaptionVolatilityCube = Ptr CNoArbSabrSwaptionVolatilityCube'
-> IO
     (GenForeignPtr
        (ForeignPtr CNoArbSabrSwaptionVolatilityCube')
        CSwaptionVolatilityStructure')
Ptr CNoArbSabrSwaptionVolatilityCube'
-> IO
     (GenForeignPtr
        (ForeignPtr CNoArbSabrSwaptionVolatilityCube')
        (Base CNoArbSabrSwaptionVolatilityCube'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CNoArbSabrSwaptionVolatilityCube'
 -> IO
      (GenForeignPtr
         (ForeignPtr CNoArbSabrSwaptionVolatilityCube')
         CSwaptionVolatilityStructure'))
-> (GenForeignPtr
      (ForeignPtr CNoArbSabrSwaptionVolatilityCube')
      CSwaptionVolatilityStructure'
    -> IO NoArbSabrSwaptionVolatilityCube)
-> Ptr CNoArbSabrSwaptionVolatilityCube'
-> IO NoArbSabrSwaptionVolatilityCube
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CNoArbSabrSwaptionVolatilityCube')
  CSwaptionVolatilityStructure'
-> IO NoArbSabrSwaptionVolatilityCube
forall sv.
GenForeignPtr sv CSwaptionVolatilityStructure'
-> IO (GenSwaptionVolatilityStructure sv)
newGenSwaptionVolatilityStructure
withNoArbSabrSwaptionVolatilityCube :: NoArbSabrSwaptionVolatilityCube -> (Ptr CNoArbSabrSwaptionVolatilityCube' -> IO b) -> IO b
withNoArbSabrSwaptionVolatilityCube :: forall b.
NoArbSabrSwaptionVolatilityCube
-> (Ptr CNoArbSabrSwaptionVolatilityCube' -> IO b) -> IO b
withNoArbSabrSwaptionVolatilityCube = ForeignPtr CNoArbSabrSwaptionVolatilityCube'
-> (Ptr CNoArbSabrSwaptionVolatilityCube' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CNoArbSabrSwaptionVolatilityCube'
 -> (Ptr CNoArbSabrSwaptionVolatilityCube' -> IO b) -> IO b)
-> (NoArbSabrSwaptionVolatilityCube
    -> ForeignPtr CNoArbSabrSwaptionVolatilityCube')
-> NoArbSabrSwaptionVolatilityCube
-> (Ptr CNoArbSabrSwaptionVolatilityCube' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CNoArbSabrSwaptionVolatilityCube')
  CSwaptionVolatilityStructure'
-> ForeignPtr CNoArbSabrSwaptionVolatilityCube'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CNoArbSabrSwaptionVolatilityCube')
   CSwaptionVolatilityStructure'
 -> ForeignPtr CNoArbSabrSwaptionVolatilityCube')
-> (NoArbSabrSwaptionVolatilityCube
    -> GenForeignPtr
         (ForeignPtr CNoArbSabrSwaptionVolatilityCube')
         CSwaptionVolatilityStructure')
-> NoArbSabrSwaptionVolatilityCube
-> ForeignPtr CNoArbSabrSwaptionVolatilityCube'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CSwaptionVolatilityStructure'
     (ForeignPtr CNoArbSabrSwaptionVolatilityCube'))
  CVolatilityTermStructure'
-> GenForeignPtr
     (ForeignPtr CNoArbSabrSwaptionVolatilityCube')
     CSwaptionVolatilityStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CSwaptionVolatilityStructure'
      (ForeignPtr CNoArbSabrSwaptionVolatilityCube'))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (ForeignPtr CNoArbSabrSwaptionVolatilityCube')
      CSwaptionVolatilityStructure')
-> (NoArbSabrSwaptionVolatilityCube
    -> GenForeignPtr
         (AnyOf
            CSwaptionVolatilityStructure'
            (ForeignPtr CNoArbSabrSwaptionVolatilityCube'))
         CVolatilityTermStructure')
-> NoArbSabrSwaptionVolatilityCube
-> GenForeignPtr
     (ForeignPtr CNoArbSabrSwaptionVolatilityCube')
     CSwaptionVolatilityStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CNoArbSabrSwaptionVolatilityCube')))
  CTermStructure'
-> GenForeignPtr
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CNoArbSabrSwaptionVolatilityCube'))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf
         CSwaptionVolatilityStructure'
         (ForeignPtr CNoArbSabrSwaptionVolatilityCube')))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf
         CSwaptionVolatilityStructure'
         (ForeignPtr CNoArbSabrSwaptionVolatilityCube'))
      CVolatilityTermStructure')
-> (NoArbSabrSwaptionVolatilityCube
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf
               CSwaptionVolatilityStructure'
               (ForeignPtr CNoArbSabrSwaptionVolatilityCube')))
         CTermStructure')
-> NoArbSabrSwaptionVolatilityCube
-> GenForeignPtr
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CNoArbSabrSwaptionVolatilityCube'))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NoArbSabrSwaptionVolatilityCube
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf
           CSwaptionVolatilityStructure'
           (ForeignPtr CNoArbSabrSwaptionVolatilityCube')))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekZabrSwaptionVolatilityCube :: Ptr CZabrSwaptionVolatilityCube' -> IO ZabrSwaptionVolatilityCube
peekZabrSwaptionVolatilityCube :: Ptr CZabrSwaptionVolatilityCube' -> IO ZabrSwaptionVolatilityCube
peekZabrSwaptionVolatilityCube = Ptr CZabrSwaptionVolatilityCube'
-> IO
     (GenForeignPtr
        (ForeignPtr CZabrSwaptionVolatilityCube')
        CSwaptionVolatilityStructure')
Ptr CZabrSwaptionVolatilityCube'
-> IO
     (GenForeignPtr
        (ForeignPtr CZabrSwaptionVolatilityCube')
        (Base CZabrSwaptionVolatilityCube'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CZabrSwaptionVolatilityCube'
 -> IO
      (GenForeignPtr
         (ForeignPtr CZabrSwaptionVolatilityCube')
         CSwaptionVolatilityStructure'))
-> (GenForeignPtr
      (ForeignPtr CZabrSwaptionVolatilityCube')
      CSwaptionVolatilityStructure'
    -> IO ZabrSwaptionVolatilityCube)
-> Ptr CZabrSwaptionVolatilityCube'
-> IO ZabrSwaptionVolatilityCube
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CZabrSwaptionVolatilityCube')
  CSwaptionVolatilityStructure'
-> IO ZabrSwaptionVolatilityCube
forall sv.
GenForeignPtr sv CSwaptionVolatilityStructure'
-> IO (GenSwaptionVolatilityStructure sv)
newGenSwaptionVolatilityStructure
withZabrSwaptionVolatilityCube :: ZabrSwaptionVolatilityCube -> (Ptr CZabrSwaptionVolatilityCube' -> IO b) -> IO b
withZabrSwaptionVolatilityCube :: forall b.
ZabrSwaptionVolatilityCube
-> (Ptr CZabrSwaptionVolatilityCube' -> IO b) -> IO b
withZabrSwaptionVolatilityCube = ForeignPtr CZabrSwaptionVolatilityCube'
-> (Ptr CZabrSwaptionVolatilityCube' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CZabrSwaptionVolatilityCube'
 -> (Ptr CZabrSwaptionVolatilityCube' -> IO b) -> IO b)
-> (ZabrSwaptionVolatilityCube
    -> ForeignPtr CZabrSwaptionVolatilityCube')
-> ZabrSwaptionVolatilityCube
-> (Ptr CZabrSwaptionVolatilityCube' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CZabrSwaptionVolatilityCube')
  CSwaptionVolatilityStructure'
-> ForeignPtr CZabrSwaptionVolatilityCube'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CZabrSwaptionVolatilityCube')
   CSwaptionVolatilityStructure'
 -> ForeignPtr CZabrSwaptionVolatilityCube')
-> (ZabrSwaptionVolatilityCube
    -> GenForeignPtr
         (ForeignPtr CZabrSwaptionVolatilityCube')
         CSwaptionVolatilityStructure')
-> ZabrSwaptionVolatilityCube
-> ForeignPtr CZabrSwaptionVolatilityCube'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CSwaptionVolatilityStructure'
     (ForeignPtr CZabrSwaptionVolatilityCube'))
  CVolatilityTermStructure'
-> GenForeignPtr
     (ForeignPtr CZabrSwaptionVolatilityCube')
     CSwaptionVolatilityStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CSwaptionVolatilityStructure'
      (ForeignPtr CZabrSwaptionVolatilityCube'))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (ForeignPtr CZabrSwaptionVolatilityCube')
      CSwaptionVolatilityStructure')
-> (ZabrSwaptionVolatilityCube
    -> GenForeignPtr
         (AnyOf
            CSwaptionVolatilityStructure'
            (ForeignPtr CZabrSwaptionVolatilityCube'))
         CVolatilityTermStructure')
-> ZabrSwaptionVolatilityCube
-> GenForeignPtr
     (ForeignPtr CZabrSwaptionVolatilityCube')
     CSwaptionVolatilityStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CZabrSwaptionVolatilityCube')))
  CTermStructure'
-> GenForeignPtr
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CZabrSwaptionVolatilityCube'))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf
         CSwaptionVolatilityStructure'
         (ForeignPtr CZabrSwaptionVolatilityCube')))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf
         CSwaptionVolatilityStructure'
         (ForeignPtr CZabrSwaptionVolatilityCube'))
      CVolatilityTermStructure')
-> (ZabrSwaptionVolatilityCube
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf
               CSwaptionVolatilityStructure'
               (ForeignPtr CZabrSwaptionVolatilityCube')))
         CTermStructure')
-> ZabrSwaptionVolatilityCube
-> GenForeignPtr
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CZabrSwaptionVolatilityCube'))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ZabrSwaptionVolatilityCube
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf
           CSwaptionVolatilityStructure'
           (ForeignPtr CZabrSwaptionVolatilityCube')))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekInterpolatedSwaptionVolatilityCube :: Ptr CInterpolatedSwaptionVolatilityCube' -> IO InterpolatedSwaptionVolatilityCube
peekInterpolatedSwaptionVolatilityCube :: Ptr CInterpolatedSwaptionVolatilityCube'
-> IO InterpolatedSwaptionVolatilityCube
peekInterpolatedSwaptionVolatilityCube = Ptr CInterpolatedSwaptionVolatilityCube'
-> IO
     (GenForeignPtr
        (ForeignPtr CInterpolatedSwaptionVolatilityCube')
        CSwaptionVolatilityStructure')
Ptr CInterpolatedSwaptionVolatilityCube'
-> IO
     (GenForeignPtr
        (ForeignPtr CInterpolatedSwaptionVolatilityCube')
        (Base CInterpolatedSwaptionVolatilityCube'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CInterpolatedSwaptionVolatilityCube'
 -> IO
      (GenForeignPtr
         (ForeignPtr CInterpolatedSwaptionVolatilityCube')
         CSwaptionVolatilityStructure'))
-> (GenForeignPtr
      (ForeignPtr CInterpolatedSwaptionVolatilityCube')
      CSwaptionVolatilityStructure'
    -> IO InterpolatedSwaptionVolatilityCube)
-> Ptr CInterpolatedSwaptionVolatilityCube'
-> IO InterpolatedSwaptionVolatilityCube
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CInterpolatedSwaptionVolatilityCube')
  CSwaptionVolatilityStructure'
-> IO InterpolatedSwaptionVolatilityCube
forall sv.
GenForeignPtr sv CSwaptionVolatilityStructure'
-> IO (GenSwaptionVolatilityStructure sv)
newGenSwaptionVolatilityStructure
withInterpolatedSwaptionVolatilityCube :: InterpolatedSwaptionVolatilityCube -> (Ptr CInterpolatedSwaptionVolatilityCube' -> IO b) -> IO b
withInterpolatedSwaptionVolatilityCube :: forall b.
InterpolatedSwaptionVolatilityCube
-> (Ptr CInterpolatedSwaptionVolatilityCube' -> IO b) -> IO b
withInterpolatedSwaptionVolatilityCube = ForeignPtr CInterpolatedSwaptionVolatilityCube'
-> (Ptr CInterpolatedSwaptionVolatilityCube' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CInterpolatedSwaptionVolatilityCube'
 -> (Ptr CInterpolatedSwaptionVolatilityCube' -> IO b) -> IO b)
-> (InterpolatedSwaptionVolatilityCube
    -> ForeignPtr CInterpolatedSwaptionVolatilityCube')
-> InterpolatedSwaptionVolatilityCube
-> (Ptr CInterpolatedSwaptionVolatilityCube' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CInterpolatedSwaptionVolatilityCube')
  CSwaptionVolatilityStructure'
-> ForeignPtr CInterpolatedSwaptionVolatilityCube'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CInterpolatedSwaptionVolatilityCube')
   CSwaptionVolatilityStructure'
 -> ForeignPtr CInterpolatedSwaptionVolatilityCube')
-> (InterpolatedSwaptionVolatilityCube
    -> GenForeignPtr
         (ForeignPtr CInterpolatedSwaptionVolatilityCube')
         CSwaptionVolatilityStructure')
-> InterpolatedSwaptionVolatilityCube
-> ForeignPtr CInterpolatedSwaptionVolatilityCube'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CSwaptionVolatilityStructure'
     (ForeignPtr CInterpolatedSwaptionVolatilityCube'))
  CVolatilityTermStructure'
-> GenForeignPtr
     (ForeignPtr CInterpolatedSwaptionVolatilityCube')
     CSwaptionVolatilityStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CSwaptionVolatilityStructure'
      (ForeignPtr CInterpolatedSwaptionVolatilityCube'))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (ForeignPtr CInterpolatedSwaptionVolatilityCube')
      CSwaptionVolatilityStructure')
-> (InterpolatedSwaptionVolatilityCube
    -> GenForeignPtr
         (AnyOf
            CSwaptionVolatilityStructure'
            (ForeignPtr CInterpolatedSwaptionVolatilityCube'))
         CVolatilityTermStructure')
-> InterpolatedSwaptionVolatilityCube
-> GenForeignPtr
     (ForeignPtr CInterpolatedSwaptionVolatilityCube')
     CSwaptionVolatilityStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CInterpolatedSwaptionVolatilityCube')))
  CTermStructure'
-> GenForeignPtr
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CInterpolatedSwaptionVolatilityCube'))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf
         CSwaptionVolatilityStructure'
         (ForeignPtr CInterpolatedSwaptionVolatilityCube')))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf
         CSwaptionVolatilityStructure'
         (ForeignPtr CInterpolatedSwaptionVolatilityCube'))
      CVolatilityTermStructure')
-> (InterpolatedSwaptionVolatilityCube
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf
               CSwaptionVolatilityStructure'
               (ForeignPtr CInterpolatedSwaptionVolatilityCube')))
         CTermStructure')
-> InterpolatedSwaptionVolatilityCube
-> GenForeignPtr
     (AnyOf
        CSwaptionVolatilityStructure'
        (ForeignPtr CInterpolatedSwaptionVolatilityCube'))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. InterpolatedSwaptionVolatilityCube
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf
           CSwaptionVolatilityStructure'
           (ForeignPtr CInterpolatedSwaptionVolatilityCube')))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekCapFloorTermVolatilityStructure :: Ptr CCapFloorTermVolatilityStructure' -> IO CapFloorTermVolatilityStructure
peekCapFloorTermVolatilityStructure :: Ptr CCapFloorTermVolatilityStructure'
-> IO CapFloorTermVolatilityStructure
peekCapFloorTermVolatilityStructure = Ptr CCapFloorTermVolatilityStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CCapFloorTermVolatilityStructure')
        CCapFloorTermVolatilityStructure')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CCapFloorTermVolatilityStructure'
 -> IO
      (GenForeignPtr
         (ForeignPtr CCapFloorTermVolatilityStructure')
         CCapFloorTermVolatilityStructure'))
-> (GenForeignPtr
      (ForeignPtr CCapFloorTermVolatilityStructure')
      CCapFloorTermVolatilityStructure'
    -> IO CapFloorTermVolatilityStructure)
-> Ptr CCapFloorTermVolatilityStructure'
-> IO CapFloorTermVolatilityStructure
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CCapFloorTermVolatilityStructure')
  CCapFloorTermVolatilityStructure'
-> IO CapFloorTermVolatilityStructure
forall c.
GenForeignPtr c CCapFloorTermVolatilityStructure'
-> IO (GenCapFloorTermVolatilityStructure c)
newGenCapFloorTermVolatilityStructure
withGenCapFloorTermVolatilityStructure :: GenCapFloorTermVolatilityStructure c -> (Ptr CCapFloorTermVolatilityStructure' -> IO b) -> IO b
withGenCapFloorTermVolatilityStructure :: forall c b.
GenCapFloorTermVolatilityStructure c
-> (Ptr CCapFloorTermVolatilityStructure' -> IO b) -> IO b
withGenCapFloorTermVolatilityStructure = GenForeignPtr c CCapFloorTermVolatilityStructure'
-> (Ptr CCapFloorTermVolatilityStructure' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr c CCapFloorTermVolatilityStructure'
 -> (Ptr CCapFloorTermVolatilityStructure' -> IO b) -> IO b)
-> (GenCapFloorTermVolatilityStructure c
    -> GenForeignPtr c CCapFloorTermVolatilityStructure')
-> GenCapFloorTermVolatilityStructure c
-> (Ptr CCapFloorTermVolatilityStructure' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CCapFloorTermVolatilityStructure' c)
  CVolatilityTermStructure'
-> GenForeignPtr c CCapFloorTermVolatilityStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CCapFloorTermVolatilityStructure' c)
   CVolatilityTermStructure'
 -> GenForeignPtr c CCapFloorTermVolatilityStructure')
-> (GenCapFloorTermVolatilityStructure c
    -> GenForeignPtr
         (AnyOf CCapFloorTermVolatilityStructure' c)
         CVolatilityTermStructure')
-> GenCapFloorTermVolatilityStructure c
-> GenForeignPtr c CCapFloorTermVolatilityStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf CCapFloorTermVolatilityStructure' c))
  CTermStructure'
-> GenForeignPtr
     (AnyOf CCapFloorTermVolatilityStructure' c)
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf CCapFloorTermVolatilityStructure' c))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf CCapFloorTermVolatilityStructure' c)
      CVolatilityTermStructure')
-> (GenCapFloorTermVolatilityStructure c
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf CCapFloorTermVolatilityStructure' c))
         CTermStructure')
-> GenCapFloorTermVolatilityStructure c
-> GenForeignPtr
     (AnyOf CCapFloorTermVolatilityStructure' c)
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenCapFloorTermVolatilityStructure c
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf CCapFloorTermVolatilityStructure' c))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
newGenCapFloorTermVolatilityStructure :: GenForeignPtr c CCapFloorTermVolatilityStructure' -> IO (GenCapFloorTermVolatilityStructure c)
newGenCapFloorTermVolatilityStructure :: forall c.
GenForeignPtr c CCapFloorTermVolatilityStructure'
-> IO (GenCapFloorTermVolatilityStructure c)
newGenCapFloorTermVolatilityStructure = GenCapFloorTermVolatilityStructure c
-> IO (GenCapFloorTermVolatilityStructure c)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenCapFloorTermVolatilityStructure c
 -> IO (GenCapFloorTermVolatilityStructure c))
-> (GenForeignPtr c CCapFloorTermVolatilityStructure'
    -> GenCapFloorTermVolatilityStructure c)
-> GenForeignPtr c CCapFloorTermVolatilityStructure'
-> IO (GenCapFloorTermVolatilityStructure c)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf CCapFloorTermVolatilityStructure' c))
  CTermStructure'
-> GenCapFloorTermVolatilityStructure c
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf CCapFloorTermVolatilityStructure' c))
   CTermStructure'
 -> GenCapFloorTermVolatilityStructure c)
-> (GenForeignPtr c CCapFloorTermVolatilityStructure'
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf CCapFloorTermVolatilityStructure' c))
         CTermStructure')
-> GenForeignPtr c CCapFloorTermVolatilityStructure'
-> GenCapFloorTermVolatilityStructure c
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CCapFloorTermVolatilityStructure' c)
  CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf CCapFloorTermVolatilityStructure' c))
     CTermStructure'
GenForeignPtr
  (AnyOf CCapFloorTermVolatilityStructure' c)
  CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf CCapFloorTermVolatilityStructure' c))
     (Base CVolatilityTermStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr
   (AnyOf CCapFloorTermVolatilityStructure' c)
   CVolatilityTermStructure'
 -> GenForeignPtr
      (AnyOf
         CVolatilityTermStructure'
         (AnyOf CCapFloorTermVolatilityStructure' c))
      CTermStructure')
-> (GenForeignPtr c CCapFloorTermVolatilityStructure'
    -> GenForeignPtr
         (AnyOf CCapFloorTermVolatilityStructure' c)
         CVolatilityTermStructure')
-> GenForeignPtr c CCapFloorTermVolatilityStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf CCapFloorTermVolatilityStructure' c))
     CTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr c CCapFloorTermVolatilityStructure'
-> GenForeignPtr
     (AnyOf CCapFloorTermVolatilityStructure' c)
     CVolatilityTermStructure'
GenForeignPtr c CCapFloorTermVolatilityStructure'
-> GenForeignPtr
     (AnyOf CCapFloorTermVolatilityStructure' c)
     (Base CCapFloorTermVolatilityStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekCapFloorTermVolCurve :: Ptr CCapFloorTermVolCurve' -> IO CapFloorTermVolCurve
peekCapFloorTermVolCurve :: Ptr CCapFloorTermVolCurve' -> IO CapFloorTermVolCurve
peekCapFloorTermVolCurve = Ptr CCapFloorTermVolCurve'
-> IO
     (GenForeignPtr
        (ForeignPtr CCapFloorTermVolCurve')
        CCapFloorTermVolatilityStructure')
Ptr CCapFloorTermVolCurve'
-> IO
     (GenForeignPtr
        (ForeignPtr CCapFloorTermVolCurve') (Base CCapFloorTermVolCurve'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CCapFloorTermVolCurve'
 -> IO
      (GenForeignPtr
         (ForeignPtr CCapFloorTermVolCurve')
         CCapFloorTermVolatilityStructure'))
-> (GenForeignPtr
      (ForeignPtr CCapFloorTermVolCurve')
      CCapFloorTermVolatilityStructure'
    -> IO CapFloorTermVolCurve)
-> Ptr CCapFloorTermVolCurve'
-> IO CapFloorTermVolCurve
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CCapFloorTermVolCurve')
  CCapFloorTermVolatilityStructure'
-> IO CapFloorTermVolCurve
forall c.
GenForeignPtr c CCapFloorTermVolatilityStructure'
-> IO (GenCapFloorTermVolatilityStructure c)
newGenCapFloorTermVolatilityStructure
withCapFloorTermVolCurve :: CapFloorTermVolCurve -> (Ptr CCapFloorTermVolCurve' -> IO b) -> IO b
withCapFloorTermVolCurve :: forall b.
CapFloorTermVolCurve
-> (Ptr CCapFloorTermVolCurve' -> IO b) -> IO b
withCapFloorTermVolCurve = ForeignPtr CCapFloorTermVolCurve'
-> (Ptr CCapFloorTermVolCurve' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CCapFloorTermVolCurve'
 -> (Ptr CCapFloorTermVolCurve' -> IO b) -> IO b)
-> (CapFloorTermVolCurve -> ForeignPtr CCapFloorTermVolCurve')
-> CapFloorTermVolCurve
-> (Ptr CCapFloorTermVolCurve' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CCapFloorTermVolCurve')
  CCapFloorTermVolatilityStructure'
-> ForeignPtr CCapFloorTermVolCurve'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CCapFloorTermVolCurve')
   CCapFloorTermVolatilityStructure'
 -> ForeignPtr CCapFloorTermVolCurve')
-> (CapFloorTermVolCurve
    -> GenForeignPtr
         (ForeignPtr CCapFloorTermVolCurve')
         CCapFloorTermVolatilityStructure')
-> CapFloorTermVolCurve
-> ForeignPtr CCapFloorTermVolCurve'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCapFloorTermVolatilityStructure'
     (ForeignPtr CCapFloorTermVolCurve'))
  CVolatilityTermStructure'
-> GenForeignPtr
     (ForeignPtr CCapFloorTermVolCurve')
     CCapFloorTermVolatilityStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCapFloorTermVolatilityStructure'
      (ForeignPtr CCapFloorTermVolCurve'))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (ForeignPtr CCapFloorTermVolCurve')
      CCapFloorTermVolatilityStructure')
-> (CapFloorTermVolCurve
    -> GenForeignPtr
         (AnyOf
            CCapFloorTermVolatilityStructure'
            (ForeignPtr CCapFloorTermVolCurve'))
         CVolatilityTermStructure')
-> CapFloorTermVolCurve
-> GenForeignPtr
     (ForeignPtr CCapFloorTermVolCurve')
     CCapFloorTermVolatilityStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf
        CCapFloorTermVolatilityStructure'
        (ForeignPtr CCapFloorTermVolCurve')))
  CTermStructure'
-> GenForeignPtr
     (AnyOf
        CCapFloorTermVolatilityStructure'
        (ForeignPtr CCapFloorTermVolCurve'))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf
         CCapFloorTermVolatilityStructure'
         (ForeignPtr CCapFloorTermVolCurve')))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf
         CCapFloorTermVolatilityStructure'
         (ForeignPtr CCapFloorTermVolCurve'))
      CVolatilityTermStructure')
-> (CapFloorTermVolCurve
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf
               CCapFloorTermVolatilityStructure'
               (ForeignPtr CCapFloorTermVolCurve')))
         CTermStructure')
-> CapFloorTermVolCurve
-> GenForeignPtr
     (AnyOf
        CCapFloorTermVolatilityStructure'
        (ForeignPtr CCapFloorTermVolCurve'))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CapFloorTermVolCurve
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf
           CCapFloorTermVolatilityStructure'
           (ForeignPtr CCapFloorTermVolCurve')))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekCapFloorTermVolSurface :: Ptr CCapFloorTermVolSurface' -> IO CapFloorTermVolSurface
peekCapFloorTermVolSurface :: Ptr CCapFloorTermVolSurface' -> IO CapFloorTermVolSurface
peekCapFloorTermVolSurface = Ptr CCapFloorTermVolSurface'
-> IO
     (GenForeignPtr
        (ForeignPtr CCapFloorTermVolSurface')
        CCapFloorTermVolatilityStructure')
Ptr CCapFloorTermVolSurface'
-> IO
     (GenForeignPtr
        (ForeignPtr CCapFloorTermVolSurface')
        (Base CCapFloorTermVolSurface'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CCapFloorTermVolSurface'
 -> IO
      (GenForeignPtr
         (ForeignPtr CCapFloorTermVolSurface')
         CCapFloorTermVolatilityStructure'))
-> (GenForeignPtr
      (ForeignPtr CCapFloorTermVolSurface')
      CCapFloorTermVolatilityStructure'
    -> IO CapFloorTermVolSurface)
-> Ptr CCapFloorTermVolSurface'
-> IO CapFloorTermVolSurface
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CCapFloorTermVolSurface')
  CCapFloorTermVolatilityStructure'
-> IO CapFloorTermVolSurface
forall c.
GenForeignPtr c CCapFloorTermVolatilityStructure'
-> IO (GenCapFloorTermVolatilityStructure c)
newGenCapFloorTermVolatilityStructure
withCapFloorTermVolSurface :: CapFloorTermVolSurface -> (Ptr CCapFloorTermVolSurface' -> IO b) -> IO b
withCapFloorTermVolSurface :: forall b.
CapFloorTermVolSurface
-> (Ptr CCapFloorTermVolSurface' -> IO b) -> IO b
withCapFloorTermVolSurface = ForeignPtr CCapFloorTermVolSurface'
-> (Ptr CCapFloorTermVolSurface' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CCapFloorTermVolSurface'
 -> (Ptr CCapFloorTermVolSurface' -> IO b) -> IO b)
-> (CapFloorTermVolSurface -> ForeignPtr CCapFloorTermVolSurface')
-> CapFloorTermVolSurface
-> (Ptr CCapFloorTermVolSurface' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CCapFloorTermVolSurface')
  CCapFloorTermVolatilityStructure'
-> ForeignPtr CCapFloorTermVolSurface'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CCapFloorTermVolSurface')
   CCapFloorTermVolatilityStructure'
 -> ForeignPtr CCapFloorTermVolSurface')
-> (CapFloorTermVolSurface
    -> GenForeignPtr
         (ForeignPtr CCapFloorTermVolSurface')
         CCapFloorTermVolatilityStructure')
-> CapFloorTermVolSurface
-> ForeignPtr CCapFloorTermVolSurface'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCapFloorTermVolatilityStructure'
     (ForeignPtr CCapFloorTermVolSurface'))
  CVolatilityTermStructure'
-> GenForeignPtr
     (ForeignPtr CCapFloorTermVolSurface')
     CCapFloorTermVolatilityStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCapFloorTermVolatilityStructure'
      (ForeignPtr CCapFloorTermVolSurface'))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (ForeignPtr CCapFloorTermVolSurface')
      CCapFloorTermVolatilityStructure')
-> (CapFloorTermVolSurface
    -> GenForeignPtr
         (AnyOf
            CCapFloorTermVolatilityStructure'
            (ForeignPtr CCapFloorTermVolSurface'))
         CVolatilityTermStructure')
-> CapFloorTermVolSurface
-> GenForeignPtr
     (ForeignPtr CCapFloorTermVolSurface')
     CCapFloorTermVolatilityStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf
        CCapFloorTermVolatilityStructure'
        (ForeignPtr CCapFloorTermVolSurface')))
  CTermStructure'
-> GenForeignPtr
     (AnyOf
        CCapFloorTermVolatilityStructure'
        (ForeignPtr CCapFloorTermVolSurface'))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf
         CCapFloorTermVolatilityStructure'
         (ForeignPtr CCapFloorTermVolSurface')))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf
         CCapFloorTermVolatilityStructure'
         (ForeignPtr CCapFloorTermVolSurface'))
      CVolatilityTermStructure')
-> (CapFloorTermVolSurface
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf
               CCapFloorTermVolatilityStructure'
               (ForeignPtr CCapFloorTermVolSurface')))
         CTermStructure')
-> CapFloorTermVolSurface
-> GenForeignPtr
     (AnyOf
        CCapFloorTermVolatilityStructure'
        (ForeignPtr CCapFloorTermVolSurface'))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CapFloorTermVolSurface
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf
           CCapFloorTermVolatilityStructure'
           (ForeignPtr CCapFloorTermVolSurface')))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekBlackAtmVolCurve :: Ptr CBlackAtmVolCurve' -> IO BlackAtmVolCurve
peekBlackAtmVolCurve :: Ptr CBlackAtmVolCurve' -> IO BlackAtmVolCurve
peekBlackAtmVolCurve = Ptr CBlackAtmVolCurve'
-> IO
     (GenForeignPtr (ForeignPtr CBlackAtmVolCurve') CBlackAtmVolCurve')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CBlackAtmVolCurve'
 -> IO
      (GenForeignPtr (ForeignPtr CBlackAtmVolCurve') CBlackAtmVolCurve'))
-> (GenForeignPtr
      (ForeignPtr CBlackAtmVolCurve') CBlackAtmVolCurve'
    -> IO BlackAtmVolCurve)
-> Ptr CBlackAtmVolCurve'
-> IO BlackAtmVolCurve
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CBlackAtmVolCurve') CBlackAtmVolCurve'
-> IO BlackAtmVolCurve
forall b.
GenForeignPtr b CBlackAtmVolCurve' -> IO (GenBlackAtmVolCurve b)
newGenBlackAtmVolCurve
withGenBlackAtmVolCurve :: GenBlackAtmVolCurve b -> (Ptr CBlackAtmVolCurve' -> IO r) -> IO r
withGenBlackAtmVolCurve :: forall b r.
GenBlackAtmVolCurve b -> (Ptr CBlackAtmVolCurve' -> IO r) -> IO r
withGenBlackAtmVolCurve = GenForeignPtr b CBlackAtmVolCurve'
-> (Ptr CBlackAtmVolCurve' -> IO r) -> IO r
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr b CBlackAtmVolCurve'
 -> (Ptr CBlackAtmVolCurve' -> IO r) -> IO r)
-> (GenBlackAtmVolCurve b -> GenForeignPtr b CBlackAtmVolCurve')
-> GenBlackAtmVolCurve b
-> (Ptr CBlackAtmVolCurve' -> IO r)
-> IO r
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackAtmVolCurve' b) CVolatilityTermStructure'
-> GenForeignPtr b CBlackAtmVolCurve'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBlackAtmVolCurve' b) CVolatilityTermStructure'
 -> GenForeignPtr b CBlackAtmVolCurve')
-> (GenBlackAtmVolCurve b
    -> GenForeignPtr
         (AnyOf CBlackAtmVolCurve' b) CVolatilityTermStructure')
-> GenBlackAtmVolCurve b
-> GenForeignPtr b CBlackAtmVolCurve'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CVolatilityTermStructure' (AnyOf CBlackAtmVolCurve' b))
  CTermStructure'
-> GenForeignPtr
     (AnyOf CBlackAtmVolCurve' b) CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CVolatilityTermStructure' (AnyOf CBlackAtmVolCurve' b))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf CBlackAtmVolCurve' b) CVolatilityTermStructure')
-> (GenBlackAtmVolCurve b
    -> GenForeignPtr
         (AnyOf CVolatilityTermStructure' (AnyOf CBlackAtmVolCurve' b))
         CTermStructure')
-> GenBlackAtmVolCurve b
-> GenForeignPtr
     (AnyOf CBlackAtmVolCurve' b) CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBlackAtmVolCurve b
-> GenForeignPtr
     (AnyOf CVolatilityTermStructure' (AnyOf CBlackAtmVolCurve' b))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
newGenBlackAtmVolCurve :: GenForeignPtr b CBlackAtmVolCurve' -> IO (GenBlackAtmVolCurve b)
newGenBlackAtmVolCurve :: forall b.
GenForeignPtr b CBlackAtmVolCurve' -> IO (GenBlackAtmVolCurve b)
newGenBlackAtmVolCurve = GenBlackAtmVolCurve b -> IO (GenBlackAtmVolCurve b)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenBlackAtmVolCurve b -> IO (GenBlackAtmVolCurve b))
-> (GenForeignPtr b CBlackAtmVolCurve' -> GenBlackAtmVolCurve b)
-> GenForeignPtr b CBlackAtmVolCurve'
-> IO (GenBlackAtmVolCurve b)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CVolatilityTermStructure' (AnyOf CBlackAtmVolCurve' b))
  CTermStructure'
-> GenBlackAtmVolCurve b
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr
   (AnyOf CVolatilityTermStructure' (AnyOf CBlackAtmVolCurve' b))
   CTermStructure'
 -> GenBlackAtmVolCurve b)
-> (GenForeignPtr b CBlackAtmVolCurve'
    -> GenForeignPtr
         (AnyOf CVolatilityTermStructure' (AnyOf CBlackAtmVolCurve' b))
         CTermStructure')
-> GenForeignPtr b CBlackAtmVolCurve'
-> GenBlackAtmVolCurve b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackAtmVolCurve' b) CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf CVolatilityTermStructure' (AnyOf CBlackAtmVolCurve' b))
     CTermStructure'
GenForeignPtr
  (AnyOf CBlackAtmVolCurve' b) CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf CVolatilityTermStructure' (AnyOf CBlackAtmVolCurve' b))
     (Base CVolatilityTermStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr
   (AnyOf CBlackAtmVolCurve' b) CVolatilityTermStructure'
 -> GenForeignPtr
      (AnyOf CVolatilityTermStructure' (AnyOf CBlackAtmVolCurve' b))
      CTermStructure')
-> (GenForeignPtr b CBlackAtmVolCurve'
    -> GenForeignPtr
         (AnyOf CBlackAtmVolCurve' b) CVolatilityTermStructure')
-> GenForeignPtr b CBlackAtmVolCurve'
-> GenForeignPtr
     (AnyOf CVolatilityTermStructure' (AnyOf CBlackAtmVolCurve' b))
     CTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr b CBlackAtmVolCurve'
-> GenForeignPtr
     (AnyOf CBlackAtmVolCurve' b) CVolatilityTermStructure'
GenForeignPtr b CBlackAtmVolCurve'
-> GenForeignPtr
     (AnyOf CBlackAtmVolCurve' b) (Base CBlackAtmVolCurve')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekAbcdAtmVolCurve :: Ptr CAbcdAtmVolCurve' -> IO AbcdAtmVolCurve
peekAbcdAtmVolCurve :: Ptr CAbcdAtmVolCurve' -> IO AbcdAtmVolCurve
peekAbcdAtmVolCurve = Ptr CAbcdAtmVolCurve'
-> IO
     (GenForeignPtr (ForeignPtr CAbcdAtmVolCurve') CBlackAtmVolCurve')
Ptr CAbcdAtmVolCurve'
-> IO
     (GenForeignPtr
        (ForeignPtr CAbcdAtmVolCurve') (Base CAbcdAtmVolCurve'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CAbcdAtmVolCurve'
 -> IO
      (GenForeignPtr (ForeignPtr CAbcdAtmVolCurve') CBlackAtmVolCurve'))
-> (GenForeignPtr (ForeignPtr CAbcdAtmVolCurve') CBlackAtmVolCurve'
    -> IO AbcdAtmVolCurve)
-> Ptr CAbcdAtmVolCurve'
-> IO AbcdAtmVolCurve
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CAbcdAtmVolCurve') CBlackAtmVolCurve'
-> IO AbcdAtmVolCurve
forall b.
GenForeignPtr b CBlackAtmVolCurve' -> IO (GenBlackAtmVolCurve b)
newGenBlackAtmVolCurve
withAbcdAtmVolCurve :: AbcdAtmVolCurve -> (Ptr CAbcdAtmVolCurve' -> IO b) -> IO b
withAbcdAtmVolCurve :: forall b.
AbcdAtmVolCurve -> (Ptr CAbcdAtmVolCurve' -> IO b) -> IO b
withAbcdAtmVolCurve = ForeignPtr CAbcdAtmVolCurve'
-> (Ptr CAbcdAtmVolCurve' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CAbcdAtmVolCurve'
 -> (Ptr CAbcdAtmVolCurve' -> IO b) -> IO b)
-> (AbcdAtmVolCurve -> ForeignPtr CAbcdAtmVolCurve')
-> AbcdAtmVolCurve
-> (Ptr CAbcdAtmVolCurve' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CAbcdAtmVolCurve') CBlackAtmVolCurve'
-> ForeignPtr CAbcdAtmVolCurve'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CAbcdAtmVolCurve') CBlackAtmVolCurve'
 -> ForeignPtr CAbcdAtmVolCurve')
-> (AbcdAtmVolCurve
    -> GenForeignPtr (ForeignPtr CAbcdAtmVolCurve') CBlackAtmVolCurve')
-> AbcdAtmVolCurve
-> ForeignPtr CAbcdAtmVolCurve'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackAtmVolCurve' (ForeignPtr CAbcdAtmVolCurve'))
  CVolatilityTermStructure'
-> GenForeignPtr (ForeignPtr CAbcdAtmVolCurve') CBlackAtmVolCurve'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBlackAtmVolCurve' (ForeignPtr CAbcdAtmVolCurve'))
   CVolatilityTermStructure'
 -> GenForeignPtr (ForeignPtr CAbcdAtmVolCurve') CBlackAtmVolCurve')
-> (AbcdAtmVolCurve
    -> GenForeignPtr
         (AnyOf CBlackAtmVolCurve' (ForeignPtr CAbcdAtmVolCurve'))
         CVolatilityTermStructure')
-> AbcdAtmVolCurve
-> GenForeignPtr (ForeignPtr CAbcdAtmVolCurve') CBlackAtmVolCurve'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf CBlackAtmVolCurve' (ForeignPtr CAbcdAtmVolCurve')))
  CTermStructure'
-> GenForeignPtr
     (AnyOf CBlackAtmVolCurve' (ForeignPtr CAbcdAtmVolCurve'))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf CBlackAtmVolCurve' (ForeignPtr CAbcdAtmVolCurve')))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf CBlackAtmVolCurve' (ForeignPtr CAbcdAtmVolCurve'))
      CVolatilityTermStructure')
-> (AbcdAtmVolCurve
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf CBlackAtmVolCurve' (ForeignPtr CAbcdAtmVolCurve')))
         CTermStructure')
-> AbcdAtmVolCurve
-> GenForeignPtr
     (AnyOf CBlackAtmVolCurve' (ForeignPtr CAbcdAtmVolCurve'))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbcdAtmVolCurve
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf CBlackAtmVolCurve' (ForeignPtr CAbcdAtmVolCurve')))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
withGenBlackVolSurface :: GenBlackVolSurface b -> (Ptr CBlackVolSurface' -> IO r) -> IO r
withGenBlackVolSurface :: forall b r.
GenBlackVolSurface b -> (Ptr CBlackVolSurface' -> IO r) -> IO r
withGenBlackVolSurface = GenForeignPtr b CBlackVolSurface'
-> (Ptr CBlackVolSurface' -> IO r) -> IO r
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr b CBlackVolSurface'
 -> (Ptr CBlackVolSurface' -> IO r) -> IO r)
-> (GenBlackVolSurface b -> GenForeignPtr b CBlackVolSurface')
-> GenBlackVolSurface b
-> (Ptr CBlackVolSurface' -> IO r)
-> IO r
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CBlackVolSurface' b) CBlackAtmVolCurve'
-> GenForeignPtr b CBlackVolSurface'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CBlackVolSurface' b) CBlackAtmVolCurve'
 -> GenForeignPtr b CBlackVolSurface')
-> (GenBlackVolSurface b
    -> GenForeignPtr (AnyOf CBlackVolSurface' b) CBlackAtmVolCurve')
-> GenBlackVolSurface b
-> GenForeignPtr b CBlackVolSurface'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b))
  CVolatilityTermStructure'
-> GenForeignPtr (AnyOf CBlackVolSurface' b) CBlackAtmVolCurve'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b))
   CVolatilityTermStructure'
 -> GenForeignPtr (AnyOf CBlackVolSurface' b) CBlackAtmVolCurve')
-> (GenBlackVolSurface b
    -> GenForeignPtr
         (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b))
         CVolatilityTermStructure')
-> GenBlackVolSurface b
-> GenForeignPtr (AnyOf CBlackVolSurface' b) CBlackAtmVolCurve'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b)))
  CTermStructure'
-> GenForeignPtr
     (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b)))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b))
      CVolatilityTermStructure')
-> (GenBlackVolSurface b
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b)))
         CTermStructure')
-> GenBlackVolSurface b
-> GenForeignPtr
     (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBlackVolSurface b
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b)))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
newGenBlackVolSurface :: GenForeignPtr b CBlackVolSurface' -> IO (GenBlackVolSurface b)
newGenBlackVolSurface :: forall b.
GenForeignPtr b CBlackVolSurface' -> IO (GenBlackVolSurface b)
newGenBlackVolSurface = GenBlackVolSurface b -> IO (GenBlackVolSurface b)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenBlackVolSurface b -> IO (GenBlackVolSurface b))
-> (GenForeignPtr b CBlackVolSurface' -> GenBlackVolSurface b)
-> GenForeignPtr b CBlackVolSurface'
-> IO (GenBlackVolSurface b)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b)))
  CTermStructure'
-> GenBlackVolSurface b
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b)))
   CTermStructure'
 -> GenBlackVolSurface b)
-> (GenForeignPtr b CBlackVolSurface'
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b)))
         CTermStructure')
-> GenForeignPtr b CBlackVolSurface'
-> GenBlackVolSurface b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b))
  CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b)))
     CTermStructure'
GenForeignPtr
  (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b))
  CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b)))
     (Base CVolatilityTermStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr
   (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (AnyOf
         CVolatilityTermStructure'
         (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b)))
      CTermStructure')
-> (GenForeignPtr b CBlackVolSurface'
    -> GenForeignPtr
         (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b))
         CVolatilityTermStructure')
-> GenForeignPtr b CBlackVolSurface'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b)))
     CTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CBlackVolSurface' b) CBlackAtmVolCurve'
-> GenForeignPtr
     (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b))
     CVolatilityTermStructure'
GenForeignPtr (AnyOf CBlackVolSurface' b) CBlackAtmVolCurve'
-> GenForeignPtr
     (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b))
     (Base CBlackAtmVolCurve')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CBlackVolSurface' b) CBlackAtmVolCurve'
 -> GenForeignPtr
      (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b))
      CVolatilityTermStructure')
-> (GenForeignPtr b CBlackVolSurface'
    -> GenForeignPtr (AnyOf CBlackVolSurface' b) CBlackAtmVolCurve')
-> GenForeignPtr b CBlackVolSurface'
-> GenForeignPtr
     (AnyOf CBlackAtmVolCurve' (AnyOf CBlackVolSurface' b))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr b CBlackVolSurface'
-> GenForeignPtr (AnyOf CBlackVolSurface' b) CBlackAtmVolCurve'
GenForeignPtr b CBlackVolSurface'
-> GenForeignPtr
     (AnyOf CBlackVolSurface' b) (Base CBlackVolSurface')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekSabrVolSurface :: Ptr CSabrVolSurface' -> IO SabrVolSurface
peekSabrVolSurface :: Ptr CSabrVolSurface' -> IO SabrVolSurface
peekSabrVolSurface = Ptr CSabrVolSurface'
-> IO
     (GenForeignPtr (ForeignPtr CSabrVolSurface') CBlackVolSurface')
Ptr CSabrVolSurface'
-> IO
     (GenForeignPtr
        (ForeignPtr CSabrVolSurface') (Base CSabrVolSurface'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CSabrVolSurface'
 -> IO
      (GenForeignPtr (ForeignPtr CSabrVolSurface') CBlackVolSurface'))
-> (GenForeignPtr (ForeignPtr CSabrVolSurface') CBlackVolSurface'
    -> IO SabrVolSurface)
-> Ptr CSabrVolSurface'
-> IO SabrVolSurface
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CSabrVolSurface') CBlackVolSurface'
-> IO SabrVolSurface
forall b.
GenForeignPtr b CBlackVolSurface' -> IO (GenBlackVolSurface b)
newGenBlackVolSurface
withSabrVolSurface :: SabrVolSurface -> (Ptr CSabrVolSurface' -> IO b) -> IO b
withSabrVolSurface :: forall b. SabrVolSurface -> (Ptr CSabrVolSurface' -> IO b) -> IO b
withSabrVolSurface = ForeignPtr CSabrVolSurface'
-> (Ptr CSabrVolSurface' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CSabrVolSurface'
 -> (Ptr CSabrVolSurface' -> IO b) -> IO b)
-> (SabrVolSurface -> ForeignPtr CSabrVolSurface')
-> SabrVolSurface
-> (Ptr CSabrVolSurface' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CSabrVolSurface') CBlackVolSurface'
-> ForeignPtr CSabrVolSurface'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CSabrVolSurface') CBlackVolSurface'
 -> ForeignPtr CSabrVolSurface')
-> (SabrVolSurface
    -> GenForeignPtr (ForeignPtr CSabrVolSurface') CBlackVolSurface')
-> SabrVolSurface
-> ForeignPtr CSabrVolSurface'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface'))
  CBlackAtmVolCurve'
-> GenForeignPtr (ForeignPtr CSabrVolSurface') CBlackVolSurface'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface'))
   CBlackAtmVolCurve'
 -> GenForeignPtr (ForeignPtr CSabrVolSurface') CBlackVolSurface')
-> (SabrVolSurface
    -> GenForeignPtr
         (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface'))
         CBlackAtmVolCurve')
-> SabrVolSurface
-> GenForeignPtr (ForeignPtr CSabrVolSurface') CBlackVolSurface'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CBlackAtmVolCurve'
     (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface')))
  CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface'))
     CBlackAtmVolCurve'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CBlackAtmVolCurve'
      (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface')))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface'))
      CBlackAtmVolCurve')
-> (SabrVolSurface
    -> GenForeignPtr
         (AnyOf
            CBlackAtmVolCurve'
            (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface')))
         CVolatilityTermStructure')
-> SabrVolSurface
-> GenForeignPtr
     (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface'))
     CBlackAtmVolCurve'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf
        CBlackAtmVolCurve'
        (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface'))))
  CTermStructure'
-> GenForeignPtr
     (AnyOf
        CBlackAtmVolCurve'
        (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface')))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf
         CBlackAtmVolCurve'
         (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface'))))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf
         CBlackAtmVolCurve'
         (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface')))
      CVolatilityTermStructure')
-> (SabrVolSurface
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf
               CBlackAtmVolCurve'
               (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface'))))
         CTermStructure')
-> SabrVolSurface
-> GenForeignPtr
     (AnyOf
        CBlackAtmVolCurve'
        (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface')))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SabrVolSurface
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf
           CBlackAtmVolCurve'
           (AnyOf CBlackVolSurface' (ForeignPtr CSabrVolSurface'))))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekLocalVolTermStructure :: Ptr CLocalVolTermStructure' -> IO LocalVolTermStructure
peekLocalVolTermStructure :: Ptr CLocalVolTermStructure' -> IO LocalVolTermStructure
peekLocalVolTermStructure = Ptr CLocalVolTermStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CLocalVolTermStructure') CLocalVolTermStructure')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CLocalVolTermStructure'
 -> IO
      (GenForeignPtr
         (ForeignPtr CLocalVolTermStructure') CLocalVolTermStructure'))
-> (GenForeignPtr
      (ForeignPtr CLocalVolTermStructure') CLocalVolTermStructure'
    -> IO LocalVolTermStructure)
-> Ptr CLocalVolTermStructure'
-> IO LocalVolTermStructure
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CLocalVolTermStructure') CLocalVolTermStructure'
-> IO LocalVolTermStructure
forall lv.
GenForeignPtr lv CLocalVolTermStructure'
-> IO (GenLocalVolTermStructure lv)
newGenLocalVolTermStructure
withGenLocalVolTermStructure :: GenLocalVolTermStructure lv -> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
withGenLocalVolTermStructure :: forall lv b.
GenLocalVolTermStructure lv
-> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
withGenLocalVolTermStructure = GenForeignPtr lv CLocalVolTermStructure'
-> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr lv CLocalVolTermStructure'
 -> (Ptr CLocalVolTermStructure' -> IO b) -> IO b)
-> (GenLocalVolTermStructure lv
    -> GenForeignPtr lv CLocalVolTermStructure')
-> GenLocalVolTermStructure lv
-> (Ptr CLocalVolTermStructure' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CLocalVolTermStructure' lv) CVolatilityTermStructure'
-> GenForeignPtr lv CLocalVolTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CLocalVolTermStructure' lv) CVolatilityTermStructure'
 -> GenForeignPtr lv CLocalVolTermStructure')
-> (GenLocalVolTermStructure lv
    -> GenForeignPtr
         (AnyOf CLocalVolTermStructure' lv) CVolatilityTermStructure')
-> GenLocalVolTermStructure lv
-> GenForeignPtr lv CLocalVolTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure' (AnyOf CLocalVolTermStructure' lv))
  CTermStructure'
-> GenForeignPtr
     (AnyOf CLocalVolTermStructure' lv) CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure' (AnyOf CLocalVolTermStructure' lv))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf CLocalVolTermStructure' lv) CVolatilityTermStructure')
-> (GenLocalVolTermStructure lv
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure' (AnyOf CLocalVolTermStructure' lv))
         CTermStructure')
-> GenLocalVolTermStructure lv
-> GenForeignPtr
     (AnyOf CLocalVolTermStructure' lv) CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenLocalVolTermStructure lv
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure' (AnyOf CLocalVolTermStructure' lv))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
newGenLocalVolTermStructure :: GenForeignPtr lv CLocalVolTermStructure' -> IO (GenLocalVolTermStructure lv)
newGenLocalVolTermStructure :: forall lv.
GenForeignPtr lv CLocalVolTermStructure'
-> IO (GenLocalVolTermStructure lv)
newGenLocalVolTermStructure = GenLocalVolTermStructure lv -> IO (GenLocalVolTermStructure lv)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenLocalVolTermStructure lv -> IO (GenLocalVolTermStructure lv))
-> (GenForeignPtr lv CLocalVolTermStructure'
    -> GenLocalVolTermStructure lv)
-> GenForeignPtr lv CLocalVolTermStructure'
-> IO (GenLocalVolTermStructure lv)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure' (AnyOf CLocalVolTermStructure' lv))
  CTermStructure'
-> GenLocalVolTermStructure lv
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure' (AnyOf CLocalVolTermStructure' lv))
   CTermStructure'
 -> GenLocalVolTermStructure lv)
-> (GenForeignPtr lv CLocalVolTermStructure'
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure' (AnyOf CLocalVolTermStructure' lv))
         CTermStructure')
-> GenForeignPtr lv CLocalVolTermStructure'
-> GenLocalVolTermStructure lv
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CLocalVolTermStructure' lv) CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure' (AnyOf CLocalVolTermStructure' lv))
     CTermStructure'
GenForeignPtr
  (AnyOf CLocalVolTermStructure' lv) CVolatilityTermStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure' (AnyOf CLocalVolTermStructure' lv))
     (Base CVolatilityTermStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr
   (AnyOf CLocalVolTermStructure' lv) CVolatilityTermStructure'
 -> GenForeignPtr
      (AnyOf
         CVolatilityTermStructure' (AnyOf CLocalVolTermStructure' lv))
      CTermStructure')
-> (GenForeignPtr lv CLocalVolTermStructure'
    -> GenForeignPtr
         (AnyOf CLocalVolTermStructure' lv) CVolatilityTermStructure')
-> GenForeignPtr lv CLocalVolTermStructure'
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure' (AnyOf CLocalVolTermStructure' lv))
     CTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr lv CLocalVolTermStructure'
-> GenForeignPtr
     (AnyOf CLocalVolTermStructure' lv) CVolatilityTermStructure'
GenForeignPtr lv CLocalVolTermStructure'
-> GenForeignPtr
     (AnyOf CLocalVolTermStructure' lv) (Base CLocalVolTermStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekGridModelLocalVolSurface :: Ptr CGridModelLocalVolSurface' -> IO GridModelLocalVolSurface
peekGridModelLocalVolSurface :: Ptr CGridModelLocalVolSurface' -> IO GridModelLocalVolSurface
peekGridModelLocalVolSurface = Ptr CGridModelLocalVolSurface'
-> IO
     (GenForeignPtr
        (ForeignPtr CGridModelLocalVolSurface') CLocalVolTermStructure')
Ptr CGridModelLocalVolSurface'
-> IO
     (GenForeignPtr
        (ForeignPtr CGridModelLocalVolSurface')
        (Base CGridModelLocalVolSurface'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CGridModelLocalVolSurface'
 -> IO
      (GenForeignPtr
         (ForeignPtr CGridModelLocalVolSurface') CLocalVolTermStructure'))
-> (GenForeignPtr
      (ForeignPtr CGridModelLocalVolSurface') CLocalVolTermStructure'
    -> IO GridModelLocalVolSurface)
-> Ptr CGridModelLocalVolSurface'
-> IO GridModelLocalVolSurface
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CGridModelLocalVolSurface') CLocalVolTermStructure'
-> IO GridModelLocalVolSurface
forall lv.
GenForeignPtr lv CLocalVolTermStructure'
-> IO (GenLocalVolTermStructure lv)
newGenLocalVolTermStructure
withGridModelLocalVolSurface :: GridModelLocalVolSurface -> (Ptr CGridModelLocalVolSurface' -> IO b) -> IO b
withGridModelLocalVolSurface :: forall b.
GridModelLocalVolSurface
-> (Ptr CGridModelLocalVolSurface' -> IO b) -> IO b
withGridModelLocalVolSurface = ForeignPtr CGridModelLocalVolSurface'
-> (Ptr CGridModelLocalVolSurface' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CGridModelLocalVolSurface'
 -> (Ptr CGridModelLocalVolSurface' -> IO b) -> IO b)
-> (GridModelLocalVolSurface
    -> ForeignPtr CGridModelLocalVolSurface')
-> GridModelLocalVolSurface
-> (Ptr CGridModelLocalVolSurface' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CGridModelLocalVolSurface') CLocalVolTermStructure'
-> ForeignPtr CGridModelLocalVolSurface'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CGridModelLocalVolSurface') CLocalVolTermStructure'
 -> ForeignPtr CGridModelLocalVolSurface')
-> (GridModelLocalVolSurface
    -> GenForeignPtr
         (ForeignPtr CGridModelLocalVolSurface') CLocalVolTermStructure')
-> GridModelLocalVolSurface
-> ForeignPtr CGridModelLocalVolSurface'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CLocalVolTermStructure' (ForeignPtr CGridModelLocalVolSurface'))
  CVolatilityTermStructure'
-> GenForeignPtr
     (ForeignPtr CGridModelLocalVolSurface') CLocalVolTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CLocalVolTermStructure' (ForeignPtr CGridModelLocalVolSurface'))
   CVolatilityTermStructure'
 -> GenForeignPtr
      (ForeignPtr CGridModelLocalVolSurface') CLocalVolTermStructure')
-> (GridModelLocalVolSurface
    -> GenForeignPtr
         (AnyOf
            CLocalVolTermStructure' (ForeignPtr CGridModelLocalVolSurface'))
         CVolatilityTermStructure')
-> GridModelLocalVolSurface
-> GenForeignPtr
     (ForeignPtr CGridModelLocalVolSurface') CLocalVolTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CVolatilityTermStructure'
     (AnyOf
        CLocalVolTermStructure' (ForeignPtr CGridModelLocalVolSurface')))
  CTermStructure'
-> GenForeignPtr
     (AnyOf
        CLocalVolTermStructure' (ForeignPtr CGridModelLocalVolSurface'))
     CVolatilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CVolatilityTermStructure'
      (AnyOf
         CLocalVolTermStructure' (ForeignPtr CGridModelLocalVolSurface')))
   CTermStructure'
 -> GenForeignPtr
      (AnyOf
         CLocalVolTermStructure' (ForeignPtr CGridModelLocalVolSurface'))
      CVolatilityTermStructure')
-> (GridModelLocalVolSurface
    -> GenForeignPtr
         (AnyOf
            CVolatilityTermStructure'
            (AnyOf
               CLocalVolTermStructure' (ForeignPtr CGridModelLocalVolSurface')))
         CTermStructure')
-> GridModelLocalVolSurface
-> GenForeignPtr
     (AnyOf
        CLocalVolTermStructure' (ForeignPtr CGridModelLocalVolSurface'))
     CVolatilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GridModelLocalVolSurface
-> GenForeignPtr
     (AnyOf
        CVolatilityTermStructure'
        (AnyOf
           CLocalVolTermStructure' (ForeignPtr CGridModelLocalVolSurface')))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekAndreasenHugeVolatilityInterpl :: Ptr CAndreasenHugeVolatilityInterpl -> IO AndreasenHugeVolatilityInterpl
peekAndreasenHugeVolatilityInterpl :: Ptr CAndreasenHugeVolatilityInterpl
-> IO AndreasenHugeVolatilityInterpl
peekAndreasenHugeVolatilityInterpl = Ptr CAndreasenHugeVolatilityInterpl
-> IO AndreasenHugeVolatilityInterpl
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withAndreasenHugeVolatilityInterpl :: AndreasenHugeVolatilityInterpl -> (Ptr CAndreasenHugeVolatilityInterpl -> IO b) -> IO b
withAndreasenHugeVolatilityInterpl :: forall b.
AndreasenHugeVolatilityInterpl
-> (Ptr CAndreasenHugeVolatilityInterpl -> IO b) -> IO b
withAndreasenHugeVolatilityInterpl = AndreasenHugeVolatilityInterpl
-> (Ptr CAndreasenHugeVolatilityInterpl -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone
peekYoYOptionletVolatilityStructure :: Ptr CYoYOptionletVolatilitySurface' -> IO YoYOptionletVolatilitySurface
peekYoYOptionletVolatilityStructure :: Ptr CYoYOptionletVolatilitySurface'
-> IO YoYOptionletVolatilitySurface
peekYoYOptionletVolatilityStructure = Ptr CYoYOptionletVolatilitySurface'
-> IO YoYOptionletVolatilitySurface
forall v.
(Finalizable v, Upcastable v,
 Base v ~ CVolatilityTermStructure') =>
Ptr v -> IO (GenVolatilityTermStructure (ForeignPtr v))
peekGenVolatilityTermStructure
peekCPIVolatilitySurface :: Ptr CCPIVolatilitySurface' -> IO CPIVolatilitySurface
peekCPIVolatilitySurface :: Ptr CCPIVolatilitySurface' -> IO CPIVolatilitySurface
peekCPIVolatilitySurface = Ptr CCPIVolatilitySurface' -> IO CPIVolatilitySurface
forall v.
(Finalizable v, Upcastable v,
 Base v ~ CVolatilityTermStructure') =>
Ptr v -> IO (GenVolatilityTermStructure (ForeignPtr v))
peekGenVolatilityTermStructure
withLocalVolTermStructure :: LocalVolTermStructure -> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
withLocalVolTermStructure :: forall b.
LocalVolTermStructure
-> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
withLocalVolTermStructure = LocalVolTermStructure
-> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
forall lv b.
GenLocalVolTermStructure lv
-> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
withGenLocalVolTermStructure
withMaybeLocalVolTermStructure :: Maybe (GenLocalVolTermStructure lv) -> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
withMaybeLocalVolTermStructure :: forall lv b.
Maybe (GenLocalVolTermStructure lv)
-> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
withMaybeLocalVolTermStructure Maybe (GenLocalVolTermStructure lv)
x Ptr CLocalVolTermStructure' -> IO b
f = IO b
-> (GenLocalVolTermStructure lv -> IO b)
-> Maybe (GenLocalVolTermStructure lv)
-> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Ptr CLocalVolTermStructure' -> IO b
f Ptr CLocalVolTermStructure'
forall a. Ptr a
nullPtr) (GenLocalVolTermStructure lv
-> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
forall lv b.
GenLocalVolTermStructure lv
-> (Ptr CLocalVolTermStructure' -> IO b) -> IO b
`withGenLocalVolTermStructure` Ptr CLocalVolTermStructure' -> IO b
f) Maybe (GenLocalVolTermStructure lv)
x
peekCallableBondVolatilityStructure :: Ptr CCallableBondVolatilityStructure' -> IO CallableBondVolatilityStructure
peekCallableBondVolatilityStructure :: Ptr CCallableBondVolatilityStructure'
-> IO CallableBondVolatilityStructure
peekCallableBondVolatilityStructure = GenForeignPtr CCallableBondVolatilityStructure CTermStructure'
-> CallableBondVolatilityStructure
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr CCallableBondVolatilityStructure CTermStructure'
 -> CallableBondVolatilityStructure)
-> (Ptr CCallableBondVolatilityStructure'
    -> IO
         (GenForeignPtr CCallableBondVolatilityStructure CTermStructure'))
-> Ptr CCallableBondVolatilityStructure'
-> IO CallableBondVolatilityStructure
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCallableBondVolatilityStructure'
-> IO
     (GenForeignPtr CCallableBondVolatilityStructure CTermStructure')
Ptr CCallableBondVolatilityStructure'
-> IO
     (GenForeignPtr
        CCallableBondVolatilityStructure
        (Base CCallableBondVolatilityStructure'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
asDefaultProbabilityTermStructure :: GenDefaultProbabilityTermStructure d -> IO DefaultProbabilityTermStructure
asDefaultProbabilityTermStructure :: forall d.
GenDefaultProbabilityTermStructure d
-> IO DefaultProbabilityTermStructure
asDefaultProbabilityTermStructure = (Ptr CDefaultProbabilityTermStructure'
 -> IO DefaultProbabilityTermStructure)
-> GenForeignPtr d CDefaultProbabilityTermStructure'
-> IO DefaultProbabilityTermStructure
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CDefaultProbabilityTermStructure'
-> IO DefaultProbabilityTermStructure
peekDefaultProbabilityTermStructure (GenForeignPtr d CDefaultProbabilityTermStructure'
 -> IO DefaultProbabilityTermStructure)
-> (GenDefaultProbabilityTermStructure d
    -> GenForeignPtr d CDefaultProbabilityTermStructure')
-> GenDefaultProbabilityTermStructure d
-> IO DefaultProbabilityTermStructure
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CDefaultProbabilityTermStructure' d) CTermStructure'
-> GenForeignPtr d CDefaultProbabilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CDefaultProbabilityTermStructure' d) CTermStructure'
 -> GenForeignPtr d CDefaultProbabilityTermStructure')
-> (GenDefaultProbabilityTermStructure d
    -> GenForeignPtr
         (AnyOf CDefaultProbabilityTermStructure' d) CTermStructure')
-> GenDefaultProbabilityTermStructure d
-> GenForeignPtr d CDefaultProbabilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenDefaultProbabilityTermStructure d
-> GenForeignPtr
     (AnyOf CDefaultProbabilityTermStructure' d) CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekDefaultProbabilityTermStructure :: Ptr CDefaultProbabilityTermStructure' -> IO DefaultProbabilityTermStructure
peekDefaultProbabilityTermStructure :: Ptr CDefaultProbabilityTermStructure'
-> IO DefaultProbabilityTermStructure
peekDefaultProbabilityTermStructure = Ptr CDefaultProbabilityTermStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CDefaultProbabilityTermStructure')
        CDefaultProbabilityTermStructure')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CDefaultProbabilityTermStructure'
 -> IO
      (GenForeignPtr
         (ForeignPtr CDefaultProbabilityTermStructure')
         CDefaultProbabilityTermStructure'))
-> (GenForeignPtr
      (ForeignPtr CDefaultProbabilityTermStructure')
      CDefaultProbabilityTermStructure'
    -> IO DefaultProbabilityTermStructure)
-> Ptr CDefaultProbabilityTermStructure'
-> IO DefaultProbabilityTermStructure
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CDefaultProbabilityTermStructure')
  CDefaultProbabilityTermStructure'
-> IO DefaultProbabilityTermStructure
forall d.
GenForeignPtr d CDefaultProbabilityTermStructure'
-> IO (GenDefaultProbabilityTermStructure d)
newGenDefaultProbabilityTermStructure
withDefaultProbabilityTermStructure :: GenDefaultProbabilityTermStructure d -> (Ptr CDefaultProbabilityTermStructure' -> IO b) -> IO b
withDefaultProbabilityTermStructure :: forall d b.
GenDefaultProbabilityTermStructure d
-> (Ptr CDefaultProbabilityTermStructure' -> IO b) -> IO b
withDefaultProbabilityTermStructure = GenForeignPtr d CDefaultProbabilityTermStructure'
-> (Ptr CDefaultProbabilityTermStructure' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr d CDefaultProbabilityTermStructure'
 -> (Ptr CDefaultProbabilityTermStructure' -> IO b) -> IO b)
-> (GenDefaultProbabilityTermStructure d
    -> GenForeignPtr d CDefaultProbabilityTermStructure')
-> GenDefaultProbabilityTermStructure d
-> (Ptr CDefaultProbabilityTermStructure' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CDefaultProbabilityTermStructure' d) CTermStructure'
-> GenForeignPtr d CDefaultProbabilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CDefaultProbabilityTermStructure' d) CTermStructure'
 -> GenForeignPtr d CDefaultProbabilityTermStructure')
-> (GenDefaultProbabilityTermStructure d
    -> GenForeignPtr
         (AnyOf CDefaultProbabilityTermStructure' d) CTermStructure')
-> GenDefaultProbabilityTermStructure d
-> GenForeignPtr d CDefaultProbabilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenDefaultProbabilityTermStructure d
-> GenForeignPtr
     (AnyOf CDefaultProbabilityTermStructure' d) CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
withMaybeDefaultProbabilityTermStructure :: Maybe (GenDefaultProbabilityTermStructure d) -> (Ptr CDefaultProbabilityTermStructure' -> IO b) -> IO b
withMaybeDefaultProbabilityTermStructure :: forall d b.
Maybe (GenDefaultProbabilityTermStructure d)
-> (Ptr CDefaultProbabilityTermStructure' -> IO b) -> IO b
withMaybeDefaultProbabilityTermStructure Maybe (GenDefaultProbabilityTermStructure d)
x Ptr CDefaultProbabilityTermStructure' -> IO b
f = IO b
-> (GenDefaultProbabilityTermStructure d -> IO b)
-> Maybe (GenDefaultProbabilityTermStructure d)
-> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Ptr CDefaultProbabilityTermStructure' -> IO b
f Ptr CDefaultProbabilityTermStructure'
forall a. Ptr a
nullPtr) (GenDefaultProbabilityTermStructure d
-> (Ptr CDefaultProbabilityTermStructure' -> IO b) -> IO b
forall d b.
GenDefaultProbabilityTermStructure d
-> (Ptr CDefaultProbabilityTermStructure' -> IO b) -> IO b
`withDefaultProbabilityTermStructure` Ptr CDefaultProbabilityTermStructure' -> IO b
f) Maybe (GenDefaultProbabilityTermStructure d)
x
newGenDefaultProbabilityTermStructure :: GenForeignPtr d CDefaultProbabilityTermStructure' -> IO (GenDefaultProbabilityTermStructure d)
newGenDefaultProbabilityTermStructure :: forall d.
GenForeignPtr d CDefaultProbabilityTermStructure'
-> IO (GenDefaultProbabilityTermStructure d)
newGenDefaultProbabilityTermStructure = GenDefaultProbabilityTermStructure d
-> IO (GenDefaultProbabilityTermStructure d)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenDefaultProbabilityTermStructure d
 -> IO (GenDefaultProbabilityTermStructure d))
-> (GenForeignPtr d CDefaultProbabilityTermStructure'
    -> GenDefaultProbabilityTermStructure d)
-> GenForeignPtr d CDefaultProbabilityTermStructure'
-> IO (GenDefaultProbabilityTermStructure d)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CDefaultProbabilityTermStructure' d) CTermStructure'
-> GenDefaultProbabilityTermStructure d
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr
   (AnyOf CDefaultProbabilityTermStructure' d) CTermStructure'
 -> GenDefaultProbabilityTermStructure d)
-> (GenForeignPtr d CDefaultProbabilityTermStructure'
    -> GenForeignPtr
         (AnyOf CDefaultProbabilityTermStructure' d) CTermStructure')
-> GenForeignPtr d CDefaultProbabilityTermStructure'
-> GenDefaultProbabilityTermStructure d
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr d CDefaultProbabilityTermStructure'
-> GenForeignPtr
     (AnyOf CDefaultProbabilityTermStructure' d) CTermStructure'
GenForeignPtr d CDefaultProbabilityTermStructure'
-> GenForeignPtr
     (AnyOf CDefaultProbabilityTermStructure' d)
     (Base CDefaultProbabilityTermStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekAffineHazardRateCurve :: Ptr CAffineHazardRateCurve' -> IO AffineHazardRateCurve
peekAffineHazardRateCurve :: Ptr CAffineHazardRateCurve' -> IO AffineHazardRateCurve
peekAffineHazardRateCurve = Ptr CAffineHazardRateCurve'
-> IO
     (GenForeignPtr
        (ForeignPtr CAffineHazardRateCurve')
        CDefaultProbabilityTermStructure')
Ptr CAffineHazardRateCurve'
-> IO
     (GenForeignPtr
        (ForeignPtr CAffineHazardRateCurve')
        (Base CAffineHazardRateCurve'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CAffineHazardRateCurve'
 -> IO
      (GenForeignPtr
         (ForeignPtr CAffineHazardRateCurve')
         CDefaultProbabilityTermStructure'))
-> (GenForeignPtr
      (ForeignPtr CAffineHazardRateCurve')
      CDefaultProbabilityTermStructure'
    -> IO AffineHazardRateCurve)
-> Ptr CAffineHazardRateCurve'
-> IO AffineHazardRateCurve
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CAffineHazardRateCurve')
  CDefaultProbabilityTermStructure'
-> IO AffineHazardRateCurve
forall d.
GenForeignPtr d CDefaultProbabilityTermStructure'
-> IO (GenDefaultProbabilityTermStructure d)
newGenDefaultProbabilityTermStructure
-- | Reach the concrete leaf itself, for 'QuantLib.TermStructure.Credit.conditionalSurvivalProbability'
-- (declared on the underlying @OneFactorAffineSurvivalStructure@, not the generic
-- @DefaultProbabilityTermStructure@ interface). Ordinary curve arguments go through
-- 'withDefaultProbabilityTermStructure' instead, which upcasts.
withAffineHazardRateCurve :: AffineHazardRateCurve -> (Ptr CAffineHazardRateCurve' -> IO b) -> IO b
withAffineHazardRateCurve :: forall b.
AffineHazardRateCurve
-> (Ptr CAffineHazardRateCurve' -> IO b) -> IO b
withAffineHazardRateCurve = ForeignPtr CAffineHazardRateCurve'
-> (Ptr CAffineHazardRateCurve' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CAffineHazardRateCurve'
 -> (Ptr CAffineHazardRateCurve' -> IO b) -> IO b)
-> (AffineHazardRateCurve -> ForeignPtr CAffineHazardRateCurve')
-> AffineHazardRateCurve
-> (Ptr CAffineHazardRateCurve' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CAffineHazardRateCurve')
  CDefaultProbabilityTermStructure'
-> ForeignPtr CAffineHazardRateCurve'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CAffineHazardRateCurve')
   CDefaultProbabilityTermStructure'
 -> ForeignPtr CAffineHazardRateCurve')
-> (AffineHazardRateCurve
    -> GenForeignPtr
         (ForeignPtr CAffineHazardRateCurve')
         CDefaultProbabilityTermStructure')
-> AffineHazardRateCurve
-> ForeignPtr CAffineHazardRateCurve'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CDefaultProbabilityTermStructure'
     (ForeignPtr CAffineHazardRateCurve'))
  CTermStructure'
-> GenForeignPtr
     (ForeignPtr CAffineHazardRateCurve')
     CDefaultProbabilityTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CDefaultProbabilityTermStructure'
      (ForeignPtr CAffineHazardRateCurve'))
   CTermStructure'
 -> GenForeignPtr
      (ForeignPtr CAffineHazardRateCurve')
      CDefaultProbabilityTermStructure')
-> (AffineHazardRateCurve
    -> GenForeignPtr
         (AnyOf
            CDefaultProbabilityTermStructure'
            (ForeignPtr CAffineHazardRateCurve'))
         CTermStructure')
-> AffineHazardRateCurve
-> GenForeignPtr
     (ForeignPtr CAffineHazardRateCurve')
     CDefaultProbabilityTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AffineHazardRateCurve
-> GenForeignPtr
     (AnyOf
        CDefaultProbabilityTermStructure'
        (ForeignPtr CAffineHazardRateCurve'))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekZeroInflationTermStructure :: Ptr CZeroInflationTermStructure' -> IO ZeroInflationTermStructure
peekZeroInflationTermStructure :: Ptr CZeroInflationTermStructure' -> IO ZeroInflationTermStructure
peekZeroInflationTermStructure = GenForeignPtr CZeroInflationTermStructure CTermStructure'
-> ZeroInflationTermStructure
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr CZeroInflationTermStructure CTermStructure'
 -> ZeroInflationTermStructure)
-> (Ptr CZeroInflationTermStructure'
    -> IO (GenForeignPtr CZeroInflationTermStructure CTermStructure'))
-> Ptr CZeroInflationTermStructure'
-> IO ZeroInflationTermStructure
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CZeroInflationTermStructure'
-> IO (GenForeignPtr CZeroInflationTermStructure CTermStructure')
Ptr CZeroInflationTermStructure'
-> IO
     (GenForeignPtr
        CZeroInflationTermStructure (Base CZeroInflationTermStructure'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
withMaybeZeroInflationTermStructure :: Maybe ZeroInflationTermStructure -> (Ptr CZeroInflationTermStructure' -> IO b) -> IO b
withMaybeZeroInflationTermStructure :: forall b.
Maybe ZeroInflationTermStructure
-> (Ptr CZeroInflationTermStructure' -> IO b) -> IO b
withMaybeZeroInflationTermStructure Maybe ZeroInflationTermStructure
x Ptr CZeroInflationTermStructure' -> IO b
f = IO b
-> (ZeroInflationTermStructure -> IO b)
-> Maybe ZeroInflationTermStructure
-> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Ptr CZeroInflationTermStructure' -> IO b
f Ptr CZeroInflationTermStructure'
forall a. Ptr a
nullPtr) (ZeroInflationTermStructure
-> (Ptr CZeroInflationTermStructure' -> IO b) -> IO b
forall t b.
GenTermStructure (ForeignPtr t) -> (Ptr t -> IO b) -> IO b
`withGenTermStructure` Ptr CZeroInflationTermStructure' -> IO b
f) Maybe ZeroInflationTermStructure
x
peekYoYInflationTermStructure :: Ptr CYoYInflationTermStructure' -> IO YoYInflationTermStructure
peekYoYInflationTermStructure :: Ptr CYoYInflationTermStructure' -> IO YoYInflationTermStructure
peekYoYInflationTermStructure = GenForeignPtr CYoYInflationTermStructure CTermStructure'
-> YoYInflationTermStructure
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr CYoYInflationTermStructure CTermStructure'
 -> YoYInflationTermStructure)
-> (Ptr CYoYInflationTermStructure'
    -> IO (GenForeignPtr CYoYInflationTermStructure CTermStructure'))
-> Ptr CYoYInflationTermStructure'
-> IO YoYInflationTermStructure
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CYoYInflationTermStructure'
-> IO (GenForeignPtr CYoYInflationTermStructure CTermStructure')
Ptr CYoYInflationTermStructure'
-> IO
     (GenForeignPtr
        CYoYInflationTermStructure (Base CYoYInflationTermStructure'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
withMaybeYoYInflationTermStructure :: Maybe YoYInflationTermStructure -> (Ptr CYoYInflationTermStructure' -> IO b) -> IO b
withMaybeYoYInflationTermStructure :: forall b.
Maybe YoYInflationTermStructure
-> (Ptr CYoYInflationTermStructure' -> IO b) -> IO b
withMaybeYoYInflationTermStructure Maybe YoYInflationTermStructure
x Ptr CYoYInflationTermStructure' -> IO b
f = IO b
-> (YoYInflationTermStructure -> IO b)
-> Maybe YoYInflationTermStructure
-> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Ptr CYoYInflationTermStructure' -> IO b
f Ptr CYoYInflationTermStructure'
forall a. Ptr a
nullPtr) (YoYInflationTermStructure
-> (Ptr CYoYInflationTermStructure' -> IO b) -> IO b
forall t b.
GenTermStructure (ForeignPtr t) -> (Ptr t -> IO b) -> IO b
`withGenTermStructure` Ptr CYoYInflationTermStructure' -> IO b
f) Maybe YoYInflationTermStructure
x
peekYoYCapFloorTermPriceSurface :: Ptr CYoYCapFloorTermPriceSurface' -> IO YoYCapFloorTermPriceSurface
peekYoYCapFloorTermPriceSurface :: Ptr CYoYCapFloorTermPriceSurface' -> IO YoYCapFloorTermPriceSurface
peekYoYCapFloorTermPriceSurface = GenForeignPtr CYoYCapFloorTermPriceSurface CTermStructure'
-> YoYCapFloorTermPriceSurface
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr CYoYCapFloorTermPriceSurface CTermStructure'
 -> YoYCapFloorTermPriceSurface)
-> (Ptr CYoYCapFloorTermPriceSurface'
    -> IO (GenForeignPtr CYoYCapFloorTermPriceSurface CTermStructure'))
-> Ptr CYoYCapFloorTermPriceSurface'
-> IO YoYCapFloorTermPriceSurface
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CYoYCapFloorTermPriceSurface'
-> IO (GenForeignPtr CYoYCapFloorTermPriceSurface CTermStructure')
Ptr CYoYCapFloorTermPriceSurface'
-> IO
     (GenForeignPtr
        CYoYCapFloorTermPriceSurface (Base CYoYCapFloorTermPriceSurface'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekCPICapFloorTermPriceSurface :: Ptr CCPICapFloorTermPriceSurface' -> IO CPICapFloorTermPriceSurface
peekCPICapFloorTermPriceSurface :: Ptr CCPICapFloorTermPriceSurface' -> IO CPICapFloorTermPriceSurface
peekCPICapFloorTermPriceSurface = GenForeignPtr CCPICapFloorTermPriceSurface CTermStructure'
-> CPICapFloorTermPriceSurface
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr CCPICapFloorTermPriceSurface CTermStructure'
 -> CPICapFloorTermPriceSurface)
-> (Ptr CCPICapFloorTermPriceSurface'
    -> IO (GenForeignPtr CCPICapFloorTermPriceSurface CTermStructure'))
-> Ptr CCPICapFloorTermPriceSurface'
-> IO CPICapFloorTermPriceSurface
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCPICapFloorTermPriceSurface'
-> IO (GenForeignPtr CCPICapFloorTermPriceSurface CTermStructure')
Ptr CCPICapFloorTermPriceSurface'
-> IO
     (GenForeignPtr
        CCPICapFloorTermPriceSurface (Base CCPICapFloorTermPriceSurface'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekCommodityCurve :: Ptr CCommodityCurve' -> IO CommodityCurve
peekCommodityCurve :: Ptr CCommodityCurve' -> IO CommodityCurve
peekCommodityCurve = GenForeignPtr CCommodityCurve CTermStructure' -> CommodityCurve
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr CCommodityCurve CTermStructure' -> CommodityCurve)
-> (Ptr CCommodityCurve'
    -> IO (GenForeignPtr CCommodityCurve CTermStructure'))
-> Ptr CCommodityCurve'
-> IO CommodityCurve
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCommodityCurve'
-> IO (GenForeignPtr CCommodityCurve CTermStructure')
Ptr CCommodityCurve'
-> IO (GenForeignPtr CCommodityCurve (Base CCommodityCurve'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
withMaybeCommodityCurve :: Maybe CommodityCurve -> (Ptr CCommodityCurve' -> IO b) -> IO b
withMaybeCommodityCurve :: forall b.
Maybe CommodityCurve -> (Ptr CCommodityCurve' -> IO b) -> IO b
withMaybeCommodityCurve Maybe CommodityCurve
x Ptr CCommodityCurve' -> IO b
f = IO b -> (CommodityCurve -> IO b) -> Maybe CommodityCurve -> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Ptr CCommodityCurve' -> IO b
f Ptr CCommodityCurve'
forall a. Ptr a
nullPtr) (CommodityCurve -> (Ptr CCommodityCurve' -> IO b) -> IO b
forall t b.
GenTermStructure (ForeignPtr t) -> (Ptr t -> IO b) -> IO b
`withGenTermStructure` Ptr CCommodityCurve' -> IO b
f) Maybe CommodityCurve
x
-- |Peek a possibly-null @CommodityCurve*@ -- @basisOfCurve_@ is a @nullptr@ 'shared_ptr' when no
-- basis curve has been set via 'QuantLib.TermStructure.Commodity.setBasisOfCurve',
-- not an empty-'Data'-style placeholder (unlike 'peekMaybeCommodityType' et al.).
peekMaybeCommodityCurve :: Ptr CCommodityCurve' -> IO (Maybe CommodityCurve)
peekMaybeCommodityCurve :: Ptr CCommodityCurve' -> IO (Maybe CommodityCurve)
peekMaybeCommodityCurve Ptr CCommodityCurve'
p
  | Ptr CCommodityCurve'
p Ptr CCommodityCurve' -> Ptr CCommodityCurve' -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr CCommodityCurve'
forall a. Ptr a
nullPtr = Maybe CommodityCurve -> IO (Maybe CommodityCurve)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe CommodityCurve
forall a. Maybe a
Nothing
  | Bool
otherwise = CommodityCurve -> Maybe CommodityCurve
forall a. a -> Maybe a
Just (CommodityCurve -> Maybe CommodityCurve)
-> IO CommodityCurve -> IO (Maybe CommodityCurve)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr CCommodityCurve' -> IO CommodityCurve
peekCommodityCurve Ptr CCommodityCurve'
p

asYieldTermStructure :: GenYieldTermStructure y -> IO YieldTermStructure
asYieldTermStructure :: forall y. GenYieldTermStructure y -> IO YieldTermStructure
asYieldTermStructure = (Ptr CYieldTermStructure' -> IO YieldTermStructure)
-> GenForeignPtr y CYieldTermStructure' -> IO YieldTermStructure
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CYieldTermStructure' -> IO YieldTermStructure
peekYieldTermStructure (GenForeignPtr y CYieldTermStructure' -> IO YieldTermStructure)
-> (GenYieldTermStructure y
    -> GenForeignPtr y CYieldTermStructure')
-> GenYieldTermStructure y
-> IO YieldTermStructure
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CYieldTermStructure' y) CTermStructure'
-> GenForeignPtr y CYieldTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CYieldTermStructure' y) CTermStructure'
 -> GenForeignPtr y CYieldTermStructure')
-> (GenYieldTermStructure y
    -> GenForeignPtr (AnyOf CYieldTermStructure' y) CTermStructure')
-> GenYieldTermStructure y
-> GenForeignPtr y CYieldTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenYieldTermStructure y
-> GenForeignPtr (AnyOf CYieldTermStructure' y) CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
peekYieldTermStructure :: Ptr CYieldTermStructure' -> IO YieldTermStructure
peekYieldTermStructure :: Ptr CYieldTermStructure' -> IO YieldTermStructure
peekYieldTermStructure = Ptr CYieldTermStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CYieldTermStructure') CYieldTermStructure')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CYieldTermStructure'
 -> IO
      (GenForeignPtr
         (ForeignPtr CYieldTermStructure') CYieldTermStructure'))
-> (GenForeignPtr
      (ForeignPtr CYieldTermStructure') CYieldTermStructure'
    -> IO YieldTermStructure)
-> Ptr CYieldTermStructure'
-> IO YieldTermStructure
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CYieldTermStructure') CYieldTermStructure'
-> IO YieldTermStructure
forall y.
GenForeignPtr y CYieldTermStructure'
-> IO (GenYieldTermStructure y)
newGenYieldTermStructure
withYieldTermStructure :: GenYieldTermStructure y -> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure :: forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withYieldTermStructure = GenForeignPtr y CYieldTermStructure'
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr y CYieldTermStructure'
 -> (Ptr CYieldTermStructure' -> IO b) -> IO b)
-> (GenYieldTermStructure y
    -> GenForeignPtr y CYieldTermStructure')
-> GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CYieldTermStructure' y) CTermStructure'
-> GenForeignPtr y CYieldTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CYieldTermStructure' y) CTermStructure'
 -> GenForeignPtr y CYieldTermStructure')
-> (GenYieldTermStructure y
    -> GenForeignPtr (AnyOf CYieldTermStructure' y) CTermStructure')
-> GenYieldTermStructure y
-> GenForeignPtr y CYieldTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenYieldTermStructure y
-> GenForeignPtr (AnyOf CYieldTermStructure' y) CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
withMaybeYieldTermStructure :: Maybe (GenYieldTermStructure y) -> (Ptr CYieldTermStructure' -> IO b) -> IO b
withMaybeYieldTermStructure :: forall y b.
Maybe (GenYieldTermStructure y)
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withMaybeYieldTermStructure Maybe (GenYieldTermStructure y)
x Ptr CYieldTermStructure' -> IO b
f = IO b
-> (GenYieldTermStructure y -> IO b)
-> Maybe (GenYieldTermStructure y)
-> IO b
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Ptr CYieldTermStructure' -> IO b
f Ptr CYieldTermStructure'
forall a. Ptr a
nullPtr) (GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
forall y b.
GenYieldTermStructure y
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
`withYieldTermStructure` Ptr CYieldTermStructure' -> IO b
f) Maybe (GenYieldTermStructure y)
x
newGenYieldTermStructure :: GenForeignPtr y CYieldTermStructure' -> IO (GenYieldTermStructure y)
newGenYieldTermStructure :: forall y.
GenForeignPtr y CYieldTermStructure'
-> IO (GenYieldTermStructure y)
newGenYieldTermStructure = GenYieldTermStructure y -> IO (GenYieldTermStructure y)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenYieldTermStructure y -> IO (GenYieldTermStructure y))
-> (GenForeignPtr y CYieldTermStructure'
    -> GenYieldTermStructure y)
-> GenForeignPtr y CYieldTermStructure'
-> IO (GenYieldTermStructure y)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CYieldTermStructure' y) CTermStructure'
-> GenYieldTermStructure y
forall t. GenForeignPtr t CTermStructure' -> GenTermStructure t
GenTermStructure (GenForeignPtr (AnyOf CYieldTermStructure' y) CTermStructure'
 -> GenYieldTermStructure y)
-> (GenForeignPtr y CYieldTermStructure'
    -> GenForeignPtr (AnyOf CYieldTermStructure' y) CTermStructure')
-> GenForeignPtr y CYieldTermStructure'
-> GenYieldTermStructure y
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr y CYieldTermStructure'
-> GenForeignPtr (AnyOf CYieldTermStructure' y) CTermStructure'
GenForeignPtr y CYieldTermStructure'
-> GenForeignPtr
     (AnyOf CYieldTermStructure' y) (Base CYieldTermStructure')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf

peekFittedBondDiscountCurve :: Ptr CFittedBondDiscountCurve' -> IO FittedBondDiscountCurve
peekFittedBondDiscountCurve :: Ptr CFittedBondDiscountCurve' -> IO FittedBondDiscountCurve
peekFittedBondDiscountCurve = Ptr CFittedBondDiscountCurve'
-> IO
     (GenForeignPtr
        (ForeignPtr CFittedBondDiscountCurve') CYieldTermStructure')
Ptr CFittedBondDiscountCurve'
-> IO
     (GenForeignPtr
        (ForeignPtr CFittedBondDiscountCurve')
        (Base CFittedBondDiscountCurve'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CFittedBondDiscountCurve'
 -> IO
      (GenForeignPtr
         (ForeignPtr CFittedBondDiscountCurve') CYieldTermStructure'))
-> (GenForeignPtr
      (ForeignPtr CFittedBondDiscountCurve') CYieldTermStructure'
    -> IO FittedBondDiscountCurve)
-> Ptr CFittedBondDiscountCurve'
-> IO FittedBondDiscountCurve
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CFittedBondDiscountCurve') CYieldTermStructure'
-> IO FittedBondDiscountCurve
forall y.
GenForeignPtr y CYieldTermStructure'
-> IO (GenYieldTermStructure y)
newGenYieldTermStructure
peekRelinkableYieldTermStructure :: Ptr CRelinkableYieldTermStructure' -> IO RelinkableYieldTermStructure
peekRelinkableYieldTermStructure :: Ptr CRelinkableYieldTermStructure'
-> IO RelinkableYieldTermStructure
peekRelinkableYieldTermStructure = Ptr CRelinkableYieldTermStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CRelinkableYieldTermStructure') CYieldTermStructure')
Ptr CRelinkableYieldTermStructure'
-> IO
     (GenForeignPtr
        (ForeignPtr CRelinkableYieldTermStructure')
        (Base CRelinkableYieldTermStructure'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CRelinkableYieldTermStructure'
 -> IO
      (GenForeignPtr
         (ForeignPtr CRelinkableYieldTermStructure') CYieldTermStructure'))
-> (GenForeignPtr
      (ForeignPtr CRelinkableYieldTermStructure') CYieldTermStructure'
    -> IO RelinkableYieldTermStructure)
-> Ptr CRelinkableYieldTermStructure'
-> IO RelinkableYieldTermStructure
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CRelinkableYieldTermStructure') CYieldTermStructure'
-> IO RelinkableYieldTermStructure
forall y.
GenForeignPtr y CYieldTermStructure'
-> IO (GenYieldTermStructure y)
newGenYieldTermStructure
-- | Reach the relinkable handle itself, for the operations that only it has ('linkTo',
-- 'currentLink'). Ordinary curve arguments go through 'withYieldTermStructure' instead,
-- which upcasts.
withRelinkableYieldTermStructure :: RelinkableYieldTermStructure -> (Ptr CRelinkableYieldTermStructure' -> IO b) -> IO b
withRelinkableYieldTermStructure :: forall b.
RelinkableYieldTermStructure
-> (Ptr CRelinkableYieldTermStructure' -> IO b) -> IO b
withRelinkableYieldTermStructure = ForeignPtr CRelinkableYieldTermStructure'
-> (Ptr CRelinkableYieldTermStructure' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CRelinkableYieldTermStructure'
 -> (Ptr CRelinkableYieldTermStructure' -> IO b) -> IO b)
-> (RelinkableYieldTermStructure
    -> ForeignPtr CRelinkableYieldTermStructure')
-> RelinkableYieldTermStructure
-> (Ptr CRelinkableYieldTermStructure' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CRelinkableYieldTermStructure') CYieldTermStructure'
-> ForeignPtr CRelinkableYieldTermStructure'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CRelinkableYieldTermStructure') CYieldTermStructure'
 -> ForeignPtr CRelinkableYieldTermStructure')
-> (RelinkableYieldTermStructure
    -> GenForeignPtr
         (ForeignPtr CRelinkableYieldTermStructure') CYieldTermStructure')
-> RelinkableYieldTermStructure
-> ForeignPtr CRelinkableYieldTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CYieldTermStructure' (ForeignPtr CRelinkableYieldTermStructure'))
  CTermStructure'
-> GenForeignPtr
     (ForeignPtr CRelinkableYieldTermStructure') CYieldTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CYieldTermStructure' (ForeignPtr CRelinkableYieldTermStructure'))
   CTermStructure'
 -> GenForeignPtr
      (ForeignPtr CRelinkableYieldTermStructure') CYieldTermStructure')
-> (RelinkableYieldTermStructure
    -> GenForeignPtr
         (AnyOf
            CYieldTermStructure' (ForeignPtr CRelinkableYieldTermStructure'))
         CTermStructure')
-> RelinkableYieldTermStructure
-> GenForeignPtr
     (ForeignPtr CRelinkableYieldTermStructure') CYieldTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RelinkableYieldTermStructure
-> GenForeignPtr
     (AnyOf
        CYieldTermStructure' (ForeignPtr CRelinkableYieldTermStructure'))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure
withFittedBondDiscountCurve :: FittedBondDiscountCurve -> (Ptr CFittedBondDiscountCurve' -> IO b) -> IO b
withFittedBondDiscountCurve :: forall b.
FittedBondDiscountCurve
-> (Ptr CFittedBondDiscountCurve' -> IO b) -> IO b
withFittedBondDiscountCurve = ForeignPtr CFittedBondDiscountCurve'
-> (Ptr CFittedBondDiscountCurve' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CFittedBondDiscountCurve'
 -> (Ptr CFittedBondDiscountCurve' -> IO b) -> IO b)
-> (FittedBondDiscountCurve
    -> ForeignPtr CFittedBondDiscountCurve')
-> FittedBondDiscountCurve
-> (Ptr CFittedBondDiscountCurve' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CFittedBondDiscountCurve') CYieldTermStructure'
-> ForeignPtr CFittedBondDiscountCurve'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CFittedBondDiscountCurve') CYieldTermStructure'
 -> ForeignPtr CFittedBondDiscountCurve')
-> (FittedBondDiscountCurve
    -> GenForeignPtr
         (ForeignPtr CFittedBondDiscountCurve') CYieldTermStructure')
-> FittedBondDiscountCurve
-> ForeignPtr CFittedBondDiscountCurve'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CYieldTermStructure' (ForeignPtr CFittedBondDiscountCurve'))
  CTermStructure'
-> GenForeignPtr
     (ForeignPtr CFittedBondDiscountCurve') CYieldTermStructure'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CYieldTermStructure' (ForeignPtr CFittedBondDiscountCurve'))
   CTermStructure'
 -> GenForeignPtr
      (ForeignPtr CFittedBondDiscountCurve') CYieldTermStructure')
-> (FittedBondDiscountCurve
    -> GenForeignPtr
         (AnyOf CYieldTermStructure' (ForeignPtr CFittedBondDiscountCurve'))
         CTermStructure')
-> FittedBondDiscountCurve
-> GenForeignPtr
     (ForeignPtr CFittedBondDiscountCurve') CYieldTermStructure'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FittedBondDiscountCurve
-> GenForeignPtr
     (AnyOf CYieldTermStructure' (ForeignPtr CFittedBondDiscountCurve'))
     CTermStructure'
forall t. GenTermStructure t -> GenForeignPtr t CTermStructure'
getTermStructure

-- |The root of the hierarchy shown under t'GenStochasticProcess'.
type StochasticProcess = GenStochasticProcess CStochasticProcess
data CStochasticProcess'
data CExtOUWithJumpsProcess'
data CGJRGARCHProcess'
data CHybridHestonHullWhiteProcess'
data CKlugeExtOUProcess'
data CLiborForwardModelProcess'
data CStochasticProcessArray'
data CG2Process'
data CG2ForwardProcess'
data CHestonProcess'
data CHestonSLVProcess'
data CStochasticProcess1D'
data CBatesProcess'
data CExtendedOrnsteinUhlenbeckProcess'
data CHullWhiteForwardProcess'
data CHullWhiteProcess'
data CMerton76Process'
data CVarianceGammaProcess'
data CGeneralizedBlackScholesProcess'
data CBlackProcess'
-- | > StochasticProcess
-- >   ExtOUWithJumpsProcess
-- >   GJRGARCHProcess
-- >   HybridHestonHullWhiteProcess
-- >   KlugeExtOUProcess
-- >   LiborForwardModelProcess
-- >   StochasticProcessArray
-- >   G2Process
-- >   G2ForwardProcess
-- >   HestonProcess
-- >     BatesProcess
-- >   HestonSLVProcess
-- >   StochasticProcess1D
-- >     ExtendedOrnsteinUhlenbeckProcess
-- >     HullWhiteForwardProcess
-- >     HullWhiteProcess
-- >     Merton76Process
-- >     VarianceGammaProcess
-- >     GeneralizedBlackScholesProcess
-- >       BlackProcess
newtype GenStochasticProcess p = GenStochasticProcess {forall p.
GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
getStochasticProcess :: GenForeignPtr p CStochasticProcess'}
type CStochasticProcess = ForeignPtr CStochasticProcess'
type CExtOUWithJumpsProcess = ForeignPtr CExtOUWithJumpsProcess'
-- |A 'StochasticProcess'; see the hierarchy under t'GenStochasticProcess'.
type ExtOUWithJumpsProcess = GenStochasticProcess CExtOUWithJumpsProcess
type CGJRGARCHProcess = ForeignPtr CGJRGARCHProcess'
-- |A 'StochasticProcess'; see the hierarchy under t'GenStochasticProcess'.
type GJRGARCHProcess = GenStochasticProcess CGJRGARCHProcess
type CHybridHestonHullWhiteProcess = ForeignPtr CHybridHestonHullWhiteProcess'
-- |A 'StochasticProcess'; see the hierarchy under t'GenStochasticProcess'.
type HybridHestonHullWhiteProcess = GenStochasticProcess CHybridHestonHullWhiteProcess
type CKlugeExtOUProcess = ForeignPtr CKlugeExtOUProcess'
-- |A 'StochasticProcess'; see the hierarchy under t'GenStochasticProcess'.
type KlugeExtOUProcess = GenStochasticProcess CKlugeExtOUProcess
type CLiborForwardModelProcess = ForeignPtr CLiborForwardModelProcess'
-- |A 'StochasticProcess'; see the hierarchy under t'GenStochasticProcess'.
type LiborForwardModelProcess = GenStochasticProcess CLiborForwardModelProcess
type CStochasticProcessArray = ForeignPtr CStochasticProcessArray'
-- |A 'StochasticProcess'; see the hierarchy under t'GenStochasticProcess'.
type StochasticProcessArray = GenStochasticProcess CStochasticProcessArray
type CG2Process = ForeignPtr CG2Process'
-- |A 'StochasticProcess'; see the hierarchy under t'GenStochasticProcess'.
type G2Process = GenStochasticProcess CG2Process
type CG2ForwardProcess = ForeignPtr CG2ForwardProcess'
-- |A 'StochasticProcess'; see the hierarchy under t'GenStochasticProcess'.
type G2ForwardProcess = GenStochasticProcess CG2ForwardProcess
-- |A 'HestonProcess' or one of its leaves; see the hierarchy under t'GenStochasticProcess'.
type GenHestonProcess hp = GenStochasticProcess (AnyOf CHestonProcess' hp)
type CHestonProcess = ForeignPtr CHestonProcess'
-- |A 'StochasticProcess'; see the hierarchy under t'GenStochasticProcess'.
type HestonProcess = GenHestonProcess CHestonProcess
type CHestonSLVProcess = ForeignPtr CHestonSLVProcess'
-- |A 'StochasticProcess'; see the hierarchy under t'GenStochasticProcess'.
type HestonSLVProcess = GenStochasticProcess CHestonSLVProcess
-- |A 'StochasticProcess1D' or one of its leaves; see the hierarchy under t'GenStochasticProcess'.
type GenStochasticProcess1D p1d = GenStochasticProcess (AnyOf CStochasticProcess1D' p1d)
type CStochasticProcess1D = ForeignPtr CStochasticProcess1D'
-- |A 'StochasticProcess'; see the hierarchy under t'GenStochasticProcess'.
type StochasticProcess1D = GenStochasticProcess1D CStochasticProcess1D
type CMerton76Process = ForeignPtr CMerton76Process'
-- |A 'StochasticProcess1D'; see the hierarchy under t'GenStochasticProcess'.
type Merton76Process = GenStochasticProcess1D CMerton76Process
type CVarianceGammaProcess = ForeignPtr CVarianceGammaProcess'
-- |A 'StochasticProcess1D'; see the hierarchy under t'GenStochasticProcess'.
type VarianceGammaProcess = GenStochasticProcess1D CVarianceGammaProcess
type GenGeneralizedBlackScholesProcess gbs = GenStochasticProcess1D (AnyOf CGeneralizedBlackScholesProcess' gbs)
type CGeneralizedBlackScholesProcess = ForeignPtr CGeneralizedBlackScholesProcess'
-- |A 'StochasticProcess1D'; see the hierarchy under t'GenStochasticProcess'.
type GeneralizedBlackScholesProcess = GenGeneralizedBlackScholesProcess CGeneralizedBlackScholesProcess
type CBlackProcess = ForeignPtr CBlackProcess'
-- |A 'GeneralizedBlackScholesProcess'; see the hierarchy under t'GenStochasticProcess'.
type BlackProcess = GenGeneralizedBlackScholesProcess CBlackProcess
type CBatesProcess = ForeignPtr CBatesProcess'
-- |A 'HestonProcess'; see the hierarchy under t'GenStochasticProcess'.
type BatesProcess = GenHestonProcess CBatesProcess
type CHullWhiteProcess = ForeignPtr CHullWhiteProcess'
-- |A 'StochasticProcess1D'; see the hierarchy under t'GenStochasticProcess'.
type HullWhiteProcess = GenStochasticProcess1D CHullWhiteProcess
type CHullWhiteForwardProcess = ForeignPtr CHullWhiteForwardProcess'
-- |A 'StochasticProcess1D'; see the hierarchy under t'GenStochasticProcess'.
type HullWhiteForwardProcess = GenStochasticProcess1D CHullWhiteForwardProcess
type CExtendedOrnsteinUhlenbeckProcess = ForeignPtr CExtendedOrnsteinUhlenbeckProcess'
-- |A 'StochasticProcess1D'; see the hierarchy under t'GenStochasticProcess'.
type ExtendedOrnsteinUhlenbeckProcess = GenStochasticProcess1D CExtendedOrnsteinUhlenbeckProcess
foreign import ccall unsafe "ql.h &qlFreeStochasticProcess" qlFreeStochasticProcess :: FinalizerPtr CStochasticProcess'
foreign import ccall unsafe "ql.h &qlFreeExtOUWithJumpsProcess" qlFreeExtOUWithJumpsProcess :: FinalizerPtr CExtOUWithJumpsProcess'
foreign import ccall unsafe "ql.h &qlFreeGJRGARCHProcess" qlFreeGJRGARCHProcess :: FinalizerPtr CGJRGARCHProcess'
foreign import ccall unsafe "ql.h &qlFreeHybridHestonHullWhiteProcess" qlFreeHybridHestonHullWhiteProcess :: FinalizerPtr CHybridHestonHullWhiteProcess'
foreign import ccall unsafe "ql.h &qlFreeKlugeExtOUProcess" qlFreeKlugeExtOUProcess :: FinalizerPtr CKlugeExtOUProcess'
foreign import ccall unsafe "ql.h &qlFreeLiborForwardModelProcess" qlFreeLiborForwardModelProcess :: FinalizerPtr CLiborForwardModelProcess'
foreign import ccall unsafe "ql.h &qlFreeStochasticProcessArray" qlFreeStochasticProcessArray :: FinalizerPtr CStochasticProcessArray'
foreign import ccall unsafe "ql.h &qlFreeG2Process" qlFreeG2Process :: FinalizerPtr CG2Process'
foreign import ccall unsafe "ql.h &qlFreeG2ForwardProcess" qlFreeG2ForwardProcess :: FinalizerPtr CG2ForwardProcess'
foreign import ccall unsafe "ql.h &qlFreeHestonProcess" qlFreeHestonProcess :: FinalizerPtr CHestonProcess'
foreign import ccall unsafe "ql.h &qlFreeHestonSLVProcess" qlFreeHestonSLVProcess :: FinalizerPtr CHestonSLVProcess'
foreign import ccall unsafe "ql.h &qlFreeStochasticProcess1D" qlFreeStochasticProcess1D :: FinalizerPtr CStochasticProcess1D'
foreign import ccall unsafe "ql.h &qlFreeBatesProcess" qlFreeBatesProcess :: FinalizerPtr CBatesProcess'
foreign import ccall unsafe "ql.h &qlFreeExtendedOrnsteinUhlenbeckProcess" qlFreeExtendedOrnsteinUhlenbeckProcess :: FinalizerPtr CExtendedOrnsteinUhlenbeckProcess'
foreign import ccall unsafe "ql.h &qlFreeHullWhiteForwardProcess" qlFreeHullWhiteForwardProcess :: FinalizerPtr CHullWhiteForwardProcess'
foreign import ccall unsafe "ql.h &qlFreeHullWhiteProcess" qlFreeHullWhiteProcess :: FinalizerPtr CHullWhiteProcess'
foreign import ccall unsafe "ql.h &qlFreeMerton76Process" qlFreeMerton76Process :: FinalizerPtr CMerton76Process'
foreign import ccall unsafe "ql.h &qlFreeVarianceGammaProcess" qlFreeVarianceGammaProcess :: FinalizerPtr CVarianceGammaProcess'
foreign import ccall unsafe "ql.h &qlFreeGeneralizedBlackScholesProcess" qlFreeGeneralizedBlackScholesProcess :: FinalizerPtr CGeneralizedBlackScholesProcess'
foreign import ccall unsafe "ql.h &qlFreeBlackProcess" qlFreeBlackProcess :: FinalizerPtr CBlackProcess'
instance Finalizable CStochasticProcess' where finalize :: FinalizerPtr CStochasticProcess'
finalize = FinalizerPtr CStochasticProcess'
qlFreeStochasticProcess
instance Finalizable CExtOUWithJumpsProcess' where finalize :: FinalizerPtr CExtOUWithJumpsProcess'
finalize = FinalizerPtr CExtOUWithJumpsProcess'
qlFreeExtOUWithJumpsProcess
instance Finalizable CGJRGARCHProcess' where finalize :: FinalizerPtr CGJRGARCHProcess'
finalize = FinalizerPtr CGJRGARCHProcess'
qlFreeGJRGARCHProcess
instance Finalizable CHybridHestonHullWhiteProcess' where finalize :: FinalizerPtr CHybridHestonHullWhiteProcess'
finalize = FinalizerPtr CHybridHestonHullWhiteProcess'
qlFreeHybridHestonHullWhiteProcess
instance Finalizable CKlugeExtOUProcess' where finalize :: FinalizerPtr CKlugeExtOUProcess'
finalize = FinalizerPtr CKlugeExtOUProcess'
qlFreeKlugeExtOUProcess
instance Finalizable CLiborForwardModelProcess' where finalize :: FinalizerPtr CLiborForwardModelProcess'
finalize = FinalizerPtr CLiborForwardModelProcess'
qlFreeLiborForwardModelProcess
instance Finalizable CStochasticProcessArray' where finalize :: FinalizerPtr CStochasticProcessArray'
finalize = FinalizerPtr CStochasticProcessArray'
qlFreeStochasticProcessArray
instance Finalizable CG2Process' where finalize :: FinalizerPtr CG2Process'
finalize = FinalizerPtr CG2Process'
qlFreeG2Process
instance Finalizable CG2ForwardProcess' where finalize :: FinalizerPtr CG2ForwardProcess'
finalize = FinalizerPtr CG2ForwardProcess'
qlFreeG2ForwardProcess
instance Finalizable CHestonProcess' where finalize :: FinalizerPtr CHestonProcess'
finalize = FinalizerPtr CHestonProcess'
qlFreeHestonProcess
instance Finalizable CHestonSLVProcess' where finalize :: FinalizerPtr CHestonSLVProcess'
finalize = FinalizerPtr CHestonSLVProcess'
qlFreeHestonSLVProcess
instance Finalizable CStochasticProcess1D' where finalize :: FinalizerPtr CStochasticProcess1D'
finalize = FinalizerPtr CStochasticProcess1D'
qlFreeStochasticProcess1D
instance Finalizable CBatesProcess' where finalize :: FinalizerPtr CBatesProcess'
finalize = FinalizerPtr CBatesProcess'
qlFreeBatesProcess
instance Finalizable CExtendedOrnsteinUhlenbeckProcess' where finalize :: FinalizerPtr CExtendedOrnsteinUhlenbeckProcess'
finalize = FinalizerPtr CExtendedOrnsteinUhlenbeckProcess'
qlFreeExtendedOrnsteinUhlenbeckProcess
instance Finalizable CHullWhiteForwardProcess' where finalize :: FinalizerPtr CHullWhiteForwardProcess'
finalize = FinalizerPtr CHullWhiteForwardProcess'
qlFreeHullWhiteForwardProcess
instance Finalizable CHullWhiteProcess' where finalize :: FinalizerPtr CHullWhiteProcess'
finalize = FinalizerPtr CHullWhiteProcess'
qlFreeHullWhiteProcess
instance Finalizable CMerton76Process' where finalize :: FinalizerPtr CMerton76Process'
finalize = FinalizerPtr CMerton76Process'
qlFreeMerton76Process
instance Finalizable CVarianceGammaProcess' where finalize :: FinalizerPtr CVarianceGammaProcess'
finalize = FinalizerPtr CVarianceGammaProcess'
qlFreeVarianceGammaProcess
instance Finalizable CGeneralizedBlackScholesProcess' where finalize :: FinalizerPtr CGeneralizedBlackScholesProcess'
finalize = FinalizerPtr CGeneralizedBlackScholesProcess'
qlFreeGeneralizedBlackScholesProcess
instance Finalizable CBlackProcess' where finalize :: FinalizerPtr CBlackProcess'
finalize = FinalizerPtr CBlackProcess'
qlFreeBlackProcess
foreign import ccall "ql.h qlExtOUWithJumpsProcessAsStochasticProcess" qlExtOUWithJumpsProcessAsStochasticProcess :: Ptr CExtOUWithJumpsProcess' -> IO (Ptr CStochasticProcess')
foreign import ccall "ql.h qlGJRGARCHProcessAsStochasticProcess" qlGJRGARCHProcessAsStochasticProcess :: Ptr CGJRGARCHProcess' -> IO (Ptr CStochasticProcess')
foreign import ccall "ql.h qlHybridHestonHullWhiteProcessAsStochasticProcess" qlHybridHestonHullWhiteProcessAsStochasticProcess :: Ptr CHybridHestonHullWhiteProcess' -> IO (Ptr CStochasticProcess')
foreign import ccall "ql.h qlKlugeExtOUProcessAsStochasticProcess" qlKlugeExtOUProcessAsStochasticProcess :: Ptr CKlugeExtOUProcess' -> IO (Ptr CStochasticProcess')
foreign import ccall "ql.h qlLiborForwardModelProcessAsStochasticProcess" qlLiborForwardModelProcessAsStochasticProcess :: Ptr CLiborForwardModelProcess' -> IO (Ptr CStochasticProcess')
foreign import ccall "ql.h qlStochasticProcessArrayAsStochasticProcess" qlStochasticProcessArrayAsStochasticProcess :: Ptr CStochasticProcessArray' -> IO (Ptr CStochasticProcess')
foreign import ccall "ql.h qlG2ProcessAsStochasticProcess" qlG2ProcessAsStochasticProcess :: Ptr CG2Process' -> IO (Ptr CStochasticProcess')
foreign import ccall "ql.h qlG2ForwardProcessAsStochasticProcess" qlG2ForwardProcessAsStochasticProcess :: Ptr CG2ForwardProcess' -> IO (Ptr CStochasticProcess')
foreign import ccall "ql.h qlHestonProcessAsStochasticProcess" qlHestonProcessAsStochasticProcess :: Ptr CHestonProcess' -> IO (Ptr CStochasticProcess')
foreign import ccall "ql.h qlHestonSLVProcessAsStochasticProcess" qlHestonSLVProcessAsStochasticProcess :: Ptr CHestonSLVProcess' -> IO (Ptr CStochasticProcess')
foreign import ccall "ql.h qlStochasticProcess1DAsStochasticProcess" qlStochasticProcess1DAsStochasticProcess :: Ptr CStochasticProcess1D' -> IO (Ptr CStochasticProcess')
foreign import ccall "ql.h qlBatesProcessAsHestonProcess" qlBatesProcessAsHestonProcess :: Ptr CBatesProcess' -> IO (Ptr CHestonProcess')
foreign import ccall "ql.h qlExtendedOrnsteinUhlenbeckProcessAsStochasticProcess1D" qlExtendedOrnsteinUhlenbeckProcessAsStochasticProcess1D :: Ptr CExtendedOrnsteinUhlenbeckProcess' -> IO (Ptr CStochasticProcess1D')
foreign import ccall "ql.h qlHullWhiteForwardProcessAsStochasticProcess1D" qlHullWhiteForwardProcessAsStochasticProcess1D :: Ptr CHullWhiteForwardProcess' -> IO (Ptr CStochasticProcess1D')
foreign import ccall "ql.h qlHullWhiteProcessAsStochasticProcess1D" qlHullWhiteProcessAsStochasticProcess1D :: Ptr CHullWhiteProcess' -> IO (Ptr CStochasticProcess1D')
foreign import ccall "ql.h qlMerton76ProcessAsStochasticProcess1D" qlMerton76ProcessAsStochasticProcess1D :: Ptr CMerton76Process' -> IO (Ptr CStochasticProcess1D')
foreign import ccall "ql.h qlVarianceGammaProcessAsStochasticProcess1D" qlVarianceGammaProcessAsStochasticProcess1D :: Ptr CVarianceGammaProcess' -> IO (Ptr CStochasticProcess1D')
foreign import ccall "ql.h qlGeneralizedBlackScholesProcessAsStochasticProcess1D" qlGeneralizedBlackScholesProcessAsStochasticProcess1D :: Ptr CGeneralizedBlackScholesProcess' -> IO (Ptr CStochasticProcess1D')
foreign import ccall "ql.h qlBlackProcessAsGeneralizedBlackScholesProcess" qlBlackProcessAsGeneralizedBlackScholesProcess :: Ptr CBlackProcess' -> IO (Ptr CGeneralizedBlackScholesProcess')
instance Upcastable CExtOUWithJumpsProcess' where {type Base CExtOUWithJumpsProcess' = CStochasticProcess'; upcast :: Ptr CExtOUWithJumpsProcess'
-> IO (Ptr (Base CExtOUWithJumpsProcess'))
upcast = Ptr CExtOUWithJumpsProcess' -> IO (Ptr CStochasticProcess')
Ptr CExtOUWithJumpsProcess'
-> IO (Ptr (Base CExtOUWithJumpsProcess'))
qlExtOUWithJumpsProcessAsStochasticProcess}
instance Upcastable CGJRGARCHProcess' where {type Base CGJRGARCHProcess' = CStochasticProcess'; upcast :: Ptr CGJRGARCHProcess' -> IO (Ptr (Base CGJRGARCHProcess'))
upcast = Ptr CGJRGARCHProcess' -> IO (Ptr CStochasticProcess')
Ptr CGJRGARCHProcess' -> IO (Ptr (Base CGJRGARCHProcess'))
qlGJRGARCHProcessAsStochasticProcess}
instance Upcastable CHybridHestonHullWhiteProcess' where {type Base CHybridHestonHullWhiteProcess' = CStochasticProcess'; upcast :: Ptr CHybridHestonHullWhiteProcess'
-> IO (Ptr (Base CHybridHestonHullWhiteProcess'))
upcast = Ptr CHybridHestonHullWhiteProcess' -> IO (Ptr CStochasticProcess')
Ptr CHybridHestonHullWhiteProcess'
-> IO (Ptr (Base CHybridHestonHullWhiteProcess'))
qlHybridHestonHullWhiteProcessAsStochasticProcess}
instance Upcastable CKlugeExtOUProcess' where {type Base CKlugeExtOUProcess' = CStochasticProcess'; upcast :: Ptr CKlugeExtOUProcess' -> IO (Ptr (Base CKlugeExtOUProcess'))
upcast = Ptr CKlugeExtOUProcess' -> IO (Ptr CStochasticProcess')
Ptr CKlugeExtOUProcess' -> IO (Ptr (Base CKlugeExtOUProcess'))
qlKlugeExtOUProcessAsStochasticProcess}
instance Upcastable CLiborForwardModelProcess' where {type Base CLiborForwardModelProcess' = CStochasticProcess'; upcast :: Ptr CLiborForwardModelProcess'
-> IO (Ptr (Base CLiborForwardModelProcess'))
upcast = Ptr CLiborForwardModelProcess' -> IO (Ptr CStochasticProcess')
Ptr CLiborForwardModelProcess'
-> IO (Ptr (Base CLiborForwardModelProcess'))
qlLiborForwardModelProcessAsStochasticProcess}
instance Upcastable CStochasticProcessArray' where {type Base CStochasticProcessArray' = CStochasticProcess'; upcast :: Ptr CStochasticProcessArray'
-> IO (Ptr (Base CStochasticProcessArray'))
upcast = Ptr CStochasticProcessArray' -> IO (Ptr CStochasticProcess')
Ptr CStochasticProcessArray'
-> IO (Ptr (Base CStochasticProcessArray'))
qlStochasticProcessArrayAsStochasticProcess}
instance Upcastable CG2Process' where {type Base CG2Process' = CStochasticProcess'; upcast :: Ptr CG2Process' -> IO (Ptr (Base CG2Process'))
upcast = Ptr CG2Process' -> IO (Ptr CStochasticProcess')
Ptr CG2Process' -> IO (Ptr (Base CG2Process'))
qlG2ProcessAsStochasticProcess}
instance Upcastable CG2ForwardProcess' where {type Base CG2ForwardProcess' = CStochasticProcess'; upcast :: Ptr CG2ForwardProcess' -> IO (Ptr (Base CG2ForwardProcess'))
upcast = Ptr CG2ForwardProcess' -> IO (Ptr CStochasticProcess')
Ptr CG2ForwardProcess' -> IO (Ptr (Base CG2ForwardProcess'))
qlG2ForwardProcessAsStochasticProcess}
instance Upcastable CHestonProcess' where {type Base CHestonProcess' = CStochasticProcess'; upcast :: Ptr CHestonProcess' -> IO (Ptr (Base CHestonProcess'))
upcast = Ptr CHestonProcess' -> IO (Ptr CStochasticProcess')
Ptr CHestonProcess' -> IO (Ptr (Base CHestonProcess'))
qlHestonProcessAsStochasticProcess}
instance Upcastable CHestonSLVProcess' where {type Base CHestonSLVProcess' = CStochasticProcess'; upcast :: Ptr CHestonSLVProcess' -> IO (Ptr (Base CHestonSLVProcess'))
upcast = Ptr CHestonSLVProcess' -> IO (Ptr CStochasticProcess')
Ptr CHestonSLVProcess' -> IO (Ptr (Base CHestonSLVProcess'))
qlHestonSLVProcessAsStochasticProcess}
instance Upcastable CStochasticProcess1D' where {type Base CStochasticProcess1D' = CStochasticProcess'; upcast :: Ptr CStochasticProcess1D' -> IO (Ptr (Base CStochasticProcess1D'))
upcast = Ptr CStochasticProcess1D' -> IO (Ptr CStochasticProcess')
Ptr CStochasticProcess1D' -> IO (Ptr (Base CStochasticProcess1D'))
qlStochasticProcess1DAsStochasticProcess}
instance Upcastable CBatesProcess' where {type Base CBatesProcess' = CHestonProcess'; upcast :: Ptr CBatesProcess' -> IO (Ptr (Base CBatesProcess'))
upcast = Ptr CBatesProcess' -> IO (Ptr CHestonProcess')
Ptr CBatesProcess' -> IO (Ptr (Base CBatesProcess'))
qlBatesProcessAsHestonProcess}
instance Upcastable CExtendedOrnsteinUhlenbeckProcess' where {type Base CExtendedOrnsteinUhlenbeckProcess' = CStochasticProcess1D'; upcast :: Ptr CExtendedOrnsteinUhlenbeckProcess'
-> IO (Ptr (Base CExtendedOrnsteinUhlenbeckProcess'))
upcast = Ptr CExtendedOrnsteinUhlenbeckProcess'
-> IO (Ptr CStochasticProcess1D')
Ptr CExtendedOrnsteinUhlenbeckProcess'
-> IO (Ptr (Base CExtendedOrnsteinUhlenbeckProcess'))
qlExtendedOrnsteinUhlenbeckProcessAsStochasticProcess1D}
instance Upcastable CHullWhiteForwardProcess' where {type Base CHullWhiteForwardProcess' = CStochasticProcess1D'; upcast :: Ptr CHullWhiteForwardProcess'
-> IO (Ptr (Base CHullWhiteForwardProcess'))
upcast = Ptr CHullWhiteForwardProcess' -> IO (Ptr CStochasticProcess1D')
Ptr CHullWhiteForwardProcess'
-> IO (Ptr (Base CHullWhiteForwardProcess'))
qlHullWhiteForwardProcessAsStochasticProcess1D}
instance Upcastable CHullWhiteProcess' where {type Base CHullWhiteProcess' = CStochasticProcess1D'; upcast :: Ptr CHullWhiteProcess' -> IO (Ptr (Base CHullWhiteProcess'))
upcast = Ptr CHullWhiteProcess' -> IO (Ptr CStochasticProcess1D')
Ptr CHullWhiteProcess' -> IO (Ptr (Base CHullWhiteProcess'))
qlHullWhiteProcessAsStochasticProcess1D}
instance Upcastable CMerton76Process' where {type Base CMerton76Process' = CStochasticProcess1D'; upcast :: Ptr CMerton76Process' -> IO (Ptr (Base CMerton76Process'))
upcast = Ptr CMerton76Process' -> IO (Ptr CStochasticProcess1D')
Ptr CMerton76Process' -> IO (Ptr (Base CMerton76Process'))
qlMerton76ProcessAsStochasticProcess1D}
instance Upcastable CVarianceGammaProcess' where {type Base CVarianceGammaProcess' = CStochasticProcess1D'; upcast :: Ptr CVarianceGammaProcess'
-> IO (Ptr (Base CVarianceGammaProcess'))
upcast = Ptr CVarianceGammaProcess' -> IO (Ptr CStochasticProcess1D')
Ptr CVarianceGammaProcess'
-> IO (Ptr (Base CVarianceGammaProcess'))
qlVarianceGammaProcessAsStochasticProcess1D}
instance Upcastable CGeneralizedBlackScholesProcess' where {type Base CGeneralizedBlackScholesProcess' = CStochasticProcess1D'; upcast :: Ptr CGeneralizedBlackScholesProcess'
-> IO (Ptr (Base CGeneralizedBlackScholesProcess'))
upcast = Ptr CGeneralizedBlackScholesProcess'
-> IO (Ptr CStochasticProcess1D')
Ptr CGeneralizedBlackScholesProcess'
-> IO (Ptr (Base CGeneralizedBlackScholesProcess'))
qlGeneralizedBlackScholesProcessAsStochasticProcess1D}
instance Upcastable CBlackProcess' where {type Base CBlackProcess' = CGeneralizedBlackScholesProcess'; upcast :: Ptr CBlackProcess' -> IO (Ptr (Base CBlackProcess'))
upcast = Ptr CBlackProcess' -> IO (Ptr CGeneralizedBlackScholesProcess')
Ptr CBlackProcess' -> IO (Ptr (Base CBlackProcess'))
qlBlackProcessAsGeneralizedBlackScholesProcess}
asStochasticProcess :: GenStochasticProcess p -> IO StochasticProcess
asStochasticProcess :: forall p. GenStochasticProcess p -> IO StochasticProcess
asStochasticProcess = (Ptr CStochasticProcess' -> IO StochasticProcess)
-> GenForeignPtr p CStochasticProcess' -> IO StochasticProcess
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CStochasticProcess' -> IO StochasticProcess
peekStochasticProcess (GenForeignPtr p CStochasticProcess' -> IO StochasticProcess)
-> (GenStochasticProcess p -> GenForeignPtr p CStochasticProcess')
-> GenStochasticProcess p
-> IO StochasticProcess
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
forall p.
GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
getStochasticProcess
peekStochasticProcess :: Ptr CStochasticProcess' -> IO StochasticProcess
peekStochasticProcess :: Ptr CStochasticProcess' -> IO StochasticProcess
peekStochasticProcess = GenForeignPtr CStochasticProcess CStochasticProcess'
-> StochasticProcess
forall p.
GenForeignPtr p CStochasticProcess' -> GenStochasticProcess p
GenStochasticProcess (GenForeignPtr CStochasticProcess CStochasticProcess'
 -> StochasticProcess)
-> (Ptr CStochasticProcess'
    -> IO (GenForeignPtr CStochasticProcess CStochasticProcess'))
-> Ptr CStochasticProcess'
-> IO StochasticProcess
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CStochasticProcess'
-> IO (GenForeignPtr CStochasticProcess CStochasticProcess')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr
withStochasticProcess :: GenStochasticProcess p -> (Ptr CStochasticProcess' -> IO b) -> IO b
withStochasticProcess :: forall p b.
GenStochasticProcess p -> (Ptr CStochasticProcess' -> IO b) -> IO b
withStochasticProcess = GenForeignPtr p CStochasticProcess'
-> (Ptr CStochasticProcess' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr p CStochasticProcess'
 -> (Ptr CStochasticProcess' -> IO b) -> IO b)
-> (GenStochasticProcess p -> GenForeignPtr p CStochasticProcess')
-> GenStochasticProcess p
-> (Ptr CStochasticProcess' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
forall p.
GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
getStochasticProcess
withGenStochasticProcess :: GenStochasticProcess (ForeignPtr p) -> (Ptr p -> IO b) -> IO b
withGenStochasticProcess :: forall p b.
GenStochasticProcess (ForeignPtr p) -> (Ptr p -> IO b) -> IO b
withGenStochasticProcess = ForeignPtr p -> (Ptr p -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr p -> (Ptr p -> IO b) -> IO b)
-> (GenStochasticProcess (ForeignPtr p) -> ForeignPtr p)
-> GenStochasticProcess (ForeignPtr p)
-> (Ptr p -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr p) CStochasticProcess' -> ForeignPtr p
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr p) CStochasticProcess' -> ForeignPtr p)
-> (GenStochasticProcess (ForeignPtr p)
    -> GenForeignPtr (ForeignPtr p) CStochasticProcess')
-> GenStochasticProcess (ForeignPtr p)
-> ForeignPtr p
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenStochasticProcess (ForeignPtr p)
-> GenForeignPtr (ForeignPtr p) CStochasticProcess'
forall p.
GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
getStochasticProcess
peekExtOUWithJumpsProcess :: Ptr CExtOUWithJumpsProcess' -> IO ExtOUWithJumpsProcess
peekExtOUWithJumpsProcess :: Ptr CExtOUWithJumpsProcess' -> IO ExtOUWithJumpsProcess
peekExtOUWithJumpsProcess = GenForeignPtr CExtOUWithJumpsProcess CStochasticProcess'
-> ExtOUWithJumpsProcess
forall p.
GenForeignPtr p CStochasticProcess' -> GenStochasticProcess p
GenStochasticProcess (GenForeignPtr CExtOUWithJumpsProcess CStochasticProcess'
 -> ExtOUWithJumpsProcess)
-> (Ptr CExtOUWithJumpsProcess'
    -> IO (GenForeignPtr CExtOUWithJumpsProcess CStochasticProcess'))
-> Ptr CExtOUWithJumpsProcess'
-> IO ExtOUWithJumpsProcess
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CExtOUWithJumpsProcess'
-> IO (GenForeignPtr CExtOUWithJumpsProcess CStochasticProcess')
Ptr CExtOUWithJumpsProcess'
-> IO
     (GenForeignPtr
        CExtOUWithJumpsProcess (Base CExtOUWithJumpsProcess'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekGJRGARCHProcess :: Ptr CGJRGARCHProcess' -> IO GJRGARCHProcess
peekGJRGARCHProcess :: Ptr CGJRGARCHProcess' -> IO GJRGARCHProcess
peekGJRGARCHProcess = GenForeignPtr CGJRGARCHProcess CStochasticProcess'
-> GJRGARCHProcess
forall p.
GenForeignPtr p CStochasticProcess' -> GenStochasticProcess p
GenStochasticProcess (GenForeignPtr CGJRGARCHProcess CStochasticProcess'
 -> GJRGARCHProcess)
-> (Ptr CGJRGARCHProcess'
    -> IO (GenForeignPtr CGJRGARCHProcess CStochasticProcess'))
-> Ptr CGJRGARCHProcess'
-> IO GJRGARCHProcess
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CGJRGARCHProcess'
-> IO (GenForeignPtr CGJRGARCHProcess CStochasticProcess')
Ptr CGJRGARCHProcess'
-> IO (GenForeignPtr CGJRGARCHProcess (Base CGJRGARCHProcess'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekHybridHestonHullWhiteProcess :: Ptr CHybridHestonHullWhiteProcess' -> IO HybridHestonHullWhiteProcess
peekHybridHestonHullWhiteProcess :: Ptr CHybridHestonHullWhiteProcess'
-> IO HybridHestonHullWhiteProcess
peekHybridHestonHullWhiteProcess = GenForeignPtr CHybridHestonHullWhiteProcess CStochasticProcess'
-> HybridHestonHullWhiteProcess
forall p.
GenForeignPtr p CStochasticProcess' -> GenStochasticProcess p
GenStochasticProcess (GenForeignPtr CHybridHestonHullWhiteProcess CStochasticProcess'
 -> HybridHestonHullWhiteProcess)
-> (Ptr CHybridHestonHullWhiteProcess'
    -> IO
         (GenForeignPtr CHybridHestonHullWhiteProcess CStochasticProcess'))
-> Ptr CHybridHestonHullWhiteProcess'
-> IO HybridHestonHullWhiteProcess
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CHybridHestonHullWhiteProcess'
-> IO
     (GenForeignPtr CHybridHestonHullWhiteProcess CStochasticProcess')
Ptr CHybridHestonHullWhiteProcess'
-> IO
     (GenForeignPtr
        CHybridHestonHullWhiteProcess
        (Base CHybridHestonHullWhiteProcess'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekKlugeExtOUProcess :: Ptr CKlugeExtOUProcess' -> IO KlugeExtOUProcess
peekKlugeExtOUProcess :: Ptr CKlugeExtOUProcess' -> IO KlugeExtOUProcess
peekKlugeExtOUProcess = GenForeignPtr CKlugeExtOUProcess CStochasticProcess'
-> KlugeExtOUProcess
forall p.
GenForeignPtr p CStochasticProcess' -> GenStochasticProcess p
GenStochasticProcess (GenForeignPtr CKlugeExtOUProcess CStochasticProcess'
 -> KlugeExtOUProcess)
-> (Ptr CKlugeExtOUProcess'
    -> IO (GenForeignPtr CKlugeExtOUProcess CStochasticProcess'))
-> Ptr CKlugeExtOUProcess'
-> IO KlugeExtOUProcess
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CKlugeExtOUProcess'
-> IO (GenForeignPtr CKlugeExtOUProcess CStochasticProcess')
Ptr CKlugeExtOUProcess'
-> IO (GenForeignPtr CKlugeExtOUProcess (Base CKlugeExtOUProcess'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekLiborForwardModelProcess :: Ptr CLiborForwardModelProcess' -> IO LiborForwardModelProcess
peekLiborForwardModelProcess :: Ptr CLiborForwardModelProcess' -> IO LiborForwardModelProcess
peekLiborForwardModelProcess = GenForeignPtr CLiborForwardModelProcess CStochasticProcess'
-> LiborForwardModelProcess
forall p.
GenForeignPtr p CStochasticProcess' -> GenStochasticProcess p
GenStochasticProcess (GenForeignPtr CLiborForwardModelProcess CStochasticProcess'
 -> LiborForwardModelProcess)
-> (Ptr CLiborForwardModelProcess'
    -> IO
         (GenForeignPtr CLiborForwardModelProcess CStochasticProcess'))
-> Ptr CLiborForwardModelProcess'
-> IO LiborForwardModelProcess
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CLiborForwardModelProcess'
-> IO (GenForeignPtr CLiborForwardModelProcess CStochasticProcess')
Ptr CLiborForwardModelProcess'
-> IO
     (GenForeignPtr
        CLiborForwardModelProcess (Base CLiborForwardModelProcess'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekStochasticProcessArray :: Ptr CStochasticProcessArray' -> IO StochasticProcessArray
peekStochasticProcessArray :: Ptr CStochasticProcessArray' -> IO StochasticProcessArray
peekStochasticProcessArray = GenForeignPtr CStochasticProcessArray CStochasticProcess'
-> StochasticProcessArray
forall p.
GenForeignPtr p CStochasticProcess' -> GenStochasticProcess p
GenStochasticProcess (GenForeignPtr CStochasticProcessArray CStochasticProcess'
 -> StochasticProcessArray)
-> (Ptr CStochasticProcessArray'
    -> IO (GenForeignPtr CStochasticProcessArray CStochasticProcess'))
-> Ptr CStochasticProcessArray'
-> IO StochasticProcessArray
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CStochasticProcessArray'
-> IO (GenForeignPtr CStochasticProcessArray CStochasticProcess')
Ptr CStochasticProcessArray'
-> IO
     (GenForeignPtr
        CStochasticProcessArray (Base CStochasticProcessArray'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekG2Process :: Ptr CG2Process' -> IO G2Process
peekG2Process :: Ptr CG2Process' -> IO G2Process
peekG2Process = GenForeignPtr CG2Process CStochasticProcess' -> G2Process
forall p.
GenForeignPtr p CStochasticProcess' -> GenStochasticProcess p
GenStochasticProcess (GenForeignPtr CG2Process CStochasticProcess' -> G2Process)
-> (Ptr CG2Process'
    -> IO (GenForeignPtr CG2Process CStochasticProcess'))
-> Ptr CG2Process'
-> IO G2Process
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CG2Process'
-> IO (GenForeignPtr CG2Process CStochasticProcess')
Ptr CG2Process' -> IO (GenForeignPtr CG2Process (Base CG2Process'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekG2ForwardProcess :: Ptr CG2ForwardProcess' -> IO G2ForwardProcess
peekG2ForwardProcess :: Ptr CG2ForwardProcess' -> IO G2ForwardProcess
peekG2ForwardProcess = GenForeignPtr CG2ForwardProcess CStochasticProcess'
-> G2ForwardProcess
forall p.
GenForeignPtr p CStochasticProcess' -> GenStochasticProcess p
GenStochasticProcess (GenForeignPtr CG2ForwardProcess CStochasticProcess'
 -> G2ForwardProcess)
-> (Ptr CG2ForwardProcess'
    -> IO (GenForeignPtr CG2ForwardProcess CStochasticProcess'))
-> Ptr CG2ForwardProcess'
-> IO G2ForwardProcess
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CG2ForwardProcess'
-> IO (GenForeignPtr CG2ForwardProcess CStochasticProcess')
Ptr CG2ForwardProcess'
-> IO (GenForeignPtr CG2ForwardProcess (Base CG2ForwardProcess'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
asHestonProcess :: GenHestonProcess hp -> IO HestonProcess
asHestonProcess :: forall hp. GenHestonProcess hp -> IO HestonProcess
asHestonProcess = (Ptr CHestonProcess' -> IO HestonProcess)
-> GenForeignPtr hp CHestonProcess' -> IO HestonProcess
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CHestonProcess' -> IO HestonProcess
peekHestonProcess (GenForeignPtr hp CHestonProcess' -> IO HestonProcess)
-> (GenHestonProcess hp -> GenForeignPtr hp CHestonProcess')
-> GenHestonProcess hp
-> IO HestonProcess
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CHestonProcess' hp) CStochasticProcess'
-> GenForeignPtr hp CHestonProcess'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CHestonProcess' hp) CStochasticProcess'
 -> GenForeignPtr hp CHestonProcess')
-> (GenHestonProcess hp
    -> GenForeignPtr (AnyOf CHestonProcess' hp) CStochasticProcess')
-> GenHestonProcess hp
-> GenForeignPtr hp CHestonProcess'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenHestonProcess hp
-> GenForeignPtr (AnyOf CHestonProcess' hp) CStochasticProcess'
forall p.
GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
getStochasticProcess
peekHestonProcess :: Ptr CHestonProcess' -> IO HestonProcess
peekHestonProcess :: Ptr CHestonProcess' -> IO HestonProcess
peekHestonProcess = Ptr CHestonProcess'
-> IO (GenForeignPtr (ForeignPtr CHestonProcess') CHestonProcess')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CHestonProcess'
 -> IO (GenForeignPtr (ForeignPtr CHestonProcess') CHestonProcess'))
-> (GenForeignPtr (ForeignPtr CHestonProcess') CHestonProcess'
    -> IO HestonProcess)
-> Ptr CHestonProcess'
-> IO HestonProcess
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CHestonProcess') CHestonProcess'
-> IO HestonProcess
forall hp.
GenForeignPtr hp CHestonProcess' -> IO (GenHestonProcess hp)
newGenHestonProcess
withHestonProcess :: GenHestonProcess hp -> (Ptr CHestonProcess' -> IO b) -> IO b
withHestonProcess :: forall hp b.
GenHestonProcess hp -> (Ptr CHestonProcess' -> IO b) -> IO b
withHestonProcess = GenForeignPtr hp CHestonProcess'
-> (Ptr CHestonProcess' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr hp CHestonProcess'
 -> (Ptr CHestonProcess' -> IO b) -> IO b)
-> (GenHestonProcess hp -> GenForeignPtr hp CHestonProcess')
-> GenHestonProcess hp
-> (Ptr CHestonProcess' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CHestonProcess' hp) CStochasticProcess'
-> GenForeignPtr hp CHestonProcess'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CHestonProcess' hp) CStochasticProcess'
 -> GenForeignPtr hp CHestonProcess')
-> (GenHestonProcess hp
    -> GenForeignPtr (AnyOf CHestonProcess' hp) CStochasticProcess')
-> GenHestonProcess hp
-> GenForeignPtr hp CHestonProcess'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenHestonProcess hp
-> GenForeignPtr (AnyOf CHestonProcess' hp) CStochasticProcess'
forall p.
GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
getStochasticProcess
newGenHestonProcess :: GenForeignPtr hp CHestonProcess' -> IO (GenHestonProcess hp)
newGenHestonProcess :: forall hp.
GenForeignPtr hp CHestonProcess' -> IO (GenHestonProcess hp)
newGenHestonProcess = GenHestonProcess hp -> IO (GenHestonProcess hp)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenHestonProcess hp -> IO (GenHestonProcess hp))
-> (GenForeignPtr hp CHestonProcess' -> GenHestonProcess hp)
-> GenForeignPtr hp CHestonProcess'
-> IO (GenHestonProcess hp)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CHestonProcess' hp) CStochasticProcess'
-> GenHestonProcess hp
forall p.
GenForeignPtr p CStochasticProcess' -> GenStochasticProcess p
GenStochasticProcess (GenForeignPtr (AnyOf CHestonProcess' hp) CStochasticProcess'
 -> GenHestonProcess hp)
-> (GenForeignPtr hp CHestonProcess'
    -> GenForeignPtr (AnyOf CHestonProcess' hp) CStochasticProcess')
-> GenForeignPtr hp CHestonProcess'
-> GenHestonProcess hp
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr hp CHestonProcess'
-> GenForeignPtr (AnyOf CHestonProcess' hp) CStochasticProcess'
GenForeignPtr hp CHestonProcess'
-> GenForeignPtr (AnyOf CHestonProcess' hp) (Base CHestonProcess')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekHestonSLVProcess :: Ptr CHestonSLVProcess' -> IO HestonSLVProcess
peekHestonSLVProcess :: Ptr CHestonSLVProcess' -> IO HestonSLVProcess
peekHestonSLVProcess = GenForeignPtr CHestonSLVProcess CStochasticProcess'
-> HestonSLVProcess
forall p.
GenForeignPtr p CStochasticProcess' -> GenStochasticProcess p
GenStochasticProcess (GenForeignPtr CHestonSLVProcess CStochasticProcess'
 -> HestonSLVProcess)
-> (Ptr CHestonSLVProcess'
    -> IO (GenForeignPtr CHestonSLVProcess CStochasticProcess'))
-> Ptr CHestonSLVProcess'
-> IO HestonSLVProcess
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CHestonSLVProcess'
-> IO (GenForeignPtr CHestonSLVProcess CStochasticProcess')
Ptr CHestonSLVProcess'
-> IO (GenForeignPtr CHestonSLVProcess (Base CHestonSLVProcess'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
withHestonSLVProcess :: HestonSLVProcess -> (Ptr CHestonSLVProcess' -> IO b) -> IO b
withHestonSLVProcess :: forall b.
HestonSLVProcess -> (Ptr CHestonSLVProcess' -> IO b) -> IO b
withHestonSLVProcess = CHestonSLVProcess -> (Ptr CHestonSLVProcess' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (CHestonSLVProcess -> (Ptr CHestonSLVProcess' -> IO b) -> IO b)
-> (HestonSLVProcess -> CHestonSLVProcess)
-> HestonSLVProcess
-> (Ptr CHestonSLVProcess' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr CHestonSLVProcess CStochasticProcess'
-> CHestonSLVProcess
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr CHestonSLVProcess CStochasticProcess'
 -> CHestonSLVProcess)
-> (HestonSLVProcess
    -> GenForeignPtr CHestonSLVProcess CStochasticProcess')
-> HestonSLVProcess
-> CHestonSLVProcess
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HestonSLVProcess
-> GenForeignPtr CHestonSLVProcess CStochasticProcess'
forall p.
GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
getStochasticProcess
peekGenHestonProcess :: (Finalizable hp, Upcastable hp, Base hp ~ CHestonProcess') => Ptr hp -> IO (GenHestonProcess (ForeignPtr hp))
peekGenHestonProcess :: forall hp.
(Finalizable hp, Upcastable hp, Base hp ~ CHestonProcess') =>
Ptr hp -> IO (GenHestonProcess (ForeignPtr hp))
peekGenHestonProcess = Ptr hp -> IO (GenForeignPtr (ForeignPtr hp) CHestonProcess')
Ptr hp -> IO (GenForeignPtr (ForeignPtr hp) (Base hp))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr hp -> IO (GenForeignPtr (ForeignPtr hp) CHestonProcess'))
-> (GenForeignPtr (ForeignPtr hp) CHestonProcess'
    -> IO (GenHestonProcess (ForeignPtr hp)))
-> Ptr hp
-> IO (GenHestonProcess (ForeignPtr hp))
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr hp) CHestonProcess'
-> IO (GenHestonProcess (ForeignPtr hp))
forall hp.
GenForeignPtr hp CHestonProcess' -> IO (GenHestonProcess hp)
newGenHestonProcess
asStochasticProcess1D :: GenStochasticProcess1D p1d -> IO StochasticProcess1D
asStochasticProcess1D :: forall p1d. GenStochasticProcess1D p1d -> IO StochasticProcess1D
asStochasticProcess1D = (Ptr CStochasticProcess1D' -> IO StochasticProcess1D)
-> GenForeignPtr p1d CStochasticProcess1D'
-> IO StochasticProcess1D
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CStochasticProcess1D' -> IO StochasticProcess1D
peekStochasticProcess1D (GenForeignPtr p1d CStochasticProcess1D' -> IO StochasticProcess1D)
-> (GenStochasticProcess1D p1d
    -> GenForeignPtr p1d CStochasticProcess1D')
-> GenStochasticProcess1D p1d
-> IO StochasticProcess1D
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CStochasticProcess1D' p1d) CStochasticProcess'
-> GenForeignPtr p1d CStochasticProcess1D'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CStochasticProcess1D' p1d) CStochasticProcess'
 -> GenForeignPtr p1d CStochasticProcess1D')
-> (GenStochasticProcess1D p1d
    -> GenForeignPtr
         (AnyOf CStochasticProcess1D' p1d) CStochasticProcess')
-> GenStochasticProcess1D p1d
-> GenForeignPtr p1d CStochasticProcess1D'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenStochasticProcess1D p1d
-> GenForeignPtr
     (AnyOf CStochasticProcess1D' p1d) CStochasticProcess'
forall p.
GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
getStochasticProcess
peekStochasticProcess1D :: Ptr CStochasticProcess1D' -> IO StochasticProcess1D
peekStochasticProcess1D :: Ptr CStochasticProcess1D' -> IO StochasticProcess1D
peekStochasticProcess1D = Ptr CStochasticProcess1D'
-> IO
     (GenForeignPtr
        (ForeignPtr CStochasticProcess1D') CStochasticProcess1D')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CStochasticProcess1D'
 -> IO
      (GenForeignPtr
         (ForeignPtr CStochasticProcess1D') CStochasticProcess1D'))
-> (GenForeignPtr
      (ForeignPtr CStochasticProcess1D') CStochasticProcess1D'
    -> IO StochasticProcess1D)
-> Ptr CStochasticProcess1D'
-> IO StochasticProcess1D
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CStochasticProcess1D') CStochasticProcess1D'
-> IO StochasticProcess1D
forall p1d.
GenForeignPtr p1d CStochasticProcess1D'
-> IO (GenStochasticProcess1D p1d)
newGenStochasticProcess1D
withStochasticProcess1D :: GenStochasticProcess1D p1d -> (Ptr CStochasticProcess1D' -> IO b) -> IO b
withStochasticProcess1D :: forall p1d b.
GenStochasticProcess1D p1d
-> (Ptr CStochasticProcess1D' -> IO b) -> IO b
withStochasticProcess1D = GenForeignPtr p1d CStochasticProcess1D'
-> (Ptr CStochasticProcess1D' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr p1d CStochasticProcess1D'
 -> (Ptr CStochasticProcess1D' -> IO b) -> IO b)
-> (GenStochasticProcess1D p1d
    -> GenForeignPtr p1d CStochasticProcess1D')
-> GenStochasticProcess1D p1d
-> (Ptr CStochasticProcess1D' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CStochasticProcess1D' p1d) CStochasticProcess'
-> GenForeignPtr p1d CStochasticProcess1D'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CStochasticProcess1D' p1d) CStochasticProcess'
 -> GenForeignPtr p1d CStochasticProcess1D')
-> (GenStochasticProcess1D p1d
    -> GenForeignPtr
         (AnyOf CStochasticProcess1D' p1d) CStochasticProcess')
-> GenStochasticProcess1D p1d
-> GenForeignPtr p1d CStochasticProcess1D'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenStochasticProcess1D p1d
-> GenForeignPtr
     (AnyOf CStochasticProcess1D' p1d) CStochasticProcess'
forall p.
GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
getStochasticProcess
withStochasticProcess1DArray :: [GenStochasticProcess1D p1d] -> ((CUInt, Ptr (Ptr CStochasticProcess1D')) -> IO b) -> IO b
withStochasticProcess1DArray :: forall p1d b.
[GenStochasticProcess1D p1d]
-> ((CUInt, Ptr (Ptr CStochasticProcess1D')) -> IO b) -> IO b
withStochasticProcess1DArray = (GenStochasticProcess1D p1d
 -> (Ptr CStochasticProcess1D' -> IO b) -> IO b)
-> [GenStochasticProcess1D p1d]
-> ((CUInt, Ptr (Ptr CStochasticProcess1D')) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray GenStochasticProcess1D p1d
-> (Ptr CStochasticProcess1D' -> IO b) -> IO b
forall p1d b.
GenStochasticProcess1D p1d
-> (Ptr CStochasticProcess1D' -> IO b) -> IO b
withStochasticProcess1D
newGenStochasticProcess1D :: GenForeignPtr p1d CStochasticProcess1D' -> IO (GenStochasticProcess1D p1d)
newGenStochasticProcess1D :: forall p1d.
GenForeignPtr p1d CStochasticProcess1D'
-> IO (GenStochasticProcess1D p1d)
newGenStochasticProcess1D = GenStochasticProcess1D p1d -> IO (GenStochasticProcess1D p1d)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenStochasticProcess1D p1d -> IO (GenStochasticProcess1D p1d))
-> (GenForeignPtr p1d CStochasticProcess1D'
    -> GenStochasticProcess1D p1d)
-> GenForeignPtr p1d CStochasticProcess1D'
-> IO (GenStochasticProcess1D p1d)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CStochasticProcess1D' p1d) CStochasticProcess'
-> GenStochasticProcess1D p1d
forall p.
GenForeignPtr p CStochasticProcess' -> GenStochasticProcess p
GenStochasticProcess (GenForeignPtr
   (AnyOf CStochasticProcess1D' p1d) CStochasticProcess'
 -> GenStochasticProcess1D p1d)
-> (GenForeignPtr p1d CStochasticProcess1D'
    -> GenForeignPtr
         (AnyOf CStochasticProcess1D' p1d) CStochasticProcess')
-> GenForeignPtr p1d CStochasticProcess1D'
-> GenStochasticProcess1D p1d
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr p1d CStochasticProcess1D'
-> GenForeignPtr
     (AnyOf CStochasticProcess1D' p1d) CStochasticProcess'
GenForeignPtr p1d CStochasticProcess1D'
-> GenForeignPtr
     (AnyOf CStochasticProcess1D' p1d) (Base CStochasticProcess1D')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekGenStochasticProcess1D :: (Finalizable p1d, Upcastable p1d, Base p1d ~ CStochasticProcess1D') => Ptr p1d -> IO (GenStochasticProcess1D (ForeignPtr p1d))
peekGenStochasticProcess1D :: forall p1d.
(Finalizable p1d, Upcastable p1d,
 Base p1d ~ CStochasticProcess1D') =>
Ptr p1d -> IO (GenStochasticProcess1D (ForeignPtr p1d))
peekGenStochasticProcess1D = Ptr p1d
-> IO (GenForeignPtr (ForeignPtr p1d) CStochasticProcess1D')
Ptr p1d -> IO (GenForeignPtr (ForeignPtr p1d) (Base p1d))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr p1d
 -> IO (GenForeignPtr (ForeignPtr p1d) CStochasticProcess1D'))
-> (GenForeignPtr (ForeignPtr p1d) CStochasticProcess1D'
    -> IO (GenStochasticProcess1D (ForeignPtr p1d)))
-> Ptr p1d
-> IO (GenStochasticProcess1D (ForeignPtr p1d))
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr p1d) CStochasticProcess1D'
-> IO (GenStochasticProcess1D (ForeignPtr p1d))
forall p1d.
GenForeignPtr p1d CStochasticProcess1D'
-> IO (GenStochasticProcess1D p1d)
newGenStochasticProcess1D
withGenStochasticProcess1D :: GenStochasticProcess1D (ForeignPtr p1d) -> (Ptr p1d -> IO b) -> IO b
withGenStochasticProcess1D :: forall p1d b.
GenStochasticProcess1D (ForeignPtr p1d)
-> (Ptr p1d -> IO b) -> IO b
withGenStochasticProcess1D = ForeignPtr p1d -> (Ptr p1d -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr p1d -> (Ptr p1d -> IO b) -> IO b)
-> (GenStochasticProcess1D (ForeignPtr p1d) -> ForeignPtr p1d)
-> GenStochasticProcess1D (ForeignPtr p1d)
-> (Ptr p1d -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr p1d) CStochasticProcess1D'
-> ForeignPtr p1d
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr p1d) CStochasticProcess1D'
 -> ForeignPtr p1d)
-> (GenStochasticProcess1D (ForeignPtr p1d)
    -> GenForeignPtr (ForeignPtr p1d) CStochasticProcess1D')
-> GenStochasticProcess1D (ForeignPtr p1d)
-> ForeignPtr p1d
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CStochasticProcess1D' (ForeignPtr p1d)) CStochasticProcess'
-> GenForeignPtr (ForeignPtr p1d) CStochasticProcess1D'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CStochasticProcess1D' (ForeignPtr p1d)) CStochasticProcess'
 -> GenForeignPtr (ForeignPtr p1d) CStochasticProcess1D')
-> (GenStochasticProcess1D (ForeignPtr p1d)
    -> GenForeignPtr
         (AnyOf CStochasticProcess1D' (ForeignPtr p1d)) CStochasticProcess')
-> GenStochasticProcess1D (ForeignPtr p1d)
-> GenForeignPtr (ForeignPtr p1d) CStochasticProcess1D'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenStochasticProcess1D (ForeignPtr p1d)
-> GenForeignPtr
     (AnyOf CStochasticProcess1D' (ForeignPtr p1d)) CStochasticProcess'
forall p.
GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
getStochasticProcess
peekBatesProcess :: Ptr CBatesProcess' -> IO BatesProcess
peekBatesProcess :: Ptr CBatesProcess' -> IO BatesProcess
peekBatesProcess = Ptr CBatesProcess' -> IO BatesProcess
forall hp.
(Finalizable hp, Upcastable hp, Base hp ~ CHestonProcess') =>
Ptr hp -> IO (GenHestonProcess (ForeignPtr hp))
peekGenHestonProcess
withBatesProcess :: BatesProcess -> (Ptr CBatesProcess' -> IO b) -> IO b
withBatesProcess :: forall b. BatesProcess -> (Ptr CBatesProcess' -> IO b) -> IO b
withBatesProcess = ForeignPtr CBatesProcess' -> (Ptr CBatesProcess' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CBatesProcess' -> (Ptr CBatesProcess' -> IO b) -> IO b)
-> (BatesProcess -> ForeignPtr CBatesProcess')
-> BatesProcess
-> (Ptr CBatesProcess' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CBatesProcess') CHestonProcess'
-> ForeignPtr CBatesProcess'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CBatesProcess') CHestonProcess'
 -> ForeignPtr CBatesProcess')
-> (BatesProcess
    -> GenForeignPtr (ForeignPtr CBatesProcess') CHestonProcess')
-> BatesProcess
-> ForeignPtr CBatesProcess'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CHestonProcess' (ForeignPtr CBatesProcess'))
  CStochasticProcess'
-> GenForeignPtr (ForeignPtr CBatesProcess') CHestonProcess'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CHestonProcess' (ForeignPtr CBatesProcess'))
   CStochasticProcess'
 -> GenForeignPtr (ForeignPtr CBatesProcess') CHestonProcess')
-> (BatesProcess
    -> GenForeignPtr
         (AnyOf CHestonProcess' (ForeignPtr CBatesProcess'))
         CStochasticProcess')
-> BatesProcess
-> GenForeignPtr (ForeignPtr CBatesProcess') CHestonProcess'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BatesProcess
-> GenForeignPtr
     (AnyOf CHestonProcess' (ForeignPtr CBatesProcess'))
     CStochasticProcess'
forall p.
GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
getStochasticProcess
peekExtendedOrnsteinUhlenbeckProcess :: Ptr CExtendedOrnsteinUhlenbeckProcess' -> IO ExtendedOrnsteinUhlenbeckProcess
peekExtendedOrnsteinUhlenbeckProcess :: Ptr CExtendedOrnsteinUhlenbeckProcess'
-> IO ExtendedOrnsteinUhlenbeckProcess
peekExtendedOrnsteinUhlenbeckProcess = Ptr CExtendedOrnsteinUhlenbeckProcess'
-> IO ExtendedOrnsteinUhlenbeckProcess
forall p1d.
(Finalizable p1d, Upcastable p1d,
 Base p1d ~ CStochasticProcess1D') =>
Ptr p1d -> IO (GenStochasticProcess1D (ForeignPtr p1d))
peekGenStochasticProcess1D
peekHullWhiteForwardProcess :: Ptr CHullWhiteForwardProcess' -> IO HullWhiteForwardProcess
peekHullWhiteForwardProcess :: Ptr CHullWhiteForwardProcess' -> IO HullWhiteForwardProcess
peekHullWhiteForwardProcess = Ptr CHullWhiteForwardProcess' -> IO HullWhiteForwardProcess
forall p1d.
(Finalizable p1d, Upcastable p1d,
 Base p1d ~ CStochasticProcess1D') =>
Ptr p1d -> IO (GenStochasticProcess1D (ForeignPtr p1d))
peekGenStochasticProcess1D
peekHullWhiteProcess :: Ptr CHullWhiteProcess' -> IO HullWhiteProcess
peekHullWhiteProcess :: Ptr CHullWhiteProcess' -> IO HullWhiteProcess
peekHullWhiteProcess = Ptr CHullWhiteProcess' -> IO HullWhiteProcess
forall p1d.
(Finalizable p1d, Upcastable p1d,
 Base p1d ~ CStochasticProcess1D') =>
Ptr p1d -> IO (GenStochasticProcess1D (ForeignPtr p1d))
peekGenStochasticProcess1D
peekMerton76Process :: Ptr CMerton76Process' -> IO Merton76Process
peekMerton76Process :: Ptr CMerton76Process' -> IO Merton76Process
peekMerton76Process = Ptr CMerton76Process' -> IO Merton76Process
forall p1d.
(Finalizable p1d, Upcastable p1d,
 Base p1d ~ CStochasticProcess1D') =>
Ptr p1d -> IO (GenStochasticProcess1D (ForeignPtr p1d))
peekGenStochasticProcess1D
peekVarianceGammaProcess :: Ptr CVarianceGammaProcess' -> IO VarianceGammaProcess
peekVarianceGammaProcess :: Ptr CVarianceGammaProcess' -> IO VarianceGammaProcess
peekVarianceGammaProcess = Ptr CVarianceGammaProcess' -> IO VarianceGammaProcess
forall p1d.
(Finalizable p1d, Upcastable p1d,
 Base p1d ~ CStochasticProcess1D') =>
Ptr p1d -> IO (GenStochasticProcess1D (ForeignPtr p1d))
peekGenStochasticProcess1D
asGeneralizedBlackScholesProcess :: GenGeneralizedBlackScholesProcess gbs -> IO GeneralizedBlackScholesProcess
asGeneralizedBlackScholesProcess :: forall gbs.
GenGeneralizedBlackScholesProcess gbs
-> IO GeneralizedBlackScholesProcess
asGeneralizedBlackScholesProcess = (Ptr CGeneralizedBlackScholesProcess'
 -> IO GeneralizedBlackScholesProcess)
-> GenForeignPtr gbs CGeneralizedBlackScholesProcess'
-> IO GeneralizedBlackScholesProcess
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CGeneralizedBlackScholesProcess'
-> IO GeneralizedBlackScholesProcess
peekGeneralizedBlackScholesProcess (GenForeignPtr gbs CGeneralizedBlackScholesProcess'
 -> IO GeneralizedBlackScholesProcess)
-> (GenGeneralizedBlackScholesProcess gbs
    -> GenForeignPtr gbs CGeneralizedBlackScholesProcess')
-> GenGeneralizedBlackScholesProcess gbs
-> IO GeneralizedBlackScholesProcess
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D'
-> GenForeignPtr gbs CGeneralizedBlackScholesProcess'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D'
 -> GenForeignPtr gbs CGeneralizedBlackScholesProcess')
-> (GenGeneralizedBlackScholesProcess gbs
    -> GenForeignPtr
         (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D')
-> GenGeneralizedBlackScholesProcess gbs
-> GenForeignPtr gbs CGeneralizedBlackScholesProcess'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
  CStochasticProcess'
-> GenForeignPtr
     (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
   CStochasticProcess'
 -> GenForeignPtr
      (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D')
-> (GenGeneralizedBlackScholesProcess gbs
    -> GenForeignPtr
         (AnyOf
            CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
         CStochasticProcess')
-> GenGeneralizedBlackScholesProcess gbs
-> GenForeignPtr
     (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenGeneralizedBlackScholesProcess gbs
-> GenForeignPtr
     (AnyOf
        CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
     CStochasticProcess'
forall p.
GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
getStochasticProcess
peekGeneralizedBlackScholesProcess :: Ptr CGeneralizedBlackScholesProcess' -> IO GeneralizedBlackScholesProcess
peekGeneralizedBlackScholesProcess :: Ptr CGeneralizedBlackScholesProcess'
-> IO GeneralizedBlackScholesProcess
peekGeneralizedBlackScholesProcess = Ptr CGeneralizedBlackScholesProcess'
-> IO
     (GenForeignPtr
        (ForeignPtr CGeneralizedBlackScholesProcess')
        CGeneralizedBlackScholesProcess')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CGeneralizedBlackScholesProcess'
 -> IO
      (GenForeignPtr
         (ForeignPtr CGeneralizedBlackScholesProcess')
         CGeneralizedBlackScholesProcess'))
-> (GenForeignPtr
      (ForeignPtr CGeneralizedBlackScholesProcess')
      CGeneralizedBlackScholesProcess'
    -> IO GeneralizedBlackScholesProcess)
-> Ptr CGeneralizedBlackScholesProcess'
-> IO GeneralizedBlackScholesProcess
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CGeneralizedBlackScholesProcess')
  CGeneralizedBlackScholesProcess'
-> IO GeneralizedBlackScholesProcess
forall gbs.
GenForeignPtr gbs CGeneralizedBlackScholesProcess'
-> IO (GenGeneralizedBlackScholesProcess gbs)
newGenGeneralizedBlackScholesProcess
withGeneralizedBlackScholesProcess :: GenGeneralizedBlackScholesProcess gbs -> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
withGeneralizedBlackScholesProcess :: forall gbs b.
GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
withGeneralizedBlackScholesProcess = GenForeignPtr gbs CGeneralizedBlackScholesProcess'
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr gbs CGeneralizedBlackScholesProcess'
 -> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b)
-> (GenGeneralizedBlackScholesProcess gbs
    -> GenForeignPtr gbs CGeneralizedBlackScholesProcess')
-> GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D'
-> GenForeignPtr gbs CGeneralizedBlackScholesProcess'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D'
 -> GenForeignPtr gbs CGeneralizedBlackScholesProcess')
-> (GenGeneralizedBlackScholesProcess gbs
    -> GenForeignPtr
         (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D')
-> GenGeneralizedBlackScholesProcess gbs
-> GenForeignPtr gbs CGeneralizedBlackScholesProcess'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
  CStochasticProcess'
-> GenForeignPtr
     (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
   CStochasticProcess'
 -> GenForeignPtr
      (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D')
-> (GenGeneralizedBlackScholesProcess gbs
    -> GenForeignPtr
         (AnyOf
            CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
         CStochasticProcess')
-> GenGeneralizedBlackScholesProcess gbs
-> GenForeignPtr
     (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenGeneralizedBlackScholesProcess gbs
-> GenForeignPtr
     (AnyOf
        CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
     CStochasticProcess'
forall p.
GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
getStochasticProcess
newGenGeneralizedBlackScholesProcess :: GenForeignPtr gbs CGeneralizedBlackScholesProcess' -> IO (GenGeneralizedBlackScholesProcess gbs)
newGenGeneralizedBlackScholesProcess :: forall gbs.
GenForeignPtr gbs CGeneralizedBlackScholesProcess'
-> IO (GenGeneralizedBlackScholesProcess gbs)
newGenGeneralizedBlackScholesProcess = GenGeneralizedBlackScholesProcess gbs
-> IO (GenGeneralizedBlackScholesProcess gbs)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenGeneralizedBlackScholesProcess gbs
 -> IO (GenGeneralizedBlackScholesProcess gbs))
-> (GenForeignPtr gbs CGeneralizedBlackScholesProcess'
    -> GenGeneralizedBlackScholesProcess gbs)
-> GenForeignPtr gbs CGeneralizedBlackScholesProcess'
-> IO (GenGeneralizedBlackScholesProcess gbs)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
  CStochasticProcess'
-> GenGeneralizedBlackScholesProcess gbs
forall p.
GenForeignPtr p CStochasticProcess' -> GenStochasticProcess p
GenStochasticProcess (GenForeignPtr
   (AnyOf
      CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
   CStochasticProcess'
 -> GenGeneralizedBlackScholesProcess gbs)
-> (GenForeignPtr gbs CGeneralizedBlackScholesProcess'
    -> GenForeignPtr
         (AnyOf
            CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
         CStochasticProcess')
-> GenForeignPtr gbs CGeneralizedBlackScholesProcess'
-> GenGeneralizedBlackScholesProcess gbs
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D'
-> GenForeignPtr
     (AnyOf
        CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
     CStochasticProcess'
GenForeignPtr
  (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D'
-> GenForeignPtr
     (AnyOf
        CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
     (Base CStochasticProcess1D')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr
   (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D'
 -> GenForeignPtr
      (AnyOf
         CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
      CStochasticProcess')
-> (GenForeignPtr gbs CGeneralizedBlackScholesProcess'
    -> GenForeignPtr
         (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D')
-> GenForeignPtr gbs CGeneralizedBlackScholesProcess'
-> GenForeignPtr
     (AnyOf
        CStochasticProcess1D' (AnyOf CGeneralizedBlackScholesProcess' gbs))
     CStochasticProcess'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr gbs CGeneralizedBlackScholesProcess'
-> GenForeignPtr
     (AnyOf CGeneralizedBlackScholesProcess' gbs) CStochasticProcess1D'
GenForeignPtr gbs CGeneralizedBlackScholesProcess'
-> GenForeignPtr
     (AnyOf CGeneralizedBlackScholesProcess' gbs)
     (Base CGeneralizedBlackScholesProcess')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
withGeneralizedBlackScholesProcessArray :: [GenGeneralizedBlackScholesProcess gbs] -> ((CUInt, Ptr (Ptr CGeneralizedBlackScholesProcess')) -> IO b) -> IO b
withGeneralizedBlackScholesProcessArray :: forall gbs b.
[GenGeneralizedBlackScholesProcess gbs]
-> ((CUInt, Ptr (Ptr CGeneralizedBlackScholesProcess')) -> IO b)
-> IO b
withGeneralizedBlackScholesProcessArray = (GenGeneralizedBlackScholesProcess gbs
 -> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b)
-> [GenGeneralizedBlackScholesProcess gbs]
-> ((CUInt, Ptr (Ptr CGeneralizedBlackScholesProcess')) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
forall gbs b.
GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
withGeneralizedBlackScholesProcess
peekBlackProcess :: Ptr CBlackProcess' -> IO BlackProcess
peekBlackProcess :: Ptr CBlackProcess' -> IO BlackProcess
peekBlackProcess = Ptr CBlackProcess'
-> IO
     (GenForeignPtr
        (ForeignPtr CBlackProcess') CGeneralizedBlackScholesProcess')
Ptr CBlackProcess'
-> IO
     (GenForeignPtr (ForeignPtr CBlackProcess') (Base CBlackProcess'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CBlackProcess'
 -> IO
      (GenForeignPtr
         (ForeignPtr CBlackProcess') CGeneralizedBlackScholesProcess'))
-> (GenForeignPtr
      (ForeignPtr CBlackProcess') CGeneralizedBlackScholesProcess'
    -> IO BlackProcess)
-> Ptr CBlackProcess'
-> IO BlackProcess
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CBlackProcess') CGeneralizedBlackScholesProcess'
-> IO BlackProcess
forall gbs.
GenForeignPtr gbs CGeneralizedBlackScholesProcess'
-> IO (GenGeneralizedBlackScholesProcess gbs)
newGenGeneralizedBlackScholesProcess
withBlackProcess :: BlackProcess -> (Ptr CBlackProcess' -> IO b) -> IO b
withBlackProcess :: forall b. BlackProcess -> (Ptr CBlackProcess' -> IO b) -> IO b
withBlackProcess = ForeignPtr CBlackProcess' -> (Ptr CBlackProcess' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CBlackProcess' -> (Ptr CBlackProcess' -> IO b) -> IO b)
-> (BlackProcess -> ForeignPtr CBlackProcess')
-> BlackProcess
-> (Ptr CBlackProcess' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CBlackProcess') CGeneralizedBlackScholesProcess'
-> ForeignPtr CBlackProcess'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CBlackProcess') CGeneralizedBlackScholesProcess'
 -> ForeignPtr CBlackProcess')
-> (BlackProcess
    -> GenForeignPtr
         (ForeignPtr CBlackProcess') CGeneralizedBlackScholesProcess')
-> BlackProcess
-> ForeignPtr CBlackProcess'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CGeneralizedBlackScholesProcess' (ForeignPtr CBlackProcess'))
  CStochasticProcess1D'
-> GenForeignPtr
     (ForeignPtr CBlackProcess') CGeneralizedBlackScholesProcess'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CGeneralizedBlackScholesProcess' (ForeignPtr CBlackProcess'))
   CStochasticProcess1D'
 -> GenForeignPtr
      (ForeignPtr CBlackProcess') CGeneralizedBlackScholesProcess')
-> (BlackProcess
    -> GenForeignPtr
         (AnyOf
            CGeneralizedBlackScholesProcess' (ForeignPtr CBlackProcess'))
         CStochasticProcess1D')
-> BlackProcess
-> GenForeignPtr
     (ForeignPtr CBlackProcess') CGeneralizedBlackScholesProcess'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CStochasticProcess1D'
     (AnyOf
        CGeneralizedBlackScholesProcess' (ForeignPtr CBlackProcess')))
  CStochasticProcess'
-> GenForeignPtr
     (AnyOf
        CGeneralizedBlackScholesProcess' (ForeignPtr CBlackProcess'))
     CStochasticProcess1D'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CStochasticProcess1D'
      (AnyOf
         CGeneralizedBlackScholesProcess' (ForeignPtr CBlackProcess')))
   CStochasticProcess'
 -> GenForeignPtr
      (AnyOf
         CGeneralizedBlackScholesProcess' (ForeignPtr CBlackProcess'))
      CStochasticProcess1D')
-> (BlackProcess
    -> GenForeignPtr
         (AnyOf
            CStochasticProcess1D'
            (AnyOf
               CGeneralizedBlackScholesProcess' (ForeignPtr CBlackProcess')))
         CStochasticProcess')
-> BlackProcess
-> GenForeignPtr
     (AnyOf
        CGeneralizedBlackScholesProcess' (ForeignPtr CBlackProcess'))
     CStochasticProcess1D'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BlackProcess
-> GenForeignPtr
     (AnyOf
        CStochasticProcess1D'
        (AnyOf
           CGeneralizedBlackScholesProcess' (ForeignPtr CBlackProcess')))
     CStochasticProcess'
forall p.
GenStochasticProcess p -> GenForeignPtr p CStochasticProcess'
getStochasticProcess

-- Heston SLV calibrators and Brownian factories are standalone objects.
data CBrownianGeneratorFactory'
data CHestonSLVMCModel'
data CHestonSLVFDMModel'
data CHestonSLVFDMLogEntries
type BrownianGeneratorFactory = Standalone CBrownianGeneratorFactory'
type HestonSLVMCModel = Standalone CHestonSLVMCModel'
type HestonSLVFDMModel = Standalone CHestonSLVFDMModel'
type HestonSLVFDMLogEntries = Standalone CHestonSLVFDMLogEntries
foreign import ccall unsafe "ql.h &qlFreeBrownianGeneratorFactory" qlFreeBrownianGeneratorFactory :: FinalizerPtr CBrownianGeneratorFactory'
foreign import ccall unsafe "ql.h &qlFreeHestonSLVMCModel" qlFreeHestonSLVMCModel :: FinalizerPtr CHestonSLVMCModel'
foreign import ccall unsafe "ql.h &qlFreeHestonSLVFDMModel" qlFreeHestonSLVFDMModel :: FinalizerPtr CHestonSLVFDMModel'
foreign import ccall unsafe "ql.h &qlFreeHestonSLVFDMLogEntries" qlFreeHestonSLVFDMLogEntries :: FinalizerPtr CHestonSLVFDMLogEntries
instance Finalizable CBrownianGeneratorFactory' where finalize :: FinalizerPtr CBrownianGeneratorFactory'
finalize = FinalizerPtr CBrownianGeneratorFactory'
qlFreeBrownianGeneratorFactory
instance Finalizable CHestonSLVMCModel' where finalize :: FinalizerPtr CHestonSLVMCModel'
finalize = FinalizerPtr CHestonSLVMCModel'
qlFreeHestonSLVMCModel
instance Finalizable CHestonSLVFDMModel' where finalize :: FinalizerPtr CHestonSLVFDMModel'
finalize = FinalizerPtr CHestonSLVFDMModel'
qlFreeHestonSLVFDMModel
instance Finalizable CHestonSLVFDMLogEntries where finalize :: FinalizerPtr CHestonSLVFDMLogEntries
finalize = FinalizerPtr CHestonSLVFDMLogEntries
qlFreeHestonSLVFDMLogEntries
peekBrownianGeneratorFactory :: Ptr CBrownianGeneratorFactory' -> IO BrownianGeneratorFactory
peekBrownianGeneratorFactory :: Ptr CBrownianGeneratorFactory' -> IO BrownianGeneratorFactory
peekBrownianGeneratorFactory = Ptr CBrownianGeneratorFactory' -> IO BrownianGeneratorFactory
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withBrownianGeneratorFactory :: BrownianGeneratorFactory -> (Ptr CBrownianGeneratorFactory' -> IO b) -> IO b
withBrownianGeneratorFactory :: forall b.
BrownianGeneratorFactory
-> (Ptr CBrownianGeneratorFactory' -> IO b) -> IO b
withBrownianGeneratorFactory = BrownianGeneratorFactory
-> (Ptr CBrownianGeneratorFactory' -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone
peekHestonSLVMCModel :: Ptr CHestonSLVMCModel' -> IO HestonSLVMCModel
peekHestonSLVMCModel :: Ptr CHestonSLVMCModel' -> IO HestonSLVMCModel
peekHestonSLVMCModel = Ptr CHestonSLVMCModel' -> IO HestonSLVMCModel
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withHestonSLVMCModel :: HestonSLVMCModel -> (Ptr CHestonSLVMCModel' -> IO b) -> IO b
withHestonSLVMCModel :: forall b.
HestonSLVMCModel -> (Ptr CHestonSLVMCModel' -> IO b) -> IO b
withHestonSLVMCModel = HestonSLVMCModel -> (Ptr CHestonSLVMCModel' -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone
peekHestonSLVFDMModel :: Ptr CHestonSLVFDMModel' -> IO HestonSLVFDMModel
peekHestonSLVFDMModel :: Ptr CHestonSLVFDMModel' -> IO HestonSLVFDMModel
peekHestonSLVFDMModel = Ptr CHestonSLVFDMModel' -> IO HestonSLVFDMModel
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withHestonSLVFDMModel :: HestonSLVFDMModel -> (Ptr CHestonSLVFDMModel' -> IO b) -> IO b
withHestonSLVFDMModel :: forall b.
HestonSLVFDMModel -> (Ptr CHestonSLVFDMModel' -> IO b) -> IO b
withHestonSLVFDMModel = HestonSLVFDMModel -> (Ptr CHestonSLVFDMModel' -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone
peekHestonSLVFDMLogEntries :: Ptr CHestonSLVFDMLogEntries -> IO HestonSLVFDMLogEntries
peekHestonSLVFDMLogEntries :: Ptr CHestonSLVFDMLogEntries -> IO HestonSLVFDMLogEntries
peekHestonSLVFDMLogEntries = Ptr CHestonSLVFDMLogEntries -> IO HestonSLVFDMLogEntries
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withHestonSLVFDMLogEntries :: HestonSLVFDMLogEntries -> (Ptr CHestonSLVFDMLogEntries -> IO b) -> IO b
withHestonSLVFDMLogEntries :: forall b.
HestonSLVFDMLogEntries
-> (Ptr CHestonSLVFDMLogEntries -> IO b) -> IO b
withHestonSLVFDMLogEntries = HestonSLVFDMLogEntries
-> (Ptr CHestonSLVFDMLogEntries -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone

-- |The root of the hierarchy shown under t'GenCalibratedModel'.
type CalibratedModel = GenCalibratedModel CCalibratedModel
data CCalibratedModel'
data CGJRGARCHModel'
data CLiborForwardModel'
data CGsr'
data CMarkovFunctional'
data CPiecewiseTimeDependentHestonModel'
data CHestonModel'
data CShortRateModel'
data CBatesModel'
data CBatesDetJumpModel'
data CBatesDoubleExpModel'
data CBatesDoubleExpDetJumpModel'
data COneFactorAffineModel'
data CHullWhite'
data CG2'
data CAffineModel'
data CShortRateDynamics'
-- | > CalibratedModel
-- >  LiborForwardModel + AffineModel
-- >  GJRGARCHModel
-- >  PiecewiseTimeDependentHestonModel
-- >  HestonModel
-- >    BatesModel
-- >      BatesDetJumpModel
-- >    BatesDoubleExpModel
-- >      BatesDoubleExpDetJumpModel
-- >  ShortRateModel
-- >    G2 + AffineModel
-- >    OneFactorAffineModel + AffineModel
-- >      HullWhite + AffineModel
-- >  Gsr + Gaussian1dModel
-- >  MarkovFunctional + Gaussian1dModel
newtype GenCalibratedModel m = GenCalibratedModel {forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel :: GenForeignPtr m CCalibratedModel'}
type CCalibratedModel = ForeignPtr CCalibratedModel'
type CLiborForwardModel = ForeignPtr CLiborForwardModel'
-- |A 'CalibratedModel'; see the hierarchy under t'GenCalibratedModel'.
type LiborForwardModel = GenCalibratedModel CLiborForwardModel
type CGJRGARCHModel = ForeignPtr CGJRGARCHModel'
-- |A 'CalibratedModel'; see the hierarchy under t'GenCalibratedModel'.
type GJRGARCHModel = GenCalibratedModel CGJRGARCHModel
type CGsr = ForeignPtr CGsr'
-- |A 'CalibratedModel'; see the hierarchy under t'GenCalibratedModel'.
type Gsr = GenCalibratedModel CGsr
type CMarkovFunctional = ForeignPtr CMarkovFunctional'
-- |A 'CalibratedModel'; see the hierarchy under t'GenCalibratedModel'.
type MarkovFunctional = GenCalibratedModel CMarkovFunctional
type CPiecewiseTimeDependentHestonModel = ForeignPtr CPiecewiseTimeDependentHestonModel'
-- |A 'CalibratedModel'; see the hierarchy under t'GenCalibratedModel'.
type PiecewiseTimeDependentHestonModel = GenCalibratedModel CPiecewiseTimeDependentHestonModel
-- |A 'HestonModel' or one of its leaves; see the hierarchy under t'GenCalibratedModel'.
type GenHestonModel hm = GenCalibratedModel (AnyOf CHestonModel' hm)
type CHestonModel = ForeignPtr CHestonModel'
-- |A 'CalibratedModel'; see the hierarchy under t'GenCalibratedModel'.
type HestonModel = GenHestonModel CHestonModel
-- |A 'ShortRateModel' or one of its leaves; see the hierarchy under t'GenCalibratedModel'.
type GenShortRateModel sm = GenCalibratedModel (AnyOf CShortRateModel' sm)
type CShortRateModel = ForeignPtr CShortRateModel'
-- |A 'CalibratedModel'; see the hierarchy under t'GenCalibratedModel'.
type ShortRateModel = GenShortRateModel CShortRateModel
-- |A 'BatesModel' or one of its leaves; see the hierarchy under t'GenCalibratedModel'.
type GenBatesModel bm = GenHestonModel (AnyOf CBatesModel' bm)
type CBatesModel = ForeignPtr CBatesModel'
-- |A 'HestonModel'; see the hierarchy under t'GenCalibratedModel'.
type BatesModel = GenBatesModel CBatesModel
type CBatesDetJumpModel = ForeignPtr CBatesDetJumpModel'
-- |A 'BatesModel'; see the hierarchy under t'GenCalibratedModel'.
type BatesDetJumpModel = GenBatesModel CBatesDetJumpModel
-- |A 'BatesDoubleExpModel' or one of its leaves; see the hierarchy under t'GenCalibratedModel'.
type GenBatesDoubleExpModel bdem = GenHestonModel (AnyOf CBatesDoubleExpModel' bdem)
type CBatesDoubleExpModel = ForeignPtr CBatesDoubleExpModel'
-- |A 'HestonModel'; see the hierarchy under t'GenCalibratedModel'.
type BatesDoubleExpModel = GenBatesDoubleExpModel CBatesDoubleExpModel
type CBatesDoubleExpDetJumpModel = ForeignPtr CBatesDoubleExpDetJumpModel'
-- |A 'BatesDoubleExpModel'; see the hierarchy under t'GenCalibratedModel'.
type BatesDoubleExpDetJumpModel = GenBatesDoubleExpModel CBatesDoubleExpDetJumpModel
-- |An 'OneFactorAffineModel' or one of its leaves; see the hierarchy under t'GenCalibratedModel'.
type GenOneFactorAffineModel om = GenShortRateModel (AnyOf COneFactorAffineModel' om)
type COneFactorAffineModel = ForeignPtr COneFactorAffineModel'
-- |A 'ShortRateModel'; see the hierarchy under t'GenCalibratedModel'.
type OneFactorAffineModel = GenOneFactorAffineModel COneFactorAffineModel
type CHullWhite = ForeignPtr CHullWhite'
-- |An 'OneFactorAffineModel'; see the hierarchy under t'GenCalibratedModel'.
type HullWhite = GenOneFactorAffineModel CHullWhite
type CG2 = ForeignPtr CG2'
-- |A 'ShortRateModel'; see the hierarchy under t'GenCalibratedModel'.
type G2 = GenShortRateModel CG2
foreign import ccall unsafe "ql.h &qlFreeCalibratedModel" qlFreeCalibratedModel :: FinalizerPtr CCalibratedModel'
foreign import ccall unsafe "ql.h &qlFreeLiborForwardModel" qlFreeLiborForwardModel :: FinalizerPtr CLiborForwardModel'
foreign import ccall unsafe "ql.h &qlFreeGJRGARCHModel" qlFreeGJRGARCHModel :: FinalizerPtr CGJRGARCHModel'
foreign import ccall unsafe "ql.h &qlFreeGsr" qlFreeGsr :: FinalizerPtr CGsr'
foreign import ccall unsafe "ql.h &qlFreeMarkovFunctional" qlFreeMarkovFunctional :: FinalizerPtr CMarkovFunctional'
foreign import ccall unsafe "ql.h &qlFreePiecewiseTimeDependentHestonModel" qlFreePiecewiseTimeDependentHestonModel :: FinalizerPtr CPiecewiseTimeDependentHestonModel'
foreign import ccall unsafe "ql.h &qlFreeHestonModel" qlFreeHestonModel :: FinalizerPtr CHestonModel'
foreign import ccall unsafe "ql.h &qlFreeShortRateModel" qlFreeShortRateModel :: FinalizerPtr CShortRateModel'
foreign import ccall unsafe "ql.h &qlFreeBatesModel" qlFreeBatesModel :: FinalizerPtr CBatesModel'
foreign import ccall unsafe "ql.h &qlFreeBatesDetJumpModel" qlFreeBatesDetJumpModel :: FinalizerPtr CBatesDetJumpModel'
foreign import ccall unsafe "ql.h &qlFreeBatesDoubleExpModel" qlFreeBatesDoubleExpModel :: FinalizerPtr CBatesDoubleExpModel'
foreign import ccall unsafe "ql.h &qlFreeBatesDoubleExpDetJumpModel" qlFreeBatesDoubleExpDetJumpModel :: FinalizerPtr CBatesDoubleExpDetJumpModel'
foreign import ccall unsafe "ql.h &qlFreeG2" qlFreeG2 :: FinalizerPtr CG2'
foreign import ccall unsafe "ql.h &qlFreeAffineModel" qlFreeAffineModel :: FinalizerPtr CAffineModel'
foreign import ccall unsafe "ql.h &qlFreeShortRateDynamics" qlFreeShortRateDynamics :: FinalizerPtr CShortRateDynamics'
foreign import ccall unsafe "ql.h &qlFreeOneFactorAffineModel" qlFreeOneFactorAffineModel :: FinalizerPtr COneFactorAffineModel'
foreign import ccall unsafe "ql.h &qlFreeHullWhite" qlFreeHullWhite :: FinalizerPtr CHullWhite'
foreign import ccall "ql.h qlPiecewiseTimeDependentHestonModelAsCalibratedModel" qlPiecewiseTimeDependentHestonModelAsCalibratedModel :: Ptr CPiecewiseTimeDependentHestonModel' -> IO (Ptr CCalibratedModel')
foreign import ccall "ql.h qlLiborForwardModelAsCalibratedModel" qlLiborForwardModelAsCalibratedModel :: Ptr CLiborForwardModel' -> IO (Ptr CCalibratedModel')
foreign import ccall "ql.h qlGJRGARCHModelAsCalibratedModel" qlGJRGARCHModelAsCalibratedModel :: Ptr CGJRGARCHModel' -> IO (Ptr CCalibratedModel')
foreign import ccall "ql.h qlGsrAsCalibratedModel" qlGsrAsCalibratedModel :: Ptr CGsr' -> IO (Ptr CCalibratedModel')
foreign import ccall "ql.h qlMarkovFunctionalAsCalibratedModel" qlMarkovFunctionalAsCalibratedModel :: Ptr CMarkovFunctional' -> IO (Ptr CCalibratedModel')
foreign import ccall "ql.h qlHestonModelAsCalibratedModel" qlHestonModelAsCalibratedModel :: Ptr CHestonModel' -> IO (Ptr CCalibratedModel')
foreign import ccall "ql.h qlShortRateModelAsCalibratedModel" qlShortRateModelAsCalibratedModel :: Ptr CShortRateModel' -> IO (Ptr CCalibratedModel')
foreign import ccall "ql.h qlBatesModelAsHestonModel" qlBatesModelAsHestonModel :: Ptr CBatesModel' -> IO (Ptr CHestonModel')
foreign import ccall "ql.h qlBatesDetJumpModelAsBatesModel" qlBatesDetJumpModelAsBatesModel :: Ptr CBatesDetJumpModel' -> IO (Ptr CBatesModel')
foreign import ccall "ql.h qlBatesDoubleExpModelAsHestonModel" qlBatesDoubleExpModelAsHestonModel :: Ptr CBatesDoubleExpModel' -> IO (Ptr CHestonModel')
foreign import ccall "ql.h qlBatesDoubleExpDetJumpModelAsBatesDoubleExpModel" qlBatesDoubleExpDetJumpModelAsBatesDoubleExpModel :: Ptr CBatesDoubleExpDetJumpModel' -> IO (Ptr CBatesDoubleExpModel')
foreign import ccall "ql.h qlOneFactorAffineModelAsShortRateModel" qlOneFactorAffineModelAsShortRateModel :: Ptr COneFactorAffineModel' -> IO (Ptr CShortRateModel')
foreign import ccall "ql.h qlHullWhiteAsOneFactorAffineModel" qlHullWhiteAsOneFactorAffineModel :: Ptr CHullWhite' -> IO (Ptr COneFactorAffineModel')
foreign import ccall "ql.h qlG2AsShortRateModel" qlG2AsShortRateModel :: Ptr CG2' -> IO (Ptr CShortRateModel')
instance Finalizable CCalibratedModel' where finalize :: FinalizerPtr CCalibratedModel'
finalize = FinalizerPtr CCalibratedModel'
qlFreeCalibratedModel
instance Finalizable CLiborForwardModel' where finalize :: FinalizerPtr CLiborForwardModel'
finalize = FinalizerPtr CLiborForwardModel'
qlFreeLiborForwardModel
instance Finalizable CGJRGARCHModel' where finalize :: FinalizerPtr CGJRGARCHModel'
finalize = FinalizerPtr CGJRGARCHModel'
qlFreeGJRGARCHModel
instance Finalizable CGsr' where finalize :: FinalizerPtr CGsr'
finalize = FinalizerPtr CGsr'
qlFreeGsr
instance Finalizable CMarkovFunctional' where finalize :: FinalizerPtr CMarkovFunctional'
finalize = FinalizerPtr CMarkovFunctional'
qlFreeMarkovFunctional
instance Finalizable CPiecewiseTimeDependentHestonModel' where finalize :: FinalizerPtr CPiecewiseTimeDependentHestonModel'
finalize = FinalizerPtr CPiecewiseTimeDependentHestonModel'
qlFreePiecewiseTimeDependentHestonModel
instance Finalizable CHestonModel' where finalize :: FinalizerPtr CHestonModel'
finalize = FinalizerPtr CHestonModel'
qlFreeHestonModel
instance Finalizable CShortRateModel' where finalize :: FinalizerPtr CShortRateModel'
finalize = FinalizerPtr CShortRateModel'
qlFreeShortRateModel
instance Finalizable CBatesModel' where finalize :: FinalizerPtr CBatesModel'
finalize = FinalizerPtr CBatesModel'
qlFreeBatesModel
instance Finalizable CBatesDetJumpModel' where finalize :: FinalizerPtr CBatesDetJumpModel'
finalize = FinalizerPtr CBatesDetJumpModel'
qlFreeBatesDetJumpModel
instance Finalizable CBatesDoubleExpModel' where finalize :: FinalizerPtr CBatesDoubleExpModel'
finalize = FinalizerPtr CBatesDoubleExpModel'
qlFreeBatesDoubleExpModel
instance Finalizable CBatesDoubleExpDetJumpModel' where finalize :: FinalizerPtr CBatesDoubleExpDetJumpModel'
finalize = FinalizerPtr CBatesDoubleExpDetJumpModel'
qlFreeBatesDoubleExpDetJumpModel
instance Finalizable COneFactorAffineModel' where finalize :: FinalizerPtr COneFactorAffineModel'
finalize = FinalizerPtr COneFactorAffineModel'
qlFreeOneFactorAffineModel
instance Finalizable CHullWhite' where finalize :: FinalizerPtr CHullWhite'
finalize = FinalizerPtr CHullWhite'
qlFreeHullWhite
instance Finalizable CG2' where finalize :: FinalizerPtr CG2'
finalize = FinalizerPtr CG2'
qlFreeG2
instance Finalizable CAffineModel' where finalize :: FinalizerPtr CAffineModel'
finalize = FinalizerPtr CAffineModel'
qlFreeAffineModel
instance Finalizable CShortRateDynamics' where finalize :: FinalizerPtr CShortRateDynamics'
finalize = FinalizerPtr CShortRateDynamics'
qlFreeShortRateDynamics
instance Upcastable CLiborForwardModel' where {type Base CLiborForwardModel' = CCalibratedModel'; upcast :: Ptr CLiborForwardModel' -> IO (Ptr (Base CLiborForwardModel'))
upcast = Ptr CLiborForwardModel' -> IO (Ptr CCalibratedModel')
Ptr CLiborForwardModel' -> IO (Ptr (Base CLiborForwardModel'))
qlLiborForwardModelAsCalibratedModel}
instance Upcastable CPiecewiseTimeDependentHestonModel' where {type Base CPiecewiseTimeDependentHestonModel' = CCalibratedModel'; upcast :: Ptr CPiecewiseTimeDependentHestonModel'
-> IO (Ptr (Base CPiecewiseTimeDependentHestonModel'))
upcast = Ptr CPiecewiseTimeDependentHestonModel'
-> IO (Ptr CCalibratedModel')
Ptr CPiecewiseTimeDependentHestonModel'
-> IO (Ptr (Base CPiecewiseTimeDependentHestonModel'))
qlPiecewiseTimeDependentHestonModelAsCalibratedModel}
instance Upcastable CGJRGARCHModel' where {type Base CGJRGARCHModel' = CCalibratedModel'; upcast :: Ptr CGJRGARCHModel' -> IO (Ptr (Base CGJRGARCHModel'))
upcast = Ptr CGJRGARCHModel' -> IO (Ptr CCalibratedModel')
Ptr CGJRGARCHModel' -> IO (Ptr (Base CGJRGARCHModel'))
qlGJRGARCHModelAsCalibratedModel}
instance Upcastable CGsr' where {type Base CGsr' = CCalibratedModel'; upcast :: Ptr CGsr' -> IO (Ptr (Base CGsr'))
upcast = Ptr CGsr' -> IO (Ptr CCalibratedModel')
Ptr CGsr' -> IO (Ptr (Base CGsr'))
qlGsrAsCalibratedModel}
instance Upcastable CMarkovFunctional' where {type Base CMarkovFunctional' = CCalibratedModel'; upcast :: Ptr CMarkovFunctional' -> IO (Ptr (Base CMarkovFunctional'))
upcast = Ptr CMarkovFunctional' -> IO (Ptr CCalibratedModel')
Ptr CMarkovFunctional' -> IO (Ptr (Base CMarkovFunctional'))
qlMarkovFunctionalAsCalibratedModel}
instance Upcastable CHestonModel' where {type Base CHestonModel' = CCalibratedModel'; upcast :: Ptr CHestonModel' -> IO (Ptr (Base CHestonModel'))
upcast = Ptr CHestonModel' -> IO (Ptr CCalibratedModel')
Ptr CHestonModel' -> IO (Ptr (Base CHestonModel'))
qlHestonModelAsCalibratedModel}
instance Upcastable CShortRateModel' where {type Base CShortRateModel' = CCalibratedModel'; upcast :: Ptr CShortRateModel' -> IO (Ptr (Base CShortRateModel'))
upcast = Ptr CShortRateModel' -> IO (Ptr CCalibratedModel')
Ptr CShortRateModel' -> IO (Ptr (Base CShortRateModel'))
qlShortRateModelAsCalibratedModel}
instance Upcastable CBatesModel' where {type Base CBatesModel' = CHestonModel'; upcast :: Ptr CBatesModel' -> IO (Ptr (Base CBatesModel'))
upcast = Ptr CBatesModel' -> IO (Ptr CHestonModel')
Ptr CBatesModel' -> IO (Ptr (Base CBatesModel'))
qlBatesModelAsHestonModel}
instance Upcastable CBatesDetJumpModel' where {type Base CBatesDetJumpModel' = CBatesModel'; upcast :: Ptr CBatesDetJumpModel' -> IO (Ptr (Base CBatesDetJumpModel'))
upcast = Ptr CBatesDetJumpModel' -> IO (Ptr CBatesModel')
Ptr CBatesDetJumpModel' -> IO (Ptr (Base CBatesDetJumpModel'))
qlBatesDetJumpModelAsBatesModel}
instance Upcastable CBatesDoubleExpModel' where {type Base CBatesDoubleExpModel' = CHestonModel'; upcast :: Ptr CBatesDoubleExpModel' -> IO (Ptr (Base CBatesDoubleExpModel'))
upcast = Ptr CBatesDoubleExpModel' -> IO (Ptr CHestonModel')
Ptr CBatesDoubleExpModel' -> IO (Ptr (Base CBatesDoubleExpModel'))
qlBatesDoubleExpModelAsHestonModel}
instance Upcastable CBatesDoubleExpDetJumpModel' where {type Base CBatesDoubleExpDetJumpModel' = CBatesDoubleExpModel'; upcast :: Ptr CBatesDoubleExpDetJumpModel'
-> IO (Ptr (Base CBatesDoubleExpDetJumpModel'))
upcast = Ptr CBatesDoubleExpDetJumpModel' -> IO (Ptr CBatesDoubleExpModel')
Ptr CBatesDoubleExpDetJumpModel'
-> IO (Ptr (Base CBatesDoubleExpDetJumpModel'))
qlBatesDoubleExpDetJumpModelAsBatesDoubleExpModel}
instance Upcastable COneFactorAffineModel' where {type Base COneFactorAffineModel' = CShortRateModel'; upcast :: Ptr COneFactorAffineModel'
-> IO (Ptr (Base COneFactorAffineModel'))
upcast = Ptr COneFactorAffineModel' -> IO (Ptr CShortRateModel')
Ptr COneFactorAffineModel'
-> IO (Ptr (Base COneFactorAffineModel'))
qlOneFactorAffineModelAsShortRateModel}
instance Upcastable CHullWhite' where {type Base CHullWhite' = COneFactorAffineModel'; upcast :: Ptr CHullWhite' -> IO (Ptr (Base CHullWhite'))
upcast = Ptr CHullWhite' -> IO (Ptr COneFactorAffineModel')
Ptr CHullWhite' -> IO (Ptr (Base CHullWhite'))
qlHullWhiteAsOneFactorAffineModel}
instance Upcastable CG2' where {type Base CG2' = CShortRateModel'; upcast :: Ptr CG2' -> IO (Ptr (Base CG2'))
upcast = Ptr CG2' -> IO (Ptr CShortRateModel')
Ptr CG2' -> IO (Ptr (Base CG2'))
qlG2AsShortRateModel}
asCalibratedModel :: GenCalibratedModel m -> IO CalibratedModel
asCalibratedModel :: forall m. GenCalibratedModel m -> IO CalibratedModel
asCalibratedModel = (Ptr CCalibratedModel' -> IO CalibratedModel)
-> GenForeignPtr m CCalibratedModel' -> IO CalibratedModel
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CCalibratedModel' -> IO CalibratedModel
peekCalibratedModel (GenForeignPtr m CCalibratedModel' -> IO CalibratedModel)
-> (GenCalibratedModel m -> GenForeignPtr m CCalibratedModel')
-> GenCalibratedModel m
-> IO CalibratedModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel
peekCalibratedModel :: Ptr CCalibratedModel' -> IO CalibratedModel
peekCalibratedModel :: Ptr CCalibratedModel' -> IO CalibratedModel
peekCalibratedModel = GenForeignPtr CCalibratedModel CCalibratedModel' -> CalibratedModel
forall m. GenForeignPtr m CCalibratedModel' -> GenCalibratedModel m
GenCalibratedModel (GenForeignPtr CCalibratedModel CCalibratedModel'
 -> CalibratedModel)
-> (Ptr CCalibratedModel'
    -> IO (GenForeignPtr CCalibratedModel CCalibratedModel'))
-> Ptr CCalibratedModel'
-> IO CalibratedModel
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCalibratedModel'
-> IO (GenForeignPtr CCalibratedModel CCalibratedModel')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr
withCalibratedModel :: GenCalibratedModel m -> (Ptr CCalibratedModel' -> IO b) -> IO b
withCalibratedModel :: forall m b.
GenCalibratedModel m -> (Ptr CCalibratedModel' -> IO b) -> IO b
withCalibratedModel = GenForeignPtr m CCalibratedModel'
-> (Ptr CCalibratedModel' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr m CCalibratedModel'
 -> (Ptr CCalibratedModel' -> IO b) -> IO b)
-> (GenCalibratedModel m -> GenForeignPtr m CCalibratedModel')
-> GenCalibratedModel m
-> (Ptr CCalibratedModel' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel
withGenCalibratedModel :: GenCalibratedModel (ForeignPtr m) -> (Ptr m -> IO b) -> IO b
withGenCalibratedModel :: forall m b.
GenCalibratedModel (ForeignPtr m) -> (Ptr m -> IO b) -> IO b
withGenCalibratedModel = ForeignPtr m -> (Ptr m -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr m -> (Ptr m -> IO b) -> IO b)
-> (GenCalibratedModel (ForeignPtr m) -> ForeignPtr m)
-> GenCalibratedModel (ForeignPtr m)
-> (Ptr m -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr m) CCalibratedModel' -> ForeignPtr m
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr m) CCalibratedModel' -> ForeignPtr m)
-> (GenCalibratedModel (ForeignPtr m)
    -> GenForeignPtr (ForeignPtr m) CCalibratedModel')
-> GenCalibratedModel (ForeignPtr m)
-> ForeignPtr m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenCalibratedModel (ForeignPtr m)
-> GenForeignPtr (ForeignPtr m) CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel
peekLiborForwardModel :: Ptr CLiborForwardModel' -> IO LiborForwardModel
peekLiborForwardModel :: Ptr CLiborForwardModel' -> IO LiborForwardModel
peekLiborForwardModel = GenForeignPtr CLiborForwardModel CCalibratedModel'
-> LiborForwardModel
forall m. GenForeignPtr m CCalibratedModel' -> GenCalibratedModel m
GenCalibratedModel (GenForeignPtr CLiborForwardModel CCalibratedModel'
 -> LiborForwardModel)
-> (Ptr CLiborForwardModel'
    -> IO (GenForeignPtr CLiborForwardModel CCalibratedModel'))
-> Ptr CLiborForwardModel'
-> IO LiborForwardModel
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CLiborForwardModel'
-> IO (GenForeignPtr CLiborForwardModel CCalibratedModel')
Ptr CLiborForwardModel'
-> IO (GenForeignPtr CLiborForwardModel (Base CLiborForwardModel'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekGJRGARCHModel :: Ptr CGJRGARCHModel' -> IO GJRGARCHModel
peekGJRGARCHModel :: Ptr CGJRGARCHModel' -> IO GJRGARCHModel
peekGJRGARCHModel = GenForeignPtr CGJRGARCHModel CCalibratedModel' -> GJRGARCHModel
forall m. GenForeignPtr m CCalibratedModel' -> GenCalibratedModel m
GenCalibratedModel (GenForeignPtr CGJRGARCHModel CCalibratedModel' -> GJRGARCHModel)
-> (Ptr CGJRGARCHModel'
    -> IO (GenForeignPtr CGJRGARCHModel CCalibratedModel'))
-> Ptr CGJRGARCHModel'
-> IO GJRGARCHModel
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CGJRGARCHModel'
-> IO (GenForeignPtr CGJRGARCHModel CCalibratedModel')
Ptr CGJRGARCHModel'
-> IO (GenForeignPtr CGJRGARCHModel (Base CGJRGARCHModel'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekGsr :: Ptr CGsr' -> IO Gsr
peekGsr :: Ptr CGsr' -> IO Gsr
peekGsr = GenForeignPtr CGsr CCalibratedModel' -> Gsr
forall m. GenForeignPtr m CCalibratedModel' -> GenCalibratedModel m
GenCalibratedModel (GenForeignPtr CGsr CCalibratedModel' -> Gsr)
-> (Ptr CGsr' -> IO (GenForeignPtr CGsr CCalibratedModel'))
-> Ptr CGsr'
-> IO Gsr
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CGsr' -> IO (GenForeignPtr CGsr CCalibratedModel')
Ptr CGsr' -> IO (GenForeignPtr CGsr (Base CGsr'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekMarkovFunctional :: Ptr CMarkovFunctional' -> IO MarkovFunctional
peekMarkovFunctional :: Ptr CMarkovFunctional' -> IO MarkovFunctional
peekMarkovFunctional = GenForeignPtr CMarkovFunctional CCalibratedModel'
-> MarkovFunctional
forall m. GenForeignPtr m CCalibratedModel' -> GenCalibratedModel m
GenCalibratedModel (GenForeignPtr CMarkovFunctional CCalibratedModel'
 -> MarkovFunctional)
-> (Ptr CMarkovFunctional'
    -> IO (GenForeignPtr CMarkovFunctional CCalibratedModel'))
-> Ptr CMarkovFunctional'
-> IO MarkovFunctional
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CMarkovFunctional'
-> IO (GenForeignPtr CMarkovFunctional CCalibratedModel')
Ptr CMarkovFunctional'
-> IO (GenForeignPtr CMarkovFunctional (Base CMarkovFunctional'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
peekPiecewiseTimeDependentHestonModel :: Ptr CPiecewiseTimeDependentHestonModel' -> IO PiecewiseTimeDependentHestonModel
peekPiecewiseTimeDependentHestonModel :: Ptr CPiecewiseTimeDependentHestonModel'
-> IO PiecewiseTimeDependentHestonModel
peekPiecewiseTimeDependentHestonModel = GenForeignPtr CPiecewiseTimeDependentHestonModel CCalibratedModel'
-> PiecewiseTimeDependentHestonModel
forall m. GenForeignPtr m CCalibratedModel' -> GenCalibratedModel m
GenCalibratedModel (GenForeignPtr CPiecewiseTimeDependentHestonModel CCalibratedModel'
 -> PiecewiseTimeDependentHestonModel)
-> (Ptr CPiecewiseTimeDependentHestonModel'
    -> IO
         (GenForeignPtr
            CPiecewiseTimeDependentHestonModel CCalibratedModel'))
-> Ptr CPiecewiseTimeDependentHestonModel'
-> IO PiecewiseTimeDependentHestonModel
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CPiecewiseTimeDependentHestonModel'
-> IO
     (GenForeignPtr
        CPiecewiseTimeDependentHestonModel CCalibratedModel')
Ptr CPiecewiseTimeDependentHestonModel'
-> IO
     (GenForeignPtr
        CPiecewiseTimeDependentHestonModel
        (Base CPiecewiseTimeDependentHestonModel'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr

asHestonModel :: GenHestonModel hm -> IO HestonModel
asHestonModel :: forall hm. GenHestonModel hm -> IO HestonModel
asHestonModel = (Ptr CHestonModel' -> IO HestonModel)
-> GenForeignPtr hm CHestonModel' -> IO HestonModel
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CHestonModel' -> IO HestonModel
peekHestonModel (GenForeignPtr hm CHestonModel' -> IO HestonModel)
-> (GenHestonModel hm -> GenForeignPtr hm CHestonModel')
-> GenHestonModel hm
-> IO HestonModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CHestonModel' hm) CCalibratedModel'
-> GenForeignPtr hm CHestonModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CHestonModel' hm) CCalibratedModel'
 -> GenForeignPtr hm CHestonModel')
-> (GenHestonModel hm
    -> GenForeignPtr (AnyOf CHestonModel' hm) CCalibratedModel')
-> GenHestonModel hm
-> GenForeignPtr hm CHestonModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenHestonModel hm
-> GenForeignPtr (AnyOf CHestonModel' hm) CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel
peekHestonModel :: Ptr CHestonModel' -> IO HestonModel
peekHestonModel :: Ptr CHestonModel' -> IO HestonModel
peekHestonModel = Ptr CHestonModel'
-> IO (GenForeignPtr (ForeignPtr CHestonModel') CHestonModel')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CHestonModel'
 -> IO (GenForeignPtr (ForeignPtr CHestonModel') CHestonModel'))
-> (GenForeignPtr (ForeignPtr CHestonModel') CHestonModel'
    -> IO HestonModel)
-> Ptr CHestonModel'
-> IO HestonModel
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CHestonModel') CHestonModel'
-> IO HestonModel
forall hm. GenForeignPtr hm CHestonModel' -> IO (GenHestonModel hm)
newGenHestonModel
withHestonModel :: GenHestonModel hm -> (Ptr CHestonModel' -> IO b) -> IO b
withHestonModel :: forall hm b.
GenHestonModel hm -> (Ptr CHestonModel' -> IO b) -> IO b
withHestonModel = GenForeignPtr hm CHestonModel'
-> (Ptr CHestonModel' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr hm CHestonModel'
 -> (Ptr CHestonModel' -> IO b) -> IO b)
-> (GenHestonModel hm -> GenForeignPtr hm CHestonModel')
-> GenHestonModel hm
-> (Ptr CHestonModel' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CHestonModel' hm) CCalibratedModel'
-> GenForeignPtr hm CHestonModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CHestonModel' hm) CCalibratedModel'
 -> GenForeignPtr hm CHestonModel')
-> (GenHestonModel hm
    -> GenForeignPtr (AnyOf CHestonModel' hm) CCalibratedModel')
-> GenHestonModel hm
-> GenForeignPtr hm CHestonModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenHestonModel hm
-> GenForeignPtr (AnyOf CHestonModel' hm) CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel
newGenHestonModel :: GenForeignPtr hm CHestonModel' -> IO (GenHestonModel hm)
newGenHestonModel :: forall hm. GenForeignPtr hm CHestonModel' -> IO (GenHestonModel hm)
newGenHestonModel = GenHestonModel hm -> IO (GenHestonModel hm)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenHestonModel hm -> IO (GenHestonModel hm))
-> (GenForeignPtr hm CHestonModel' -> GenHestonModel hm)
-> GenForeignPtr hm CHestonModel'
-> IO (GenHestonModel hm)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CHestonModel' hm) CCalibratedModel'
-> GenHestonModel hm
forall m. GenForeignPtr m CCalibratedModel' -> GenCalibratedModel m
GenCalibratedModel (GenForeignPtr (AnyOf CHestonModel' hm) CCalibratedModel'
 -> GenHestonModel hm)
-> (GenForeignPtr hm CHestonModel'
    -> GenForeignPtr (AnyOf CHestonModel' hm) CCalibratedModel')
-> GenForeignPtr hm CHestonModel'
-> GenHestonModel hm
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr hm CHestonModel'
-> GenForeignPtr (AnyOf CHestonModel' hm) CCalibratedModel'
GenForeignPtr hm CHestonModel'
-> GenForeignPtr (AnyOf CHestonModel' hm) (Base CHestonModel')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf

asShortRateModel :: GenShortRateModel sm -> IO ShortRateModel
asShortRateModel :: forall sm. GenShortRateModel sm -> IO ShortRateModel
asShortRateModel  = (Ptr CShortRateModel' -> IO ShortRateModel)
-> GenForeignPtr sm CShortRateModel' -> IO ShortRateModel
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CShortRateModel' -> IO ShortRateModel
peekShortRateModel (GenForeignPtr sm CShortRateModel' -> IO ShortRateModel)
-> (GenShortRateModel sm -> GenForeignPtr sm CShortRateModel')
-> GenShortRateModel sm
-> IO ShortRateModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CShortRateModel' sm) CCalibratedModel'
-> GenForeignPtr sm CShortRateModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CShortRateModel' sm) CCalibratedModel'
 -> GenForeignPtr sm CShortRateModel')
-> (GenShortRateModel sm
    -> GenForeignPtr (AnyOf CShortRateModel' sm) CCalibratedModel')
-> GenShortRateModel sm
-> GenForeignPtr sm CShortRateModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenShortRateModel sm
-> GenForeignPtr (AnyOf CShortRateModel' sm) CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel
peekShortRateModel :: Ptr CShortRateModel' -> IO ShortRateModel
peekShortRateModel :: Ptr CShortRateModel' -> IO ShortRateModel
peekShortRateModel = Ptr CShortRateModel'
-> IO
     (GenForeignPtr (ForeignPtr CShortRateModel') CShortRateModel')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CShortRateModel'
 -> IO
      (GenForeignPtr (ForeignPtr CShortRateModel') CShortRateModel'))
-> (GenForeignPtr (ForeignPtr CShortRateModel') CShortRateModel'
    -> IO ShortRateModel)
-> Ptr CShortRateModel'
-> IO ShortRateModel
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CShortRateModel') CShortRateModel'
-> IO ShortRateModel
forall sm.
GenForeignPtr sm CShortRateModel' -> IO (GenShortRateModel sm)
newGenShortRateModel
withShortRateModel :: GenShortRateModel sm -> (Ptr CShortRateModel' -> IO b) -> IO b
withShortRateModel :: forall sm b.
GenShortRateModel sm -> (Ptr CShortRateModel' -> IO b) -> IO b
withShortRateModel = GenForeignPtr sm CShortRateModel'
-> (Ptr CShortRateModel' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr sm CShortRateModel'
 -> (Ptr CShortRateModel' -> IO b) -> IO b)
-> (GenShortRateModel sm -> GenForeignPtr sm CShortRateModel')
-> GenShortRateModel sm
-> (Ptr CShortRateModel' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CShortRateModel' sm) CCalibratedModel'
-> GenForeignPtr sm CShortRateModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CShortRateModel' sm) CCalibratedModel'
 -> GenForeignPtr sm CShortRateModel')
-> (GenShortRateModel sm
    -> GenForeignPtr (AnyOf CShortRateModel' sm) CCalibratedModel')
-> GenShortRateModel sm
-> GenForeignPtr sm CShortRateModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenShortRateModel sm
-> GenForeignPtr (AnyOf CShortRateModel' sm) CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel
newGenShortRateModel :: GenForeignPtr sm CShortRateModel' -> IO (GenShortRateModel sm)
newGenShortRateModel :: forall sm.
GenForeignPtr sm CShortRateModel' -> IO (GenShortRateModel sm)
newGenShortRateModel = GenShortRateModel sm -> IO (GenShortRateModel sm)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenShortRateModel sm -> IO (GenShortRateModel sm))
-> (GenForeignPtr sm CShortRateModel' -> GenShortRateModel sm)
-> GenForeignPtr sm CShortRateModel'
-> IO (GenShortRateModel sm)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CShortRateModel' sm) CCalibratedModel'
-> GenShortRateModel sm
forall m. GenForeignPtr m CCalibratedModel' -> GenCalibratedModel m
GenCalibratedModel (GenForeignPtr (AnyOf CShortRateModel' sm) CCalibratedModel'
 -> GenShortRateModel sm)
-> (GenForeignPtr sm CShortRateModel'
    -> GenForeignPtr (AnyOf CShortRateModel' sm) CCalibratedModel')
-> GenForeignPtr sm CShortRateModel'
-> GenShortRateModel sm
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr sm CShortRateModel'
-> GenForeignPtr (AnyOf CShortRateModel' sm) CCalibratedModel'
GenForeignPtr sm CShortRateModel'
-> GenForeignPtr
     (AnyOf CShortRateModel' sm) (Base CShortRateModel')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekGenShortRateModel :: (Finalizable sm, Upcastable sm, Base sm ~ CShortRateModel') => Ptr sm -> IO (GenShortRateModel (ForeignPtr sm))
peekGenShortRateModel :: forall sm.
(Finalizable sm, Upcastable sm, Base sm ~ CShortRateModel') =>
Ptr sm -> IO (GenShortRateModel (ForeignPtr sm))
peekGenShortRateModel = Ptr sm -> IO (GenForeignPtr (ForeignPtr sm) CShortRateModel')
Ptr sm -> IO (GenForeignPtr (ForeignPtr sm) (Base sm))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr sm -> IO (GenForeignPtr (ForeignPtr sm) CShortRateModel'))
-> (GenForeignPtr (ForeignPtr sm) CShortRateModel'
    -> IO (GenShortRateModel (ForeignPtr sm)))
-> Ptr sm
-> IO (GenShortRateModel (ForeignPtr sm))
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr sm) CShortRateModel'
-> IO (GenShortRateModel (ForeignPtr sm))
forall sm.
GenForeignPtr sm CShortRateModel' -> IO (GenShortRateModel sm)
newGenShortRateModel

asBatesModel :: GenBatesModel bm -> IO BatesModel
asBatesModel :: forall bm. GenBatesModel bm -> IO BatesModel
asBatesModel = (Ptr CBatesModel' -> IO BatesModel)
-> GenForeignPtr bm CBatesModel' -> IO BatesModel
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CBatesModel' -> IO BatesModel
peekBatesModel (GenForeignPtr bm CBatesModel' -> IO BatesModel)
-> (GenBatesModel bm -> GenForeignPtr bm CBatesModel')
-> GenBatesModel bm
-> IO BatesModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel'
-> GenForeignPtr bm CBatesModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel'
 -> GenForeignPtr bm CBatesModel')
-> (GenBatesModel bm
    -> GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel')
-> GenBatesModel bm
-> GenForeignPtr bm CBatesModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) CCalibratedModel'
-> GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) CCalibratedModel'
 -> GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel')
-> (GenBatesModel bm
    -> GenForeignPtr
         (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) CCalibratedModel')
-> GenBatesModel bm
-> GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBatesModel bm
-> GenForeignPtr
     (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel
peekBatesModel :: Ptr CBatesModel' -> IO BatesModel
peekBatesModel :: Ptr CBatesModel' -> IO BatesModel
peekBatesModel = Ptr CBatesModel'
-> IO (GenForeignPtr (ForeignPtr CBatesModel') CBatesModel')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CBatesModel'
 -> IO (GenForeignPtr (ForeignPtr CBatesModel') CBatesModel'))
-> (GenForeignPtr (ForeignPtr CBatesModel') CBatesModel'
    -> IO BatesModel)
-> Ptr CBatesModel'
-> IO BatesModel
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CBatesModel') CBatesModel'
-> IO BatesModel
forall bm. GenForeignPtr bm CBatesModel' -> IO (GenBatesModel bm)
newGenBatesModel
withBatesModel :: GenBatesModel bm -> (Ptr CBatesModel' -> IO b) -> IO b
withBatesModel :: forall bm b. GenBatesModel bm -> (Ptr CBatesModel' -> IO b) -> IO b
withBatesModel = GenForeignPtr bm CBatesModel' -> (Ptr CBatesModel' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr bm CBatesModel'
 -> (Ptr CBatesModel' -> IO b) -> IO b)
-> (GenBatesModel bm -> GenForeignPtr bm CBatesModel')
-> GenBatesModel bm
-> (Ptr CBatesModel' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel'
-> GenForeignPtr bm CBatesModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel'
 -> GenForeignPtr bm CBatesModel')
-> (GenBatesModel bm
    -> GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel')
-> GenBatesModel bm
-> GenForeignPtr bm CBatesModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) CCalibratedModel'
-> GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) CCalibratedModel'
 -> GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel')
-> (GenBatesModel bm
    -> GenForeignPtr
         (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) CCalibratedModel')
-> GenBatesModel bm
-> GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBatesModel bm
-> GenForeignPtr
     (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel
newGenBatesModel :: GenForeignPtr bm CBatesModel' -> IO (GenBatesModel bm)
newGenBatesModel :: forall bm. GenForeignPtr bm CBatesModel' -> IO (GenBatesModel bm)
newGenBatesModel = GenBatesModel bm -> IO (GenBatesModel bm)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenBatesModel bm -> IO (GenBatesModel bm))
-> (GenForeignPtr bm CBatesModel' -> GenBatesModel bm)
-> GenForeignPtr bm CBatesModel'
-> IO (GenBatesModel bm)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) CCalibratedModel'
-> GenBatesModel bm
forall m. GenForeignPtr m CCalibratedModel' -> GenCalibratedModel m
GenCalibratedModel (GenForeignPtr
   (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) CCalibratedModel'
 -> GenBatesModel bm)
-> (GenForeignPtr bm CBatesModel'
    -> GenForeignPtr
         (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) CCalibratedModel')
-> GenForeignPtr bm CBatesModel'
-> GenBatesModel bm
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel'
-> GenForeignPtr
     (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) CCalibratedModel'
GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel'
-> GenForeignPtr
     (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) (Base CHestonModel')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel'
 -> GenForeignPtr
      (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) CCalibratedModel')
-> (GenForeignPtr bm CBatesModel'
    -> GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel')
-> GenForeignPtr bm CBatesModel'
-> GenForeignPtr
     (AnyOf CHestonModel' (AnyOf CBatesModel' bm)) CCalibratedModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr bm CBatesModel'
-> GenForeignPtr (AnyOf CBatesModel' bm) CHestonModel'
GenForeignPtr bm CBatesModel'
-> GenForeignPtr (AnyOf CBatesModel' bm) (Base CBatesModel')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekBatesDetJumpModel :: Ptr CBatesDetJumpModel' -> IO BatesDetJumpModel
peekBatesDetJumpModel :: Ptr CBatesDetJumpModel' -> IO BatesDetJumpModel
peekBatesDetJumpModel = Ptr CBatesDetJumpModel'
-> IO (GenForeignPtr (ForeignPtr CBatesDetJumpModel') CBatesModel')
Ptr CBatesDetJumpModel'
-> IO
     (GenForeignPtr
        (ForeignPtr CBatesDetJumpModel') (Base CBatesDetJumpModel'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CBatesDetJumpModel'
 -> IO
      (GenForeignPtr (ForeignPtr CBatesDetJumpModel') CBatesModel'))
-> (GenForeignPtr (ForeignPtr CBatesDetJumpModel') CBatesModel'
    -> IO BatesDetJumpModel)
-> Ptr CBatesDetJumpModel'
-> IO BatesDetJumpModel
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CBatesDetJumpModel') CBatesModel'
-> IO BatesDetJumpModel
forall bm. GenForeignPtr bm CBatesModel' -> IO (GenBatesModel bm)
newGenBatesModel
withBatesDetJumpModel :: BatesDetJumpModel -> (Ptr CBatesDetJumpModel' -> IO b) -> IO b
withBatesDetJumpModel :: forall b.
BatesDetJumpModel -> (Ptr CBatesDetJumpModel' -> IO b) -> IO b
withBatesDetJumpModel = ForeignPtr CBatesDetJumpModel'
-> (Ptr CBatesDetJumpModel' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CBatesDetJumpModel'
 -> (Ptr CBatesDetJumpModel' -> IO b) -> IO b)
-> (BatesDetJumpModel -> ForeignPtr CBatesDetJumpModel')
-> BatesDetJumpModel
-> (Ptr CBatesDetJumpModel' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CBatesDetJumpModel') CBatesModel'
-> ForeignPtr CBatesDetJumpModel'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CBatesDetJumpModel') CBatesModel'
 -> ForeignPtr CBatesDetJumpModel')
-> (BatesDetJumpModel
    -> GenForeignPtr (ForeignPtr CBatesDetJumpModel') CBatesModel')
-> BatesDetJumpModel
-> ForeignPtr CBatesDetJumpModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBatesModel' (ForeignPtr CBatesDetJumpModel')) CHestonModel'
-> GenForeignPtr (ForeignPtr CBatesDetJumpModel') CBatesModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBatesModel' (ForeignPtr CBatesDetJumpModel')) CHestonModel'
 -> GenForeignPtr (ForeignPtr CBatesDetJumpModel') CBatesModel')
-> (BatesDetJumpModel
    -> GenForeignPtr
         (AnyOf CBatesModel' (ForeignPtr CBatesDetJumpModel'))
         CHestonModel')
-> BatesDetJumpModel
-> GenForeignPtr (ForeignPtr CBatesDetJumpModel') CBatesModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CHestonModel'
     (AnyOf CBatesModel' (ForeignPtr CBatesDetJumpModel')))
  CCalibratedModel'
-> GenForeignPtr
     (AnyOf CBatesModel' (ForeignPtr CBatesDetJumpModel')) CHestonModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CHestonModel'
      (AnyOf CBatesModel' (ForeignPtr CBatesDetJumpModel')))
   CCalibratedModel'
 -> GenForeignPtr
      (AnyOf CBatesModel' (ForeignPtr CBatesDetJumpModel'))
      CHestonModel')
-> (BatesDetJumpModel
    -> GenForeignPtr
         (AnyOf
            CHestonModel'
            (AnyOf CBatesModel' (ForeignPtr CBatesDetJumpModel')))
         CCalibratedModel')
-> BatesDetJumpModel
-> GenForeignPtr
     (AnyOf CBatesModel' (ForeignPtr CBatesDetJumpModel')) CHestonModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BatesDetJumpModel
-> GenForeignPtr
     (AnyOf
        CHestonModel'
        (AnyOf CBatesModel' (ForeignPtr CBatesDetJumpModel')))
     CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel

asBatesDoubleExpModel :: GenBatesDoubleExpModel bdem -> IO BatesDoubleExpModel
asBatesDoubleExpModel :: forall bdem. GenBatesDoubleExpModel bdem -> IO BatesDoubleExpModel
asBatesDoubleExpModel = (Ptr CBatesDoubleExpModel' -> IO BatesDoubleExpModel)
-> GenForeignPtr bdem CBatesDoubleExpModel'
-> IO BatesDoubleExpModel
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CBatesDoubleExpModel' -> IO BatesDoubleExpModel
peekBatesDoubleExpModel (GenForeignPtr bdem CBatesDoubleExpModel'
 -> IO BatesDoubleExpModel)
-> (GenBatesDoubleExpModel bdem
    -> GenForeignPtr bdem CBatesDoubleExpModel')
-> GenBatesDoubleExpModel bdem
-> IO BatesDoubleExpModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel'
-> GenForeignPtr bdem CBatesDoubleExpModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel'
 -> GenForeignPtr bdem CBatesDoubleExpModel')
-> (GenBatesDoubleExpModel bdem
    -> GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel')
-> GenBatesDoubleExpModel bdem
-> GenForeignPtr bdem CBatesDoubleExpModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
  CCalibratedModel'
-> GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
   CCalibratedModel'
 -> GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel')
-> (GenBatesDoubleExpModel bdem
    -> GenForeignPtr
         (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
         CCalibratedModel')
-> GenBatesDoubleExpModel bdem
-> GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBatesDoubleExpModel bdem
-> GenForeignPtr
     (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
     CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel
peekBatesDoubleExpModel :: Ptr CBatesDoubleExpModel' -> IO BatesDoubleExpModel
peekBatesDoubleExpModel :: Ptr CBatesDoubleExpModel' -> IO BatesDoubleExpModel
peekBatesDoubleExpModel = Ptr CBatesDoubleExpModel'
-> IO
     (GenForeignPtr
        (ForeignPtr CBatesDoubleExpModel') CBatesDoubleExpModel')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CBatesDoubleExpModel'
 -> IO
      (GenForeignPtr
         (ForeignPtr CBatesDoubleExpModel') CBatesDoubleExpModel'))
-> (GenForeignPtr
      (ForeignPtr CBatesDoubleExpModel') CBatesDoubleExpModel'
    -> IO BatesDoubleExpModel)
-> Ptr CBatesDoubleExpModel'
-> IO BatesDoubleExpModel
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CBatesDoubleExpModel') CBatesDoubleExpModel'
-> IO BatesDoubleExpModel
forall bdem.
GenForeignPtr bdem CBatesDoubleExpModel'
-> IO (GenBatesDoubleExpModel bdem)
newGenBatesDoubleExpModel
withBatesDoubleExpModel :: GenBatesDoubleExpModel bdem -> (Ptr CBatesDoubleExpModel' -> IO b) -> IO b
withBatesDoubleExpModel :: forall bdem b.
GenBatesDoubleExpModel bdem
-> (Ptr CBatesDoubleExpModel' -> IO b) -> IO b
withBatesDoubleExpModel = GenForeignPtr bdem CBatesDoubleExpModel'
-> (Ptr CBatesDoubleExpModel' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr bdem CBatesDoubleExpModel'
 -> (Ptr CBatesDoubleExpModel' -> IO b) -> IO b)
-> (GenBatesDoubleExpModel bdem
    -> GenForeignPtr bdem CBatesDoubleExpModel')
-> GenBatesDoubleExpModel bdem
-> (Ptr CBatesDoubleExpModel' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel'
-> GenForeignPtr bdem CBatesDoubleExpModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel'
 -> GenForeignPtr bdem CBatesDoubleExpModel')
-> (GenBatesDoubleExpModel bdem
    -> GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel')
-> GenBatesDoubleExpModel bdem
-> GenForeignPtr bdem CBatesDoubleExpModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
  CCalibratedModel'
-> GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
   CCalibratedModel'
 -> GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel')
-> (GenBatesDoubleExpModel bdem
    -> GenForeignPtr
         (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
         CCalibratedModel')
-> GenBatesDoubleExpModel bdem
-> GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBatesDoubleExpModel bdem
-> GenForeignPtr
     (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
     CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel
newGenBatesDoubleExpModel :: GenForeignPtr bdem CBatesDoubleExpModel' -> IO (GenBatesDoubleExpModel bdem)
newGenBatesDoubleExpModel :: forall bdem.
GenForeignPtr bdem CBatesDoubleExpModel'
-> IO (GenBatesDoubleExpModel bdem)
newGenBatesDoubleExpModel = GenBatesDoubleExpModel bdem -> IO (GenBatesDoubleExpModel bdem)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenBatesDoubleExpModel bdem -> IO (GenBatesDoubleExpModel bdem))
-> (GenForeignPtr bdem CBatesDoubleExpModel'
    -> GenBatesDoubleExpModel bdem)
-> GenForeignPtr bdem CBatesDoubleExpModel'
-> IO (GenBatesDoubleExpModel bdem)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
  CCalibratedModel'
-> GenBatesDoubleExpModel bdem
forall m. GenForeignPtr m CCalibratedModel' -> GenCalibratedModel m
GenCalibratedModel (GenForeignPtr
   (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
   CCalibratedModel'
 -> GenBatesDoubleExpModel bdem)
-> (GenForeignPtr bdem CBatesDoubleExpModel'
    -> GenForeignPtr
         (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
         CCalibratedModel')
-> GenForeignPtr bdem CBatesDoubleExpModel'
-> GenBatesDoubleExpModel bdem
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel'
-> GenForeignPtr
     (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
     CCalibratedModel'
GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel'
-> GenForeignPtr
     (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
     (Base CHestonModel')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel'
 -> GenForeignPtr
      (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
      CCalibratedModel')
-> (GenForeignPtr bdem CBatesDoubleExpModel'
    -> GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel')
-> GenForeignPtr bdem CBatesDoubleExpModel'
-> GenForeignPtr
     (AnyOf CHestonModel' (AnyOf CBatesDoubleExpModel' bdem))
     CCalibratedModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr bdem CBatesDoubleExpModel'
-> GenForeignPtr (AnyOf CBatesDoubleExpModel' bdem) CHestonModel'
GenForeignPtr bdem CBatesDoubleExpModel'
-> GenForeignPtr
     (AnyOf CBatesDoubleExpModel' bdem) (Base CBatesDoubleExpModel')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekBatesDoubleExpDetJumpModel :: Ptr CBatesDoubleExpDetJumpModel' -> IO BatesDoubleExpDetJumpModel
peekBatesDoubleExpDetJumpModel :: Ptr CBatesDoubleExpDetJumpModel' -> IO BatesDoubleExpDetJumpModel
peekBatesDoubleExpDetJumpModel = Ptr CBatesDoubleExpDetJumpModel'
-> IO
     (GenForeignPtr
        (ForeignPtr CBatesDoubleExpDetJumpModel') CBatesDoubleExpModel')
Ptr CBatesDoubleExpDetJumpModel'
-> IO
     (GenForeignPtr
        (ForeignPtr CBatesDoubleExpDetJumpModel')
        (Base CBatesDoubleExpDetJumpModel'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CBatesDoubleExpDetJumpModel'
 -> IO
      (GenForeignPtr
         (ForeignPtr CBatesDoubleExpDetJumpModel') CBatesDoubleExpModel'))
-> (GenForeignPtr
      (ForeignPtr CBatesDoubleExpDetJumpModel') CBatesDoubleExpModel'
    -> IO BatesDoubleExpDetJumpModel)
-> Ptr CBatesDoubleExpDetJumpModel'
-> IO BatesDoubleExpDetJumpModel
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CBatesDoubleExpDetJumpModel') CBatesDoubleExpModel'
-> IO BatesDoubleExpDetJumpModel
forall bdem.
GenForeignPtr bdem CBatesDoubleExpModel'
-> IO (GenBatesDoubleExpModel bdem)
newGenBatesDoubleExpModel
withBatesDoubleExpDetJumpModel :: BatesDoubleExpDetJumpModel -> (Ptr CBatesDoubleExpDetJumpModel' -> IO b) -> IO b
withBatesDoubleExpDetJumpModel :: forall b.
BatesDoubleExpDetJumpModel
-> (Ptr CBatesDoubleExpDetJumpModel' -> IO b) -> IO b
withBatesDoubleExpDetJumpModel = ForeignPtr CBatesDoubleExpDetJumpModel'
-> (Ptr CBatesDoubleExpDetJumpModel' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CBatesDoubleExpDetJumpModel'
 -> (Ptr CBatesDoubleExpDetJumpModel' -> IO b) -> IO b)
-> (BatesDoubleExpDetJumpModel
    -> ForeignPtr CBatesDoubleExpDetJumpModel')
-> BatesDoubleExpDetJumpModel
-> (Ptr CBatesDoubleExpDetJumpModel' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CBatesDoubleExpDetJumpModel') CBatesDoubleExpModel'
-> ForeignPtr CBatesDoubleExpDetJumpModel'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CBatesDoubleExpDetJumpModel') CBatesDoubleExpModel'
 -> ForeignPtr CBatesDoubleExpDetJumpModel')
-> (BatesDoubleExpDetJumpModel
    -> GenForeignPtr
         (ForeignPtr CBatesDoubleExpDetJumpModel') CBatesDoubleExpModel')
-> BatesDoubleExpDetJumpModel
-> ForeignPtr CBatesDoubleExpDetJumpModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CBatesDoubleExpModel' (ForeignPtr CBatesDoubleExpDetJumpModel'))
  CHestonModel'
-> GenForeignPtr
     (ForeignPtr CBatesDoubleExpDetJumpModel') CBatesDoubleExpModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CBatesDoubleExpModel' (ForeignPtr CBatesDoubleExpDetJumpModel'))
   CHestonModel'
 -> GenForeignPtr
      (ForeignPtr CBatesDoubleExpDetJumpModel') CBatesDoubleExpModel')
-> (BatesDoubleExpDetJumpModel
    -> GenForeignPtr
         (AnyOf
            CBatesDoubleExpModel' (ForeignPtr CBatesDoubleExpDetJumpModel'))
         CHestonModel')
-> BatesDoubleExpDetJumpModel
-> GenForeignPtr
     (ForeignPtr CBatesDoubleExpDetJumpModel') CBatesDoubleExpModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CHestonModel'
     (AnyOf
        CBatesDoubleExpModel' (ForeignPtr CBatesDoubleExpDetJumpModel')))
  CCalibratedModel'
-> GenForeignPtr
     (AnyOf
        CBatesDoubleExpModel' (ForeignPtr CBatesDoubleExpDetJumpModel'))
     CHestonModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CHestonModel'
      (AnyOf
         CBatesDoubleExpModel' (ForeignPtr CBatesDoubleExpDetJumpModel')))
   CCalibratedModel'
 -> GenForeignPtr
      (AnyOf
         CBatesDoubleExpModel' (ForeignPtr CBatesDoubleExpDetJumpModel'))
      CHestonModel')
-> (BatesDoubleExpDetJumpModel
    -> GenForeignPtr
         (AnyOf
            CHestonModel'
            (AnyOf
               CBatesDoubleExpModel' (ForeignPtr CBatesDoubleExpDetJumpModel')))
         CCalibratedModel')
-> BatesDoubleExpDetJumpModel
-> GenForeignPtr
     (AnyOf
        CBatesDoubleExpModel' (ForeignPtr CBatesDoubleExpDetJumpModel'))
     CHestonModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BatesDoubleExpDetJumpModel
-> GenForeignPtr
     (AnyOf
        CHestonModel'
        (AnyOf
           CBatesDoubleExpModel' (ForeignPtr CBatesDoubleExpDetJumpModel')))
     CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel

asOneFactorAffineModel :: GenOneFactorAffineModel om -> IO OneFactorAffineModel
asOneFactorAffineModel :: forall om. GenOneFactorAffineModel om -> IO OneFactorAffineModel
asOneFactorAffineModel = (Ptr COneFactorAffineModel' -> IO OneFactorAffineModel)
-> GenForeignPtr om COneFactorAffineModel'
-> IO OneFactorAffineModel
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr COneFactorAffineModel' -> IO OneFactorAffineModel
peekOneFactorAffineModel (GenForeignPtr om COneFactorAffineModel'
 -> IO OneFactorAffineModel)
-> (GenOneFactorAffineModel om
    -> GenForeignPtr om COneFactorAffineModel')
-> GenOneFactorAffineModel om
-> IO OneFactorAffineModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf COneFactorAffineModel' om) CShortRateModel'
-> GenForeignPtr om COneFactorAffineModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf COneFactorAffineModel' om) CShortRateModel'
 -> GenForeignPtr om COneFactorAffineModel')
-> (GenOneFactorAffineModel om
    -> GenForeignPtr
         (AnyOf COneFactorAffineModel' om) CShortRateModel')
-> GenOneFactorAffineModel om
-> GenForeignPtr om COneFactorAffineModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
  CCalibratedModel'
-> GenForeignPtr (AnyOf COneFactorAffineModel' om) CShortRateModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
   CCalibratedModel'
 -> GenForeignPtr
      (AnyOf COneFactorAffineModel' om) CShortRateModel')
-> (GenOneFactorAffineModel om
    -> GenForeignPtr
         (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
         CCalibratedModel')
-> GenOneFactorAffineModel om
-> GenForeignPtr (AnyOf COneFactorAffineModel' om) CShortRateModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenOneFactorAffineModel om
-> GenForeignPtr
     (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
     CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel
peekOneFactorAffineModel :: Ptr COneFactorAffineModel' -> IO OneFactorAffineModel
peekOneFactorAffineModel :: Ptr COneFactorAffineModel' -> IO OneFactorAffineModel
peekOneFactorAffineModel = Ptr COneFactorAffineModel'
-> IO
     (GenForeignPtr
        (ForeignPtr COneFactorAffineModel') COneFactorAffineModel')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr COneFactorAffineModel'
 -> IO
      (GenForeignPtr
         (ForeignPtr COneFactorAffineModel') COneFactorAffineModel'))
-> (GenForeignPtr
      (ForeignPtr COneFactorAffineModel') COneFactorAffineModel'
    -> IO OneFactorAffineModel)
-> Ptr COneFactorAffineModel'
-> IO OneFactorAffineModel
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr COneFactorAffineModel') COneFactorAffineModel'
-> IO OneFactorAffineModel
forall om.
GenForeignPtr om COneFactorAffineModel'
-> IO (GenOneFactorAffineModel om)
newGenOneFactorAffineModel
withOneFactorAffineModel :: GenOneFactorAffineModel om -> (Ptr COneFactorAffineModel' -> IO b) -> IO b
withOneFactorAffineModel :: forall om b.
GenOneFactorAffineModel om
-> (Ptr COneFactorAffineModel' -> IO b) -> IO b
withOneFactorAffineModel = GenForeignPtr om COneFactorAffineModel'
-> (Ptr COneFactorAffineModel' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr om COneFactorAffineModel'
 -> (Ptr COneFactorAffineModel' -> IO b) -> IO b)
-> (GenOneFactorAffineModel om
    -> GenForeignPtr om COneFactorAffineModel')
-> GenOneFactorAffineModel om
-> (Ptr COneFactorAffineModel' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf COneFactorAffineModel' om) CShortRateModel'
-> GenForeignPtr om COneFactorAffineModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf COneFactorAffineModel' om) CShortRateModel'
 -> GenForeignPtr om COneFactorAffineModel')
-> (GenOneFactorAffineModel om
    -> GenForeignPtr
         (AnyOf COneFactorAffineModel' om) CShortRateModel')
-> GenOneFactorAffineModel om
-> GenForeignPtr om COneFactorAffineModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
  CCalibratedModel'
-> GenForeignPtr (AnyOf COneFactorAffineModel' om) CShortRateModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
   CCalibratedModel'
 -> GenForeignPtr
      (AnyOf COneFactorAffineModel' om) CShortRateModel')
-> (GenOneFactorAffineModel om
    -> GenForeignPtr
         (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
         CCalibratedModel')
-> GenOneFactorAffineModel om
-> GenForeignPtr (AnyOf COneFactorAffineModel' om) CShortRateModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenOneFactorAffineModel om
-> GenForeignPtr
     (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
     CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel
newGenOneFactorAffineModel :: GenForeignPtr om COneFactorAffineModel' -> IO (GenOneFactorAffineModel om)
newGenOneFactorAffineModel :: forall om.
GenForeignPtr om COneFactorAffineModel'
-> IO (GenOneFactorAffineModel om)
newGenOneFactorAffineModel = GenOneFactorAffineModel om -> IO (GenOneFactorAffineModel om)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenOneFactorAffineModel om -> IO (GenOneFactorAffineModel om))
-> (GenForeignPtr om COneFactorAffineModel'
    -> GenOneFactorAffineModel om)
-> GenForeignPtr om COneFactorAffineModel'
-> IO (GenOneFactorAffineModel om)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
  CCalibratedModel'
-> GenOneFactorAffineModel om
forall m. GenForeignPtr m CCalibratedModel' -> GenCalibratedModel m
GenCalibratedModel (GenForeignPtr
   (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
   CCalibratedModel'
 -> GenOneFactorAffineModel om)
-> (GenForeignPtr om COneFactorAffineModel'
    -> GenForeignPtr
         (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
         CCalibratedModel')
-> GenForeignPtr om COneFactorAffineModel'
-> GenOneFactorAffineModel om
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf COneFactorAffineModel' om) CShortRateModel'
-> GenForeignPtr
     (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
     CCalibratedModel'
GenForeignPtr (AnyOf COneFactorAffineModel' om) CShortRateModel'
-> GenForeignPtr
     (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
     (Base CShortRateModel')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf COneFactorAffineModel' om) CShortRateModel'
 -> GenForeignPtr
      (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
      CCalibratedModel')
-> (GenForeignPtr om COneFactorAffineModel'
    -> GenForeignPtr
         (AnyOf COneFactorAffineModel' om) CShortRateModel')
-> GenForeignPtr om COneFactorAffineModel'
-> GenForeignPtr
     (AnyOf CShortRateModel' (AnyOf COneFactorAffineModel' om))
     CCalibratedModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr om COneFactorAffineModel'
-> GenForeignPtr (AnyOf COneFactorAffineModel' om) CShortRateModel'
GenForeignPtr om COneFactorAffineModel'
-> GenForeignPtr
     (AnyOf COneFactorAffineModel' om) (Base COneFactorAffineModel')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf

peekHullWhite :: Ptr CHullWhite' -> IO HullWhite
peekHullWhite :: Ptr CHullWhite' -> IO HullWhite
peekHullWhite = Ptr CHullWhite'
-> IO
     (GenForeignPtr (ForeignPtr CHullWhite') COneFactorAffineModel')
Ptr CHullWhite'
-> IO (GenForeignPtr (ForeignPtr CHullWhite') (Base CHullWhite'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CHullWhite'
 -> IO
      (GenForeignPtr (ForeignPtr CHullWhite') COneFactorAffineModel'))
-> (GenForeignPtr (ForeignPtr CHullWhite') COneFactorAffineModel'
    -> IO HullWhite)
-> Ptr CHullWhite'
-> IO HullWhite
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CHullWhite') COneFactorAffineModel'
-> IO HullWhite
forall om.
GenForeignPtr om COneFactorAffineModel'
-> IO (GenOneFactorAffineModel om)
newGenOneFactorAffineModel
withHullWhite :: HullWhite -> (Ptr CHullWhite' -> IO b) -> IO b
withHullWhite :: forall b. HullWhite -> (Ptr CHullWhite' -> IO b) -> IO b
withHullWhite = ForeignPtr CHullWhite' -> (Ptr CHullWhite' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CHullWhite' -> (Ptr CHullWhite' -> IO b) -> IO b)
-> (HullWhite -> ForeignPtr CHullWhite')
-> HullWhite
-> (Ptr CHullWhite' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CHullWhite') COneFactorAffineModel'
-> ForeignPtr CHullWhite'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CHullWhite') COneFactorAffineModel'
 -> ForeignPtr CHullWhite')
-> (HullWhite
    -> GenForeignPtr (ForeignPtr CHullWhite') COneFactorAffineModel')
-> HullWhite
-> ForeignPtr CHullWhite'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COneFactorAffineModel' (ForeignPtr CHullWhite'))
  CShortRateModel'
-> GenForeignPtr (ForeignPtr CHullWhite') COneFactorAffineModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COneFactorAffineModel' (ForeignPtr CHullWhite'))
   CShortRateModel'
 -> GenForeignPtr (ForeignPtr CHullWhite') COneFactorAffineModel')
-> (HullWhite
    -> GenForeignPtr
         (AnyOf COneFactorAffineModel' (ForeignPtr CHullWhite'))
         CShortRateModel')
-> HullWhite
-> GenForeignPtr (ForeignPtr CHullWhite') COneFactorAffineModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CShortRateModel'
     (AnyOf COneFactorAffineModel' (ForeignPtr CHullWhite')))
  CCalibratedModel'
-> GenForeignPtr
     (AnyOf COneFactorAffineModel' (ForeignPtr CHullWhite'))
     CShortRateModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CShortRateModel'
      (AnyOf COneFactorAffineModel' (ForeignPtr CHullWhite')))
   CCalibratedModel'
 -> GenForeignPtr
      (AnyOf COneFactorAffineModel' (ForeignPtr CHullWhite'))
      CShortRateModel')
-> (HullWhite
    -> GenForeignPtr
         (AnyOf
            CShortRateModel'
            (AnyOf COneFactorAffineModel' (ForeignPtr CHullWhite')))
         CCalibratedModel')
-> HullWhite
-> GenForeignPtr
     (AnyOf COneFactorAffineModel' (ForeignPtr CHullWhite'))
     CShortRateModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HullWhite
-> GenForeignPtr
     (AnyOf
        CShortRateModel'
        (AnyOf COneFactorAffineModel' (ForeignPtr CHullWhite')))
     CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel

peekG2 :: Ptr CG2' -> IO G2
peekG2 :: Ptr CG2' -> IO G2
peekG2 = Ptr CG2' -> IO G2
forall sm.
(Finalizable sm, Upcastable sm, Base sm ~ CShortRateModel') =>
Ptr sm -> IO (GenShortRateModel (ForeignPtr sm))
peekGenShortRateModel
withG2 :: G2 -> (Ptr CG2' -> IO b) -> IO b
withG2 :: forall b. G2 -> (Ptr CG2' -> IO b) -> IO b
withG2 = ForeignPtr CG2' -> (Ptr CG2' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CG2' -> (Ptr CG2' -> IO b) -> IO b)
-> (G2 -> ForeignPtr CG2') -> G2 -> (Ptr CG2' -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CG2') CShortRateModel' -> ForeignPtr CG2'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CG2') CShortRateModel'
 -> ForeignPtr CG2')
-> (G2 -> GenForeignPtr (ForeignPtr CG2') CShortRateModel')
-> G2
-> ForeignPtr CG2'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CShortRateModel' (ForeignPtr CG2')) CCalibratedModel'
-> GenForeignPtr (ForeignPtr CG2') CShortRateModel'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CShortRateModel' (ForeignPtr CG2')) CCalibratedModel'
 -> GenForeignPtr (ForeignPtr CG2') CShortRateModel')
-> (G2
    -> GenForeignPtr
         (AnyOf CShortRateModel' (ForeignPtr CG2')) CCalibratedModel')
-> G2
-> GenForeignPtr (ForeignPtr CG2') CShortRateModel'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. G2
-> GenForeignPtr
     (AnyOf CShortRateModel' (ForeignPtr CG2')) CCalibratedModel'
forall m. GenCalibratedModel m -> GenForeignPtr m CCalibratedModel'
getCalibratedModel

foreign import ccall "ql.h qlOneFactorAffineModelAsAffineModel" qlOneFactorAffineModelAsAffineModel :: Ptr COneFactorAffineModel' -> IO (Ptr CAffineModel')
foreign import ccall "ql.h qlLiborForwardModelAsAffineModel" qlLiborForwardModelAsAffineModel :: Ptr CLiborForwardModel' -> IO (Ptr CAffineModel')
foreign import ccall "ql.h qlG2AsAffineModel" qlG2AsAffineModel :: Ptr CG2' -> IO (Ptr CAffineModel')

type AffineModel = Standalone CAffineModel'

-- |Models that can be materialized as QuantLib's secondary @AffineModel@ interface.
-- The result owns a shared handle to the same underlying model.
class AsAffineModel model where
  asAffineModel :: model -> IO AffineModel
instance AsAffineModel (GenOneFactorAffineModel model) where
  asAffineModel :: GenOneFactorAffineModel model -> IO AffineModel
asAffineModel GenOneFactorAffineModel model
m = GenOneFactorAffineModel model
-> (Ptr COneFactorAffineModel' -> IO (Ptr CAffineModel'))
-> IO (Ptr CAffineModel')
forall om b.
GenOneFactorAffineModel om
-> (Ptr COneFactorAffineModel' -> IO b) -> IO b
withOneFactorAffineModel GenOneFactorAffineModel model
m Ptr COneFactorAffineModel' -> IO (Ptr CAffineModel')
qlOneFactorAffineModelAsAffineModel IO (Ptr CAffineModel')
-> (Ptr CAffineModel' -> IO AffineModel) -> IO AffineModel
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Ptr CAffineModel' -> IO AffineModel
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
instance AsAffineModel G2 where
  asAffineModel :: G2 -> IO AffineModel
asAffineModel G2
m = G2
-> (Ptr CG2' -> IO (Ptr CAffineModel')) -> IO (Ptr CAffineModel')
forall b. G2 -> (Ptr CG2' -> IO b) -> IO b
withG2 G2
m Ptr CG2' -> IO (Ptr CAffineModel')
qlG2AsAffineModel IO (Ptr CAffineModel')
-> (Ptr CAffineModel' -> IO AffineModel) -> IO AffineModel
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Ptr CAffineModel' -> IO AffineModel
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
instance AsAffineModel LiborForwardModel where
  asAffineModel :: LiborForwardModel -> IO AffineModel
asAffineModel LiborForwardModel
m = LiborForwardModel
-> (Ptr CLiborForwardModel' -> IO (Ptr CAffineModel'))
-> IO (Ptr CAffineModel')
forall m b.
GenCalibratedModel (ForeignPtr m) -> (Ptr m -> IO b) -> IO b
withGenCalibratedModel LiborForwardModel
m Ptr CLiborForwardModel' -> IO (Ptr CAffineModel')
qlLiborForwardModelAsAffineModel IO (Ptr CAffineModel')
-> (Ptr CAffineModel' -> IO AffineModel) -> IO AffineModel
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Ptr CAffineModel' -> IO AffineModel
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
instance AsAffineModel AffineModel where
  asAffineModel :: AffineModel -> IO AffineModel
asAffineModel = AffineModel -> IO AffineModel
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure

-- |The two-factor short-rate dynamics (state variables @x@, @y@ with @r_t = phi(t) + x_t + y_t@)
-- underlying a 'G2' model, as returned by @TwoFactorModel::dynamics()@.
type ShortRateDynamics = Standalone CShortRateDynamics'

data CGaussian1dModel'
foreign import ccall unsafe "ql.h &qlFreeGaussian1dModel" qlFreeGaussian1dModel :: FinalizerPtr CGaussian1dModel'
instance Finalizable CGaussian1dModel' where finalize :: FinalizerPtr CGaussian1dModel'
finalize = FinalizerPtr CGaussian1dModel'
qlFreeGaussian1dModel
foreign import ccall "ql.h qlGsrAsGaussian1dModel" qlGsrAsGaussian1dModel :: Ptr CGsr' -> IO (Ptr CGaussian1dModel')
foreign import ccall "ql.h qlMarkovFunctionalAsGaussian1dModel" qlMarkovFunctionalAsGaussian1dModel :: Ptr CMarkovFunctional' -> IO (Ptr CGaussian1dModel')
type Gaussian1dModel = Standalone CGaussian1dModel'

-- |Models that can be materialized as QuantLib's secondary @Gaussian1dModel@ interface.
-- The result owns a shared handle to the same underlying model.
class AsGaussian1dModel model where
  asGaussian1dModel :: model -> IO Gaussian1dModel
instance AsGaussian1dModel Gsr where
  asGaussian1dModel :: Gsr -> IO Gaussian1dModel
asGaussian1dModel Gsr
m = Gsr
-> (Ptr CGsr' -> IO (Ptr CGaussian1dModel'))
-> IO (Ptr CGaussian1dModel')
forall m b.
GenCalibratedModel (ForeignPtr m) -> (Ptr m -> IO b) -> IO b
withGenCalibratedModel Gsr
m Ptr CGsr' -> IO (Ptr CGaussian1dModel')
qlGsrAsGaussian1dModel IO (Ptr CGaussian1dModel')
-> (Ptr CGaussian1dModel' -> IO Gaussian1dModel)
-> IO Gaussian1dModel
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Ptr CGaussian1dModel' -> IO Gaussian1dModel
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
instance AsGaussian1dModel MarkovFunctional where
  asGaussian1dModel :: MarkovFunctional -> IO Gaussian1dModel
asGaussian1dModel MarkovFunctional
m = MarkovFunctional
-> (Ptr CMarkovFunctional' -> IO (Ptr CGaussian1dModel'))
-> IO (Ptr CGaussian1dModel')
forall m b.
GenCalibratedModel (ForeignPtr m) -> (Ptr m -> IO b) -> IO b
withGenCalibratedModel MarkovFunctional
m Ptr CMarkovFunctional' -> IO (Ptr CGaussian1dModel')
qlMarkovFunctionalAsGaussian1dModel IO (Ptr CGaussian1dModel')
-> (Ptr CGaussian1dModel' -> IO Gaussian1dModel)
-> IO Gaussian1dModel
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Ptr CGaussian1dModel' -> IO Gaussian1dModel
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
instance AsGaussian1dModel Gaussian1dModel where
  asGaussian1dModel :: Gaussian1dModel -> IO Gaussian1dModel
asGaussian1dModel = Gaussian1dModel -> IO Gaussian1dModel
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure

-- |The root of the hierarchy shown under t'GenInstrument'.
type Instrument = GenInstrument CInstrument
data CInstrument'
-- | > Instrument*
-- >  Forward*
-- >    BondForward
-- >  ForwardRateAgreement
-- >  FxForward
-- >  VarianceSwap
-- >  VarianceOption
-- >  Option*
-- >    CdsOption
-- >    MultiAssetOption
-- >      MargrabeOption
-- >      EverestOption
-- >    OneAssetOption
-- >      BarrierOption
-- >      DoubleBarrierOption
-- >      SoftBarrierOption
-- >      VanillaOption
-- >      QuantoVanillaOption
-- >      QuantoForwardVanillaOption
-- >      QuantoBarrierOption
-- >      QuantoDoubleBarrierOption
-- >    Swaption
-- >    NonstandardSwaption
-- >    FloatFloatSwaption
-- >    IrregularSwaption
-- >  Swap*
-- >    FixedVsFloatingSwap*
-- >      VanillaSwap
-- >    IrregularSwap
-- >    NonstandardSwap
-- >    FloatFloatSwap
-- >    AssetSwap
-- >    BMASwap
-- >    OvernightIndexedSwap
-- >    ZeroCouponInflationSwap
-- >    YearOnYearInflationSwap
-- >    CPISwap
-- >    ZeroCouponSwap
-- >    EquityTotalReturnSwap
-- >    ConstNotionalCrossCurrencySwap
-- >      ConstNotionalCrossCurrencyBasisSwap
-- >      ConstNotionalCrossCurrencyFixedVsFloatingSwap
-- >  CreditDefaultSwap
-- >  SyntheticCDO
-- >  NthToDefault
-- >  CapFloor
-- >  YoYInflationCapFloor
-- >  CPICapFloor
-- >  Bond
-- >    ConvertibleBond
-- >    FixedRateBond
-- >      BTP
-- >    CallableBond
-- >    CPIBond
-- >  Commodity*
-- >    EnergyCommodity*
-- >      EnergyFuture
-- >      EnergySwap*
-- >        EnergyVanillaSwap
-- >        EnergyBasisSwap
newtype GenInstrument i = GenInstrument {forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument :: GenForeignPtr i CInstrument'}
type CInstrument = ForeignPtr CInstrument'
foreign import ccall unsafe "ql.h &qlFreeInstrument" qlFreeInstrument :: FinalizerPtr CInstrument'
instance Finalizable CInstrument' where finalize :: FinalizerPtr CInstrument'
finalize = FinalizerPtr CInstrument'
qlFreeInstrument
asInstrument :: GenInstrument i -> IO Instrument
asInstrument :: forall i. GenInstrument i -> IO Instrument
asInstrument = (Ptr CInstrument' -> IO Instrument)
-> GenForeignPtr i CInstrument' -> IO Instrument
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CInstrument' -> IO Instrument
peekInstrument (GenForeignPtr i CInstrument' -> IO Instrument)
-> (GenInstrument i -> GenForeignPtr i CInstrument')
-> GenInstrument i
-> IO Instrument
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenInstrument i -> GenForeignPtr i CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
peekInstrument :: Ptr CInstrument' -> IO Instrument
peekInstrument :: Ptr CInstrument' -> IO Instrument
peekInstrument = GenForeignPtr CInstrument CInstrument' -> Instrument
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr CInstrument CInstrument' -> Instrument)
-> (Ptr CInstrument'
    -> IO (GenForeignPtr CInstrument CInstrument'))
-> Ptr CInstrument'
-> IO Instrument
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CInstrument' -> IO (GenForeignPtr CInstrument CInstrument')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr
withInstrument :: GenInstrument i -> (Ptr CInstrument' -> IO b) -> IO b
withInstrument :: forall i b. GenInstrument i -> (Ptr CInstrument' -> IO b) -> IO b
withInstrument = GenForeignPtr i CInstrument' -> (Ptr CInstrument' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr i CInstrument'
 -> (Ptr CInstrument' -> IO b) -> IO b)
-> (GenInstrument i -> GenForeignPtr i CInstrument')
-> GenInstrument i
-> (Ptr CInstrument' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenInstrument i -> GenForeignPtr i CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
withGenInstrument :: GenInstrument (ForeignPtr i) -> (Ptr i -> IO b) -> IO b
withGenInstrument :: forall i b. GenInstrument (ForeignPtr i) -> (Ptr i -> IO b) -> IO b
withGenInstrument = ForeignPtr i -> (Ptr i -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr i -> (Ptr i -> IO b) -> IO b)
-> (GenInstrument (ForeignPtr i) -> ForeignPtr i)
-> GenInstrument (ForeignPtr i)
-> (Ptr i -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr i) CInstrument' -> ForeignPtr i
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr i) CInstrument' -> ForeignPtr i)
-> (GenInstrument (ForeignPtr i)
    -> GenForeignPtr (ForeignPtr i) CInstrument')
-> GenInstrument (ForeignPtr i)
-> ForeignPtr i
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenInstrument (ForeignPtr i)
-> GenForeignPtr (ForeignPtr i) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CForwardRateAgreement'
type CForwardRateAgreement = ForeignPtr CForwardRateAgreement'
-- |An 'Instrument'; see the hierarchy under t'GenInstrument'.
type ForwardRateAgreement = GenInstrument CForwardRateAgreement
foreign import ccall unsafe "ql.h &qlFreeForwardRateAgreement" qlFreeForwardRateAgreement :: FinalizerPtr CForwardRateAgreement'
instance Finalizable CForwardRateAgreement' where finalize :: FinalizerPtr CForwardRateAgreement'
finalize = FinalizerPtr CForwardRateAgreement'
qlFreeForwardRateAgreement
foreign import ccall "ql.h qlForwardRateAgreementAsInstrument" qlForwardRateAgreementAsInstrument :: Ptr CForwardRateAgreement' -> IO (Ptr CInstrument')
instance Upcastable CForwardRateAgreement' where {type Base CForwardRateAgreement' = CInstrument'; upcast :: Ptr CForwardRateAgreement'
-> IO (Ptr (Base CForwardRateAgreement'))
upcast = Ptr CForwardRateAgreement' -> IO (Ptr CInstrument')
Ptr CForwardRateAgreement'
-> IO (Ptr (Base CForwardRateAgreement'))
qlForwardRateAgreementAsInstrument}
peekForwardRateAgreement :: Ptr CForwardRateAgreement' -> IO ForwardRateAgreement
peekForwardRateAgreement :: Ptr CForwardRateAgreement' -> IO ForwardRateAgreement
peekForwardRateAgreement = GenForeignPtr CForwardRateAgreement CInstrument'
-> ForwardRateAgreement
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr CForwardRateAgreement CInstrument'
 -> ForwardRateAgreement)
-> (Ptr CForwardRateAgreement'
    -> IO (GenForeignPtr CForwardRateAgreement CInstrument'))
-> Ptr CForwardRateAgreement'
-> IO ForwardRateAgreement
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CForwardRateAgreement'
-> IO (GenForeignPtr CForwardRateAgreement CInstrument')
Ptr CForwardRateAgreement'
-> IO
     (GenForeignPtr CForwardRateAgreement (Base CForwardRateAgreement'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr

data CFxForward'
type CFxForward = ForeignPtr CFxForward'
-- |An 'Instrument'; see the hierarchy under t'GenInstrument'.
type FxForward = GenInstrument CFxForward
foreign import ccall unsafe "ql.h &qlFreeFxForward" qlFreeFxForward :: FinalizerPtr CFxForward'
instance Finalizable CFxForward' where finalize :: FinalizerPtr CFxForward'
finalize = FinalizerPtr CFxForward'
qlFreeFxForward
foreign import ccall "ql.h qlFxForwardAsInstrument" qlFxForwardAsInstrument :: Ptr CFxForward' -> IO (Ptr CInstrument')
instance Upcastable CFxForward' where {type Base CFxForward' = CInstrument'; upcast :: Ptr CFxForward' -> IO (Ptr (Base CFxForward'))
upcast = Ptr CFxForward' -> IO (Ptr CInstrument')
Ptr CFxForward' -> IO (Ptr (Base CFxForward'))
qlFxForwardAsInstrument}
peekFxForward :: Ptr CFxForward' -> IO FxForward
peekFxForward :: Ptr CFxForward' -> IO FxForward
peekFxForward = GenForeignPtr CFxForward CInstrument' -> FxForward
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr CFxForward CInstrument' -> FxForward)
-> (Ptr CFxForward' -> IO (GenForeignPtr CFxForward CInstrument'))
-> Ptr CFxForward'
-> IO FxForward
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CFxForward' -> IO (GenForeignPtr CFxForward CInstrument')
Ptr CFxForward' -> IO (GenForeignPtr CFxForward (Base CFxForward'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr

data CCreditDefaultSwap'
type CCreditDefaultSwap = ForeignPtr CCreditDefaultSwap'
-- |An 'Instrument'; see the hierarchy under t'GenInstrument'.
type CreditDefaultSwap = GenInstrument CCreditDefaultSwap
foreign import ccall unsafe "ql.h &qlFreeCreditDefaultSwap" qlFreeCreditDefaultSwap :: FinalizerPtr CCreditDefaultSwap'
instance Finalizable CCreditDefaultSwap' where finalize :: FinalizerPtr CCreditDefaultSwap'
finalize = FinalizerPtr CCreditDefaultSwap'
qlFreeCreditDefaultSwap
foreign import ccall "ql.h qlCreditDefaultSwapAsInstrument" qlCreditDefaultSwapAsInstrument :: Ptr CCreditDefaultSwap' -> IO (Ptr CInstrument')
instance Upcastable CCreditDefaultSwap' where {type Base CCreditDefaultSwap' = CInstrument'; upcast :: Ptr CCreditDefaultSwap' -> IO (Ptr (Base CCreditDefaultSwap'))
upcast = Ptr CCreditDefaultSwap' -> IO (Ptr CInstrument')
Ptr CCreditDefaultSwap' -> IO (Ptr (Base CCreditDefaultSwap'))
qlCreditDefaultSwapAsInstrument}
peekCreditDefaultSwap :: Ptr CCreditDefaultSwap' -> IO CreditDefaultSwap
peekCreditDefaultSwap :: Ptr CCreditDefaultSwap' -> IO CreditDefaultSwap
peekCreditDefaultSwap = GenForeignPtr CCreditDefaultSwap CInstrument' -> CreditDefaultSwap
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr CCreditDefaultSwap CInstrument'
 -> CreditDefaultSwap)
-> (Ptr CCreditDefaultSwap'
    -> IO (GenForeignPtr CCreditDefaultSwap CInstrument'))
-> Ptr CCreditDefaultSwap'
-> IO CreditDefaultSwap
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCreditDefaultSwap'
-> IO (GenForeignPtr CCreditDefaultSwap CInstrument')
Ptr CCreditDefaultSwap'
-> IO (GenForeignPtr CCreditDefaultSwap (Base CCreditDefaultSwap'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr

data CSyntheticCDO'
type CSyntheticCDO = ForeignPtr CSyntheticCDO'
-- |An 'Instrument'; see the hierarchy under t'GenInstrument'.
type SyntheticCDO = GenInstrument CSyntheticCDO
foreign import ccall unsafe "ql.h &qlFreeSyntheticCDO" qlFreeSyntheticCDO :: FinalizerPtr CSyntheticCDO'
instance Finalizable CSyntheticCDO' where finalize :: FinalizerPtr CSyntheticCDO'
finalize = FinalizerPtr CSyntheticCDO'
qlFreeSyntheticCDO
foreign import ccall "ql.h qlSyntheticCDOAsInstrument" qlSyntheticCDOAsInstrument :: Ptr CSyntheticCDO' -> IO (Ptr CInstrument')
instance Upcastable CSyntheticCDO' where {type Base CSyntheticCDO' = CInstrument'; upcast :: Ptr CSyntheticCDO' -> IO (Ptr (Base CSyntheticCDO'))
upcast = Ptr CSyntheticCDO' -> IO (Ptr CInstrument')
Ptr CSyntheticCDO' -> IO (Ptr (Base CSyntheticCDO'))
qlSyntheticCDOAsInstrument}
peekSyntheticCDO :: Ptr CSyntheticCDO' -> IO SyntheticCDO
peekSyntheticCDO :: Ptr CSyntheticCDO' -> IO SyntheticCDO
peekSyntheticCDO = GenForeignPtr CSyntheticCDO CInstrument' -> SyntheticCDO
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr CSyntheticCDO CInstrument' -> SyntheticCDO)
-> (Ptr CSyntheticCDO'
    -> IO (GenForeignPtr CSyntheticCDO CInstrument'))
-> Ptr CSyntheticCDO'
-> IO SyntheticCDO
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CSyntheticCDO' -> IO (GenForeignPtr CSyntheticCDO CInstrument')
Ptr CSyntheticCDO'
-> IO (GenForeignPtr CSyntheticCDO (Base CSyntheticCDO'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr

data CNthToDefault'
type CNthToDefault = ForeignPtr CNthToDefault'
-- |An 'Instrument'; see the hierarchy under t'GenInstrument'.
type NthToDefault = GenInstrument CNthToDefault
foreign import ccall unsafe "ql.h &qlFreeNthToDefault" qlFreeNthToDefault :: FinalizerPtr CNthToDefault'
instance Finalizable CNthToDefault' where finalize :: FinalizerPtr CNthToDefault'
finalize = FinalizerPtr CNthToDefault'
qlFreeNthToDefault
foreign import ccall "ql.h qlNthToDefaultAsInstrument" qlNthToDefaultAsInstrument :: Ptr CNthToDefault' -> IO (Ptr CInstrument')
instance Upcastable CNthToDefault' where {type Base CNthToDefault' = CInstrument'; upcast :: Ptr CNthToDefault' -> IO (Ptr (Base CNthToDefault'))
upcast = Ptr CNthToDefault' -> IO (Ptr CInstrument')
Ptr CNthToDefault' -> IO (Ptr (Base CNthToDefault'))
qlNthToDefaultAsInstrument}
peekNthToDefault :: Ptr CNthToDefault' -> IO NthToDefault
peekNthToDefault :: Ptr CNthToDefault' -> IO NthToDefault
peekNthToDefault = GenForeignPtr CNthToDefault CInstrument' -> NthToDefault
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr CNthToDefault CInstrument' -> NthToDefault)
-> (Ptr CNthToDefault'
    -> IO (GenForeignPtr CNthToDefault CInstrument'))
-> Ptr CNthToDefault'
-> IO NthToDefault
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CNthToDefault' -> IO (GenForeignPtr CNthToDefault CInstrument')
Ptr CNthToDefault'
-> IO (GenForeignPtr CNthToDefault (Base CNthToDefault'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr

data CVarianceSwap'
type CVarianceSwap = ForeignPtr CVarianceSwap'
-- |An 'Instrument'; see the hierarchy under t'GenInstrument'.
type VarianceSwap = GenInstrument CVarianceSwap
foreign import ccall unsafe "ql.h &qlFreeVarianceSwap" qlFreeVarianceSwap :: FinalizerPtr CVarianceSwap'
instance Finalizable CVarianceSwap' where finalize :: FinalizerPtr CVarianceSwap'
finalize = FinalizerPtr CVarianceSwap'
qlFreeVarianceSwap
foreign import ccall "ql.h qlVarianceSwapAsInstrument" qlVarianceSwapAsInstrument :: Ptr CVarianceSwap' -> IO (Ptr CInstrument')
instance Upcastable CVarianceSwap' where {type Base CVarianceSwap' = CInstrument'; upcast :: Ptr CVarianceSwap' -> IO (Ptr (Base CVarianceSwap'))
upcast = Ptr CVarianceSwap' -> IO (Ptr CInstrument')
Ptr CVarianceSwap' -> IO (Ptr (Base CVarianceSwap'))
qlVarianceSwapAsInstrument}
peekVarianceSwap :: Ptr CVarianceSwap' -> IO VarianceSwap
peekVarianceSwap :: Ptr CVarianceSwap' -> IO VarianceSwap
peekVarianceSwap = GenForeignPtr CVarianceSwap CInstrument' -> VarianceSwap
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr CVarianceSwap CInstrument' -> VarianceSwap)
-> (Ptr CVarianceSwap'
    -> IO (GenForeignPtr CVarianceSwap CInstrument'))
-> Ptr CVarianceSwap'
-> IO VarianceSwap
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CVarianceSwap' -> IO (GenForeignPtr CVarianceSwap CInstrument')
Ptr CVarianceSwap'
-> IO (GenForeignPtr CVarianceSwap (Base CVarianceSwap'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr

data CVarianceOption'
type CVarianceOption = ForeignPtr CVarianceOption'
-- |An 'Instrument'; see the hierarchy under t'GenInstrument'.
type VarianceOption = GenInstrument CVarianceOption
foreign import ccall unsafe "ql.h &qlFreeVarianceOption" qlFreeVarianceOption :: FinalizerPtr CVarianceOption'
instance Finalizable CVarianceOption' where finalize :: FinalizerPtr CVarianceOption'
finalize = FinalizerPtr CVarianceOption'
qlFreeVarianceOption
foreign import ccall "ql.h qlVarianceOptionAsInstrument" qlVarianceOptionAsInstrument :: Ptr CVarianceOption' -> IO (Ptr CInstrument')
instance Upcastable CVarianceOption' where {type Base CVarianceOption' = CInstrument'; upcast :: Ptr CVarianceOption' -> IO (Ptr (Base CVarianceOption'))
upcast = Ptr CVarianceOption' -> IO (Ptr CInstrument')
Ptr CVarianceOption' -> IO (Ptr (Base CVarianceOption'))
qlVarianceOptionAsInstrument}
peekVarianceOption :: Ptr CVarianceOption' -> IO VarianceOption
peekVarianceOption :: Ptr CVarianceOption' -> IO VarianceOption
peekVarianceOption = GenForeignPtr CVarianceOption CInstrument' -> VarianceOption
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr CVarianceOption CInstrument' -> VarianceOption)
-> (Ptr CVarianceOption'
    -> IO (GenForeignPtr CVarianceOption CInstrument'))
-> Ptr CVarianceOption'
-> IO VarianceOption
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CVarianceOption'
-> IO (GenForeignPtr CVarianceOption CInstrument')
Ptr CVarianceOption'
-> IO (GenForeignPtr CVarianceOption (Base CVarianceOption'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr

data CCapFloor'
type CCapFloor = ForeignPtr CCapFloor'
-- |An 'Instrument'; see the hierarchy under t'GenInstrument'.
type CapFloor = GenInstrument CCapFloor
foreign import ccall unsafe "ql.h &qlFreeCapFloor" qlFreeCapFloor :: FinalizerPtr CCapFloor'
instance Finalizable CCapFloor' where finalize :: FinalizerPtr CCapFloor'
finalize = FinalizerPtr CCapFloor'
qlFreeCapFloor
foreign import ccall "ql.h qlCapFloorAsInstrument" qlCapFloorAsInstrument :: Ptr CCapFloor' -> IO (Ptr CInstrument')
instance Upcastable CCapFloor' where {type Base CCapFloor' = CInstrument'; upcast :: Ptr CCapFloor' -> IO (Ptr (Base CCapFloor'))
upcast = Ptr CCapFloor' -> IO (Ptr CInstrument')
Ptr CCapFloor' -> IO (Ptr (Base CCapFloor'))
qlCapFloorAsInstrument}
peekCapFloor :: Ptr CCapFloor' -> IO CapFloor
peekCapFloor :: Ptr CCapFloor' -> IO CapFloor
peekCapFloor = GenForeignPtr CCapFloor CInstrument' -> CapFloor
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr CCapFloor CInstrument' -> CapFloor)
-> (Ptr CCapFloor' -> IO (GenForeignPtr CCapFloor CInstrument'))
-> Ptr CCapFloor'
-> IO CapFloor
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCapFloor' -> IO (GenForeignPtr CCapFloor CInstrument')
Ptr CCapFloor' -> IO (GenForeignPtr CCapFloor (Base CCapFloor'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr

data CYoYInflationCapFloor'
type CYoYInflationCapFloor = ForeignPtr CYoYInflationCapFloor'
-- | A YoY-inflation cap\/floor\/collar (all three are thin ctor-only subclasses upstream with
-- no logic of their own, so 'QuantLib.Instrument.InflationCapFloor.yoyInflationCap'\/
-- 'yoyInflationCollar'\/'yoyInflationFloor' each construct this one flat leaf directly, mirroring
-- how 'CapFloor' collapses @Cap@\/@Collar@\/@Floor@). Unlike 'CapFloor', it shares no C++ base
-- below 'Instrument' with the nominal cap/floor, so it's a separate sibling leaf, not a subtype.
-- See the hierarchy under t'GenInstrument'.
type YoYInflationCapFloor = GenInstrument CYoYInflationCapFloor
foreign import ccall unsafe "ql.h &qlFreeYoYInflationCapFloor" qlFreeYoYInflationCapFloor :: FinalizerPtr CYoYInflationCapFloor'
instance Finalizable CYoYInflationCapFloor' where finalize :: FinalizerPtr CYoYInflationCapFloor'
finalize = FinalizerPtr CYoYInflationCapFloor'
qlFreeYoYInflationCapFloor
foreign import ccall "ql.h qlYoYInflationCapFloorAsInstrument" qlYoYInflationCapFloorAsInstrument :: Ptr CYoYInflationCapFloor' -> IO (Ptr CInstrument')
instance Upcastable CYoYInflationCapFloor' where {type Base CYoYInflationCapFloor' = CInstrument'; upcast :: Ptr CYoYInflationCapFloor'
-> IO (Ptr (Base CYoYInflationCapFloor'))
upcast = Ptr CYoYInflationCapFloor' -> IO (Ptr CInstrument')
Ptr CYoYInflationCapFloor'
-> IO (Ptr (Base CYoYInflationCapFloor'))
qlYoYInflationCapFloorAsInstrument}
peekYoYInflationCapFloor :: Ptr CYoYInflationCapFloor' -> IO YoYInflationCapFloor
peekYoYInflationCapFloor :: Ptr CYoYInflationCapFloor' -> IO YoYInflationCapFloor
peekYoYInflationCapFloor = GenForeignPtr CYoYInflationCapFloor CInstrument'
-> YoYInflationCapFloor
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr CYoYInflationCapFloor CInstrument'
 -> YoYInflationCapFloor)
-> (Ptr CYoYInflationCapFloor'
    -> IO (GenForeignPtr CYoYInflationCapFloor CInstrument'))
-> Ptr CYoYInflationCapFloor'
-> IO YoYInflationCapFloor
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CYoYInflationCapFloor'
-> IO (GenForeignPtr CYoYInflationCapFloor CInstrument')
Ptr CYoYInflationCapFloor'
-> IO
     (GenForeignPtr CYoYInflationCapFloor (Base CYoYInflationCapFloor'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr

data CCPICapFloor'
type CCPICapFloor = ForeignPtr CCPICapFloor'
-- | A CPI cap\/floor: unlike 'YoYInflationCapFloor', a single cumulative option (observes
-- cumulative inflation up to maturity, like a ZCIIS option) rather than a strip of optionlets --
-- flat sibling leaf under 'Instrument', sharing no C++ base with either 'CapFloor' or
-- 'YoYInflationCapFloor'.
-- See the hierarchy under t'GenInstrument'.
type CPICapFloor = GenInstrument CCPICapFloor
foreign import ccall unsafe "ql.h &qlFreeCPICapFloor" qlFreeCPICapFloor :: FinalizerPtr CCPICapFloor'
instance Finalizable CCPICapFloor' where finalize :: FinalizerPtr CCPICapFloor'
finalize = FinalizerPtr CCPICapFloor'
qlFreeCPICapFloor
foreign import ccall "ql.h qlCPICapFloorAsInstrument" qlCPICapFloorAsInstrument :: Ptr CCPICapFloor' -> IO (Ptr CInstrument')
instance Upcastable CCPICapFloor' where {type Base CCPICapFloor' = CInstrument'; upcast :: Ptr CCPICapFloor' -> IO (Ptr (Base CCPICapFloor'))
upcast = Ptr CCPICapFloor' -> IO (Ptr CInstrument')
Ptr CCPICapFloor' -> IO (Ptr (Base CCPICapFloor'))
qlCPICapFloorAsInstrument}
peekCPICapFloor :: Ptr CCPICapFloor' -> IO CPICapFloor
peekCPICapFloor :: Ptr CCPICapFloor' -> IO CPICapFloor
peekCPICapFloor = GenForeignPtr CCPICapFloor CInstrument' -> CPICapFloor
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr CCPICapFloor CInstrument' -> CPICapFloor)
-> (Ptr CCPICapFloor'
    -> IO (GenForeignPtr CCPICapFloor CInstrument'))
-> Ptr CCPICapFloor'
-> IO CPICapFloor
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCPICapFloor' -> IO (GenForeignPtr CCPICapFloor CInstrument')
Ptr CCPICapFloor'
-> IO (GenForeignPtr CCPICapFloor (Base CCPICapFloor'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr

data CForward'
type GenForward f = GenInstrument (AnyOf CForward' f)
type CForward = ForeignPtr CForward'
-- |An 'Instrument'; see the hierarchy under t'GenInstrument'.
type Forward = GenForward CForward
foreign import ccall unsafe "ql.h &qlFreeForward" qlFreeForward :: FinalizerPtr CForward'
instance Finalizable CForward' where finalize :: FinalizerPtr CForward'
finalize = FinalizerPtr CForward'
qlFreeForward
foreign import ccall "ql.h qlForwardAsInstrument" qlForwardAsInstrument :: Ptr CForward' -> IO (Ptr CInstrument')
instance Upcastable CForward' where {type Base CForward' = CInstrument'; upcast :: Ptr CForward' -> IO (Ptr (Base CForward'))
upcast = Ptr CForward' -> IO (Ptr CInstrument')
Ptr CForward' -> IO (Ptr (Base CForward'))
qlForwardAsInstrument}
asForward :: GenForward f -> IO Forward
asForward :: forall f. GenForward f -> IO Forward
asForward = (Ptr CForward' -> IO Forward)
-> GenForeignPtr f CForward' -> IO Forward
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CForward' -> IO Forward
peekForward (GenForeignPtr f CForward' -> IO Forward)
-> (GenForward f -> GenForeignPtr f CForward')
-> GenForward f
-> IO Forward
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CForward' f) CInstrument'
-> GenForeignPtr f CForward'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CForward' f) CInstrument'
 -> GenForeignPtr f CForward')
-> (GenForward f -> GenForeignPtr (AnyOf CForward' f) CInstrument')
-> GenForward f
-> GenForeignPtr f CForward'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForward f -> GenForeignPtr (AnyOf CForward' f) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
peekForward :: Ptr CForward' -> IO Forward
peekForward :: Ptr CForward' -> IO Forward
peekForward = Ptr CForward'
-> IO (GenForeignPtr (ForeignPtr CForward') CForward')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CForward'
 -> IO (GenForeignPtr (ForeignPtr CForward') CForward'))
-> (GenForeignPtr (ForeignPtr CForward') CForward' -> IO Forward)
-> Ptr CForward'
-> IO Forward
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CForward') CForward' -> IO Forward
forall f. GenForeignPtr f CForward' -> IO (GenForward f)
newGenForward
withForward :: GenForward f -> (Ptr CForward' -> IO b) -> IO b
withForward :: forall f b. GenForward f -> (Ptr CForward' -> IO b) -> IO b
withForward = GenForeignPtr f CForward' -> (Ptr CForward' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr f CForward' -> (Ptr CForward' -> IO b) -> IO b)
-> (GenForward f -> GenForeignPtr f CForward')
-> GenForward f
-> (Ptr CForward' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CForward' f) CInstrument'
-> GenForeignPtr f CForward'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CForward' f) CInstrument'
 -> GenForeignPtr f CForward')
-> (GenForward f -> GenForeignPtr (AnyOf CForward' f) CInstrument')
-> GenForward f
-> GenForeignPtr f CForward'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForward f -> GenForeignPtr (AnyOf CForward' f) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
newGenForward :: GenForeignPtr f CForward' -> IO (GenForward f)
newGenForward :: forall f. GenForeignPtr f CForward' -> IO (GenForward f)
newGenForward = GenForward f -> IO (GenForward f)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenForward f -> IO (GenForward f))
-> (GenForeignPtr f CForward' -> GenForward f)
-> GenForeignPtr f CForward'
-> IO (GenForward f)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CForward' f) CInstrument' -> GenForward f
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr (AnyOf CForward' f) CInstrument' -> GenForward f)
-> (GenForeignPtr f CForward'
    -> GenForeignPtr (AnyOf CForward' f) CInstrument')
-> GenForeignPtr f CForward'
-> GenForward f
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr f CForward'
-> GenForeignPtr (AnyOf CForward' f) CInstrument'
GenForeignPtr f CForward'
-> GenForeignPtr (AnyOf CForward' f) (Base CForward')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekGenForward :: (Finalizable f, Upcastable f, Base f ~ CForward') => Ptr f -> IO (GenForward (ForeignPtr f))
peekGenForward :: forall f.
(Finalizable f, Upcastable f, Base f ~ CForward') =>
Ptr f -> IO (GenForward (ForeignPtr f))
peekGenForward = Ptr f -> IO (GenForeignPtr (ForeignPtr f) CForward')
Ptr f -> IO (GenForeignPtr (ForeignPtr f) (Base f))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr f -> IO (GenForeignPtr (ForeignPtr f) CForward'))
-> (GenForeignPtr (ForeignPtr f) CForward'
    -> IO (GenForward (ForeignPtr f)))
-> Ptr f
-> IO (GenForward (ForeignPtr f))
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr f) CForward'
-> IO (GenForward (ForeignPtr f))
forall f. GenForeignPtr f CForward' -> IO (GenForward f)
newGenForward
withGenForward :: GenForward (ForeignPtr f) -> (Ptr f -> IO b) -> IO b
withGenForward :: forall f b. GenForward (ForeignPtr f) -> (Ptr f -> IO b) -> IO b
withGenForward = ForeignPtr f -> (Ptr f -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr f -> (Ptr f -> IO b) -> IO b)
-> (GenForward (ForeignPtr f) -> ForeignPtr f)
-> GenForward (ForeignPtr f)
-> (Ptr f -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr f) CForward' -> ForeignPtr f
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr f) CForward' -> ForeignPtr f)
-> (GenForward (ForeignPtr f)
    -> GenForeignPtr (ForeignPtr f) CForward')
-> GenForward (ForeignPtr f)
-> ForeignPtr f
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CForward' (ForeignPtr f)) CInstrument'
-> GenForeignPtr (ForeignPtr f) CForward'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CForward' (ForeignPtr f)) CInstrument'
 -> GenForeignPtr (ForeignPtr f) CForward')
-> (GenForward (ForeignPtr f)
    -> GenForeignPtr (AnyOf CForward' (ForeignPtr f)) CInstrument')
-> GenForward (ForeignPtr f)
-> GenForeignPtr (ForeignPtr f) CForward'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForward (ForeignPtr f)
-> GenForeignPtr (AnyOf CForward' (ForeignPtr f)) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data COption'
type GenOption o = GenInstrument (AnyOf COption' o)
type COption = ForeignPtr COption'
-- |An 'Instrument'; see the hierarchy under t'GenInstrument'.
type Option = GenOption COption
foreign import ccall unsafe "ql.h &qlFreeOption" qlFreeOption :: FinalizerPtr COption'
instance Finalizable COption' where finalize :: FinalizerPtr COption'
finalize = FinalizerPtr COption'
qlFreeOption
foreign import ccall "ql.h qlOptionAsInstrument" qlOptionAsInstrument :: Ptr COption' -> IO (Ptr CInstrument')
instance Upcastable COption' where {type Base COption' = CInstrument'; upcast :: Ptr COption' -> IO (Ptr (Base COption'))
upcast = Ptr COption' -> IO (Ptr CInstrument')
Ptr COption' -> IO (Ptr (Base COption'))
qlOptionAsInstrument}
asOption :: GenOption o -> IO Option
asOption :: forall o. GenOption o -> IO Option
asOption = (Ptr COption' -> IO Option)
-> GenForeignPtr o COption' -> IO Option
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr COption' -> IO Option
peekOption (GenForeignPtr o COption' -> IO Option)
-> (GenOption o -> GenForeignPtr o COption')
-> GenOption o
-> IO Option
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf COption' o) CInstrument'
-> GenForeignPtr o COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf COption' o) CInstrument'
 -> GenForeignPtr o COption')
-> (GenOption o -> GenForeignPtr (AnyOf COption' o) CInstrument')
-> GenOption o
-> GenForeignPtr o COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenOption o -> GenForeignPtr (AnyOf COption' o) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
peekOption :: Ptr COption' -> IO Option
peekOption :: Ptr COption' -> IO Option
peekOption = Ptr COption' -> IO (GenForeignPtr (ForeignPtr COption') COption')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr COption' -> IO (GenForeignPtr (ForeignPtr COption') COption'))
-> (GenForeignPtr (ForeignPtr COption') COption' -> IO Option)
-> Ptr COption'
-> IO Option
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr COption') COption' -> IO Option
forall o. GenForeignPtr o COption' -> IO (GenOption o)
newGenOption
withOption :: GenOption o -> (Ptr COption' -> IO b) -> IO b
withOption :: forall o b. GenOption o -> (Ptr COption' -> IO b) -> IO b
withOption = GenForeignPtr o COption' -> (Ptr COption' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr o COption' -> (Ptr COption' -> IO b) -> IO b)
-> (GenOption o -> GenForeignPtr o COption')
-> GenOption o
-> (Ptr COption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf COption' o) CInstrument'
-> GenForeignPtr o COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf COption' o) CInstrument'
 -> GenForeignPtr o COption')
-> (GenOption o -> GenForeignPtr (AnyOf COption' o) CInstrument')
-> GenOption o
-> GenForeignPtr o COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenOption o -> GenForeignPtr (AnyOf COption' o) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
newGenOption :: GenForeignPtr o COption' -> IO (GenOption o)
newGenOption :: forall o. GenForeignPtr o COption' -> IO (GenOption o)
newGenOption = GenOption o -> IO (GenOption o)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenOption o -> IO (GenOption o))
-> (GenForeignPtr o COption' -> GenOption o)
-> GenForeignPtr o COption'
-> IO (GenOption o)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf COption' o) CInstrument' -> GenOption o
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr (AnyOf COption' o) CInstrument' -> GenOption o)
-> (GenForeignPtr o COption'
    -> GenForeignPtr (AnyOf COption' o) CInstrument')
-> GenForeignPtr o COption'
-> GenOption o
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr o COption'
-> GenForeignPtr (AnyOf COption' o) CInstrument'
GenForeignPtr o COption'
-> GenForeignPtr (AnyOf COption' o) (Base COption')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekGenOption :: (Finalizable o, Upcastable o, Base o ~ COption') => Ptr o -> IO (GenOption (ForeignPtr o))
peekGenOption :: forall o.
(Finalizable o, Upcastable o, Base o ~ COption') =>
Ptr o -> IO (GenOption (ForeignPtr o))
peekGenOption = Ptr o -> IO (GenForeignPtr (ForeignPtr o) COption')
Ptr o -> IO (GenForeignPtr (ForeignPtr o) (Base o))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr o -> IO (GenForeignPtr (ForeignPtr o) COption'))
-> (GenForeignPtr (ForeignPtr o) COption'
    -> IO (GenOption (ForeignPtr o)))
-> Ptr o
-> IO (GenOption (ForeignPtr o))
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr o) COption'
-> IO (GenOption (ForeignPtr o))
forall o. GenForeignPtr o COption' -> IO (GenOption o)
newGenOption
withGenOption :: GenOption (ForeignPtr o) -> (Ptr o -> IO b) -> IO b
withGenOption :: forall o b. GenOption (ForeignPtr o) -> (Ptr o -> IO b) -> IO b
withGenOption = ForeignPtr o -> (Ptr o -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr o -> (Ptr o -> IO b) -> IO b)
-> (GenOption (ForeignPtr o) -> ForeignPtr o)
-> GenOption (ForeignPtr o)
-> (Ptr o -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr o) COption' -> ForeignPtr o
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr o) COption' -> ForeignPtr o)
-> (GenOption (ForeignPtr o)
    -> GenForeignPtr (ForeignPtr o) COption')
-> GenOption (ForeignPtr o)
-> ForeignPtr o
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf COption' (ForeignPtr o)) CInstrument'
-> GenForeignPtr (ForeignPtr o) COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf COption' (ForeignPtr o)) CInstrument'
 -> GenForeignPtr (ForeignPtr o) COption')
-> (GenOption (ForeignPtr o)
    -> GenForeignPtr (AnyOf COption' (ForeignPtr o)) CInstrument')
-> GenOption (ForeignPtr o)
-> GenForeignPtr (ForeignPtr o) COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenOption (ForeignPtr o)
-> GenForeignPtr (AnyOf COption' (ForeignPtr o)) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CSwap'
type GenSwap s = GenInstrument (AnyOf CSwap' s)
type CSwap = ForeignPtr CSwap'
-- |An 'Instrument'; see the hierarchy under t'GenInstrument'.
type Swap = GenSwap CSwap
foreign import ccall unsafe "ql.h &qlFreeSwap" qlFreeSwap :: FinalizerPtr CSwap'
instance Finalizable CSwap' where finalize :: FinalizerPtr CSwap'
finalize = FinalizerPtr CSwap'
qlFreeSwap
foreign import ccall "ql.h qlSwapAsInstrument" qlSwapAsInstrument :: Ptr CSwap' -> IO (Ptr CInstrument')
instance Upcastable CSwap' where {type Base CSwap' = CInstrument'; upcast :: Ptr CSwap' -> IO (Ptr (Base CSwap'))
upcast = Ptr CSwap' -> IO (Ptr CInstrument')
Ptr CSwap' -> IO (Ptr (Base CSwap'))
qlSwapAsInstrument}
asSwap :: GenSwap s -> IO Swap
asSwap :: forall s. GenSwap s -> IO Swap
asSwap = (Ptr CSwap' -> IO Swap) -> GenForeignPtr s CSwap' -> IO Swap
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CSwap' -> IO Swap
peekSwap (GenForeignPtr s CSwap' -> IO Swap)
-> (GenSwap s -> GenForeignPtr s CSwap') -> GenSwap s -> IO Swap
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CSwap' s) CInstrument'
-> GenForeignPtr s CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CSwap' s) CInstrument'
 -> GenForeignPtr s CSwap')
-> (GenSwap s -> GenForeignPtr (AnyOf CSwap' s) CInstrument')
-> GenSwap s
-> GenForeignPtr s CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenSwap s -> GenForeignPtr (AnyOf CSwap' s) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
peekSwap :: Ptr CSwap' -> IO Swap
peekSwap :: Ptr CSwap' -> IO Swap
peekSwap = Ptr CSwap' -> IO (GenForeignPtr (ForeignPtr CSwap') CSwap')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CSwap' -> IO (GenForeignPtr (ForeignPtr CSwap') CSwap'))
-> (GenForeignPtr (ForeignPtr CSwap') CSwap' -> IO Swap)
-> Ptr CSwap'
-> IO Swap
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CSwap') CSwap' -> IO Swap
forall s. GenForeignPtr s CSwap' -> IO (GenSwap s)
newGenSwap
withSwap :: GenSwap s -> (Ptr CSwap' -> IO b) -> IO b
withSwap :: forall s b. GenSwap s -> (Ptr CSwap' -> IO b) -> IO b
withSwap = GenForeignPtr s CSwap' -> (Ptr CSwap' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr s CSwap' -> (Ptr CSwap' -> IO b) -> IO b)
-> (GenSwap s -> GenForeignPtr s CSwap')
-> GenSwap s
-> (Ptr CSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CSwap' s) CInstrument'
-> GenForeignPtr s CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CSwap' s) CInstrument'
 -> GenForeignPtr s CSwap')
-> (GenSwap s -> GenForeignPtr (AnyOf CSwap' s) CInstrument')
-> GenSwap s
-> GenForeignPtr s CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenSwap s -> GenForeignPtr (AnyOf CSwap' s) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
newGenSwap :: GenForeignPtr s CSwap' -> IO (GenSwap s)
newGenSwap :: forall s. GenForeignPtr s CSwap' -> IO (GenSwap s)
newGenSwap = GenSwap s -> IO (GenSwap s)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenSwap s -> IO (GenSwap s))
-> (GenForeignPtr s CSwap' -> GenSwap s)
-> GenForeignPtr s CSwap'
-> IO (GenSwap s)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CSwap' s) CInstrument' -> GenSwap s
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr (AnyOf CSwap' s) CInstrument' -> GenSwap s)
-> (GenForeignPtr s CSwap'
    -> GenForeignPtr (AnyOf CSwap' s) CInstrument')
-> GenForeignPtr s CSwap'
-> GenSwap s
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr s CSwap'
-> GenForeignPtr (AnyOf CSwap' s) CInstrument'
GenForeignPtr s CSwap'
-> GenForeignPtr (AnyOf CSwap' s) (Base CSwap')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekGenSwap :: (Finalizable s, Upcastable s, Base s ~ CSwap') => Ptr s -> IO (GenSwap (ForeignPtr s))
peekGenSwap :: forall s.
(Finalizable s, Upcastable s, Base s ~ CSwap') =>
Ptr s -> IO (GenSwap (ForeignPtr s))
peekGenSwap = Ptr s -> IO (GenForeignPtr (ForeignPtr s) CSwap')
Ptr s -> IO (GenForeignPtr (ForeignPtr s) (Base s))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr s -> IO (GenForeignPtr (ForeignPtr s) CSwap'))
-> (GenForeignPtr (ForeignPtr s) CSwap'
    -> IO (GenSwap (ForeignPtr s)))
-> Ptr s
-> IO (GenSwap (ForeignPtr s))
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr s) CSwap' -> IO (GenSwap (ForeignPtr s))
forall s. GenForeignPtr s CSwap' -> IO (GenSwap s)
newGenSwap
withGenSwap :: GenSwap (ForeignPtr s) -> (Ptr s -> IO b) -> IO b
withGenSwap :: forall s b. GenSwap (ForeignPtr s) -> (Ptr s -> IO b) -> IO b
withGenSwap = ForeignPtr s -> (Ptr s -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr s -> (Ptr s -> IO b) -> IO b)
-> (GenSwap (ForeignPtr s) -> ForeignPtr s)
-> GenSwap (ForeignPtr s)
-> (Ptr s -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr s) CSwap' -> ForeignPtr s
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr s) CSwap' -> ForeignPtr s)
-> (GenSwap (ForeignPtr s) -> GenForeignPtr (ForeignPtr s) CSwap')
-> GenSwap (ForeignPtr s)
-> ForeignPtr s
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CSwap' (ForeignPtr s)) CInstrument'
-> GenForeignPtr (ForeignPtr s) CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CSwap' (ForeignPtr s)) CInstrument'
 -> GenForeignPtr (ForeignPtr s) CSwap')
-> (GenSwap (ForeignPtr s)
    -> GenForeignPtr (AnyOf CSwap' (ForeignPtr s)) CInstrument')
-> GenSwap (ForeignPtr s)
-> GenForeignPtr (ForeignPtr s) CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenSwap (ForeignPtr s)
-> GenForeignPtr (AnyOf CSwap' (ForeignPtr s)) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CIrregularSwap'
type CIrregularSwap = ForeignPtr CIrregularSwap'
-- |A 'Swap'; see the hierarchy under t'GenInstrument'.
type IrregularSwap = GenSwap CIrregularSwap
foreign import ccall unsafe "ql.h &qlFreeIrregularSwap" qlFreeIrregularSwap :: FinalizerPtr CIrregularSwap'
instance Finalizable CIrregularSwap' where finalize :: FinalizerPtr CIrregularSwap'
finalize = FinalizerPtr CIrregularSwap'
qlFreeIrregularSwap
foreign import ccall "ql.h qlIrregularSwapAsSwap" qlIrregularSwapAsSwap :: Ptr CIrregularSwap' -> IO (Ptr CSwap')
instance Upcastable CIrregularSwap' where {type Base CIrregularSwap' = CSwap'; upcast :: Ptr CIrregularSwap' -> IO (Ptr (Base CIrregularSwap'))
upcast = Ptr CIrregularSwap' -> IO (Ptr CSwap')
Ptr CIrregularSwap' -> IO (Ptr (Base CIrregularSwap'))
qlIrregularSwapAsSwap}
peekIrregularSwap :: Ptr CIrregularSwap' -> IO IrregularSwap
peekIrregularSwap :: Ptr CIrregularSwap' -> IO IrregularSwap
peekIrregularSwap = Ptr CIrregularSwap' -> IO IrregularSwap
forall s.
(Finalizable s, Upcastable s, Base s ~ CSwap') =>
Ptr s -> IO (GenSwap (ForeignPtr s))
peekGenSwap
withIrregularSwap :: IrregularSwap -> (Ptr CIrregularSwap' -> IO b) -> IO b
withIrregularSwap :: forall b. IrregularSwap -> (Ptr CIrregularSwap' -> IO b) -> IO b
withIrregularSwap = ForeignPtr CIrregularSwap' -> (Ptr CIrregularSwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CIrregularSwap'
 -> (Ptr CIrregularSwap' -> IO b) -> IO b)
-> (IrregularSwap -> ForeignPtr CIrregularSwap')
-> IrregularSwap
-> (Ptr CIrregularSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CIrregularSwap') CSwap'
-> ForeignPtr CIrregularSwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CIrregularSwap') CSwap'
 -> ForeignPtr CIrregularSwap')
-> (IrregularSwap
    -> GenForeignPtr (ForeignPtr CIrregularSwap') CSwap')
-> IrregularSwap
-> ForeignPtr CIrregularSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwap' (ForeignPtr CIrregularSwap')) CInstrument'
-> GenForeignPtr (ForeignPtr CIrregularSwap') CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CSwap' (ForeignPtr CIrregularSwap')) CInstrument'
 -> GenForeignPtr (ForeignPtr CIrregularSwap') CSwap')
-> (IrregularSwap
    -> GenForeignPtr
         (AnyOf CSwap' (ForeignPtr CIrregularSwap')) CInstrument')
-> IrregularSwap
-> GenForeignPtr (ForeignPtr CIrregularSwap') CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IrregularSwap
-> GenForeignPtr
     (AnyOf CSwap' (ForeignPtr CIrregularSwap')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CBond'
type GenBond b = GenInstrument (AnyOf CBond' b)
type CBond = ForeignPtr CBond'
-- |An 'Instrument'; see the hierarchy under t'GenInstrument'.
type Bond = GenBond CBond
foreign import ccall unsafe "ql.h &qlFreeBond" qlFreeBond :: FinalizerPtr CBond'
instance Finalizable CBond' where finalize :: FinalizerPtr CBond'
finalize = FinalizerPtr CBond'
qlFreeBond
foreign import ccall "ql.h qlBondAsInstrument" qlBondAsInstrument :: Ptr CBond' -> IO (Ptr CInstrument')
instance Upcastable CBond' where {type Base CBond' = CInstrument'; upcast :: Ptr CBond' -> IO (Ptr (Base CBond'))
upcast = Ptr CBond' -> IO (Ptr CInstrument')
Ptr CBond' -> IO (Ptr (Base CBond'))
qlBondAsInstrument}
asBond :: GenBond b -> IO Bond
asBond :: forall b. GenBond b -> IO Bond
asBond = (Ptr CBond' -> IO Bond) -> GenForeignPtr b CBond' -> IO Bond
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CBond' -> IO Bond
peekBond (GenForeignPtr b CBond' -> IO Bond)
-> (GenBond b -> GenForeignPtr b CBond') -> GenBond b -> IO Bond
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CBond' b) CInstrument'
-> GenForeignPtr b CBond'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CBond' b) CInstrument'
 -> GenForeignPtr b CBond')
-> (GenBond b -> GenForeignPtr (AnyOf CBond' b) CInstrument')
-> GenBond b
-> GenForeignPtr b CBond'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBond b -> GenForeignPtr (AnyOf CBond' b) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
peekBond :: Ptr CBond' -> IO Bond
peekBond :: Ptr CBond' -> IO Bond
peekBond = Ptr CBond' -> IO (GenForeignPtr (ForeignPtr CBond') CBond')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CBond' -> IO (GenForeignPtr (ForeignPtr CBond') CBond'))
-> (GenForeignPtr (ForeignPtr CBond') CBond' -> IO Bond)
-> Ptr CBond'
-> IO Bond
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CBond') CBond' -> IO Bond
forall b. GenForeignPtr b CBond' -> IO (GenBond b)
newGenBond
withBond :: GenBond b -> (Ptr CBond' -> IO r) -> IO r
withBond :: forall b r. GenBond b -> (Ptr CBond' -> IO r) -> IO r
withBond = GenForeignPtr b CBond' -> (Ptr CBond' -> IO r) -> IO r
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr b CBond' -> (Ptr CBond' -> IO r) -> IO r)
-> (GenBond b -> GenForeignPtr b CBond')
-> GenBond b
-> (Ptr CBond' -> IO r)
-> IO r
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CBond' b) CInstrument'
-> GenForeignPtr b CBond'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CBond' b) CInstrument'
 -> GenForeignPtr b CBond')
-> (GenBond b -> GenForeignPtr (AnyOf CBond' b) CInstrument')
-> GenBond b
-> GenForeignPtr b CBond'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBond b -> GenForeignPtr (AnyOf CBond' b) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
newGenBond :: GenForeignPtr b CBond' -> IO (GenBond b)
newGenBond :: forall b. GenForeignPtr b CBond' -> IO (GenBond b)
newGenBond = GenBond b -> IO (GenBond b)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenBond b -> IO (GenBond b))
-> (GenForeignPtr b CBond' -> GenBond b)
-> GenForeignPtr b CBond'
-> IO (GenBond b)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CBond' b) CInstrument' -> GenBond b
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr (AnyOf CBond' b) CInstrument' -> GenBond b)
-> (GenForeignPtr b CBond'
    -> GenForeignPtr (AnyOf CBond' b) CInstrument')
-> GenForeignPtr b CBond'
-> GenBond b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr b CBond'
-> GenForeignPtr (AnyOf CBond' b) CInstrument'
GenForeignPtr b CBond'
-> GenForeignPtr (AnyOf CBond' b) (Base CBond')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekGenBond :: (Finalizable b, Upcastable b, Base b ~ CBond') => Ptr b -> IO (GenBond (ForeignPtr b))
peekGenBond :: forall b.
(Finalizable b, Upcastable b, Base b ~ CBond') =>
Ptr b -> IO (GenBond (ForeignPtr b))
peekGenBond = Ptr b -> IO (GenForeignPtr (ForeignPtr b) CBond')
Ptr b -> IO (GenForeignPtr (ForeignPtr b) (Base b))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr b -> IO (GenForeignPtr (ForeignPtr b) CBond'))
-> (GenForeignPtr (ForeignPtr b) CBond'
    -> IO (GenBond (ForeignPtr b)))
-> Ptr b
-> IO (GenBond (ForeignPtr b))
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr b) CBond' -> IO (GenBond (ForeignPtr b))
forall b. GenForeignPtr b CBond' -> IO (GenBond b)
newGenBond
withGenBond :: GenBond (ForeignPtr b) -> (Ptr b -> IO r) -> IO r
withGenBond :: forall b r. GenBond (ForeignPtr b) -> (Ptr b -> IO r) -> IO r
withGenBond = ForeignPtr b -> (Ptr b -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr b -> (Ptr b -> IO r) -> IO r)
-> (GenBond (ForeignPtr b) -> ForeignPtr b)
-> GenBond (ForeignPtr b)
-> (Ptr b -> IO r)
-> IO r
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr b) CBond' -> ForeignPtr b
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr b) CBond' -> ForeignPtr b)
-> (GenBond (ForeignPtr b) -> GenForeignPtr (ForeignPtr b) CBond')
-> GenBond (ForeignPtr b)
-> ForeignPtr b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CBond' (ForeignPtr b)) CInstrument'
-> GenForeignPtr (ForeignPtr b) CBond'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CBond' (ForeignPtr b)) CInstrument'
 -> GenForeignPtr (ForeignPtr b) CBond')
-> (GenBond (ForeignPtr b)
    -> GenForeignPtr (AnyOf CBond' (ForeignPtr b)) CInstrument')
-> GenBond (ForeignPtr b)
-> GenForeignPtr (ForeignPtr b) CBond'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenBond (ForeignPtr b)
-> GenForeignPtr (AnyOf CBond' (ForeignPtr b)) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CBondForward'
type CBondForward = ForeignPtr CBondForward'
-- |A 'Forward'; see the hierarchy under t'GenInstrument'.
type BondForward = GenForward CBondForward
foreign import ccall unsafe "ql.h &qlFreeBondForward" qlFreeBondForward :: FinalizerPtr CBondForward'
instance Finalizable CBondForward' where finalize :: FinalizerPtr CBondForward'
finalize = FinalizerPtr CBondForward'
qlFreeBondForward
foreign import ccall "ql.h qlBondForwardAsForward" qlBondForwardAsForward :: Ptr CBondForward' -> IO (Ptr CForward')
instance Upcastable CBondForward' where {type Base CBondForward' = CForward'; upcast :: Ptr CBondForward' -> IO (Ptr (Base CBondForward'))
upcast = Ptr CBondForward' -> IO (Ptr CForward')
Ptr CBondForward' -> IO (Ptr (Base CBondForward'))
qlBondForwardAsForward}
peekBondForward :: Ptr CBondForward' -> IO BondForward
peekBondForward :: Ptr CBondForward' -> IO BondForward
peekBondForward = Ptr CBondForward' -> IO BondForward
forall f.
(Finalizable f, Upcastable f, Base f ~ CForward') =>
Ptr f -> IO (GenForward (ForeignPtr f))
peekGenForward
withBondForward :: BondForward -> (Ptr CBondForward' -> IO b) -> IO b
withBondForward :: forall b. BondForward -> (Ptr CBondForward' -> IO b) -> IO b
withBondForward = ForeignPtr CBondForward' -> (Ptr CBondForward' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CBondForward' -> (Ptr CBondForward' -> IO b) -> IO b)
-> (BondForward -> ForeignPtr CBondForward')
-> BondForward
-> (Ptr CBondForward' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CBondForward') CForward'
-> ForeignPtr CBondForward'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CBondForward') CForward'
 -> ForeignPtr CBondForward')
-> (BondForward
    -> GenForeignPtr (ForeignPtr CBondForward') CForward')
-> BondForward
-> ForeignPtr CBondForward'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CForward' (ForeignPtr CBondForward')) CInstrument'
-> GenForeignPtr (ForeignPtr CBondForward') CForward'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CForward' (ForeignPtr CBondForward')) CInstrument'
 -> GenForeignPtr (ForeignPtr CBondForward') CForward')
-> (BondForward
    -> GenForeignPtr
         (AnyOf CForward' (ForeignPtr CBondForward')) CInstrument')
-> BondForward
-> GenForeignPtr (ForeignPtr CBondForward') CForward'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BondForward
-> GenForeignPtr
     (AnyOf CForward' (ForeignPtr CBondForward')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CConvertibleBond'
type CConvertibleBond = ForeignPtr CConvertibleBond'
-- |A 'Bond'; see the hierarchy under t'GenInstrument'.
type ConvertibleBond = GenBond CConvertibleBond
foreign import ccall unsafe "ql.h &qlFreeConvertibleBond" qlFreeConvertibleBond :: FinalizerPtr CConvertibleBond'
instance Finalizable CConvertibleBond' where finalize :: FinalizerPtr CConvertibleBond'
finalize = FinalizerPtr CConvertibleBond'
qlFreeConvertibleBond
foreign import ccall "ql.h qlConvertibleBondAsBond" qlConvertibleBondAsBond :: Ptr CConvertibleBond' -> IO (Ptr CBond')
instance Upcastable CConvertibleBond' where {type Base CConvertibleBond' = CBond'; upcast :: Ptr CConvertibleBond' -> IO (Ptr (Base CConvertibleBond'))
upcast = Ptr CConvertibleBond' -> IO (Ptr CBond')
Ptr CConvertibleBond' -> IO (Ptr (Base CConvertibleBond'))
qlConvertibleBondAsBond}
peekConvertibleBond :: Ptr CConvertibleBond' -> IO ConvertibleBond
peekConvertibleBond :: Ptr CConvertibleBond' -> IO ConvertibleBond
peekConvertibleBond = Ptr CConvertibleBond' -> IO ConvertibleBond
forall b.
(Finalizable b, Upcastable b, Base b ~ CBond') =>
Ptr b -> IO (GenBond (ForeignPtr b))
peekGenBond
withConvertibleBond :: ConvertibleBond -> (Ptr CConvertibleBond' -> IO b) -> IO b
withConvertibleBond :: forall b.
ConvertibleBond -> (Ptr CConvertibleBond' -> IO b) -> IO b
withConvertibleBond = ForeignPtr CConvertibleBond'
-> (Ptr CConvertibleBond' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CConvertibleBond'
 -> (Ptr CConvertibleBond' -> IO b) -> IO b)
-> (ConvertibleBond -> ForeignPtr CConvertibleBond')
-> ConvertibleBond
-> (Ptr CConvertibleBond' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CConvertibleBond') CBond'
-> ForeignPtr CConvertibleBond'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CConvertibleBond') CBond'
 -> ForeignPtr CConvertibleBond')
-> (ConvertibleBond
    -> GenForeignPtr (ForeignPtr CConvertibleBond') CBond')
-> ConvertibleBond
-> ForeignPtr CConvertibleBond'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBond' (ForeignPtr CConvertibleBond')) CInstrument'
-> GenForeignPtr (ForeignPtr CConvertibleBond') CBond'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBond' (ForeignPtr CConvertibleBond')) CInstrument'
 -> GenForeignPtr (ForeignPtr CConvertibleBond') CBond')
-> (ConvertibleBond
    -> GenForeignPtr
         (AnyOf CBond' (ForeignPtr CConvertibleBond')) CInstrument')
-> ConvertibleBond
-> GenForeignPtr (ForeignPtr CConvertibleBond') CBond'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ConvertibleBond
-> GenForeignPtr
     (AnyOf CBond' (ForeignPtr CConvertibleBond')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

-- FixedRateBond is promoted to a one-AnyOf-layer family of its own (mirrors
-- GenFixedVsFloatingSwap/VanillaSwap) because BTP (below) is a real leaf under it: BTP is only
-- needed at all because RendistatoBasket's own constructor requires vector<shared_ptr<BTP>>, and
-- the shim constructing 'btp'/'btpWithRedemption' already knows it is building a genuine BTP, so
-- there is no cast to avoid by keeping it that way rather than eagerly erasing to FixedRateBond.
data CFixedRateBond'
type GenFixedRateBond fb = GenBond (AnyOf CFixedRateBond' fb)
type CFixedRateBond = ForeignPtr CFixedRateBond'
-- |A 'Bond'; see the hierarchy under t'GenInstrument'.
type FixedRateBond = GenFixedRateBond CFixedRateBond
foreign import ccall unsafe "ql.h &qlFreeFixedRateBond" qlFreeFixedRateBond :: FinalizerPtr CFixedRateBond'
instance Finalizable CFixedRateBond' where finalize :: FinalizerPtr CFixedRateBond'
finalize = FinalizerPtr CFixedRateBond'
qlFreeFixedRateBond
foreign import ccall "ql.h qlFixedRateBondAsBond" qlFixedRateBondAsBond :: Ptr CFixedRateBond' -> IO (Ptr CBond')
instance Upcastable CFixedRateBond' where {type Base CFixedRateBond' = CBond'; upcast :: Ptr CFixedRateBond' -> IO (Ptr (Base CFixedRateBond'))
upcast = Ptr CFixedRateBond' -> IO (Ptr CBond')
Ptr CFixedRateBond' -> IO (Ptr (Base CFixedRateBond'))
qlFixedRateBondAsBond}
peekFixedRateBond :: Ptr CFixedRateBond' -> IO FixedRateBond
peekFixedRateBond :: Ptr CFixedRateBond' -> IO FixedRateBond
peekFixedRateBond = Ptr CFixedRateBond'
-> IO (GenForeignPtr (ForeignPtr CFixedRateBond') CFixedRateBond')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CFixedRateBond'
 -> IO (GenForeignPtr (ForeignPtr CFixedRateBond') CFixedRateBond'))
-> (GenForeignPtr (ForeignPtr CFixedRateBond') CFixedRateBond'
    -> IO FixedRateBond)
-> Ptr CFixedRateBond'
-> IO FixedRateBond
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CFixedRateBond') CFixedRateBond'
-> IO FixedRateBond
forall fb.
GenForeignPtr fb CFixedRateBond' -> IO (GenFixedRateBond fb)
newGenFixedRateBond
withFixedRateBond :: GenFixedRateBond fb -> (Ptr CFixedRateBond' -> IO b) -> IO b
withFixedRateBond :: forall fb b.
GenFixedRateBond fb -> (Ptr CFixedRateBond' -> IO b) -> IO b
withFixedRateBond = GenForeignPtr fb CFixedRateBond'
-> (Ptr CFixedRateBond' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr fb CFixedRateBond'
 -> (Ptr CFixedRateBond' -> IO b) -> IO b)
-> (GenFixedRateBond fb -> GenForeignPtr fb CFixedRateBond')
-> GenFixedRateBond fb
-> (Ptr CFixedRateBond' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CFixedRateBond' fb) CBond'
-> GenForeignPtr fb CFixedRateBond'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CFixedRateBond' fb) CBond'
 -> GenForeignPtr fb CFixedRateBond')
-> (GenFixedRateBond fb
    -> GenForeignPtr (AnyOf CFixedRateBond' fb) CBond')
-> GenFixedRateBond fb
-> GenForeignPtr fb CFixedRateBond'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBond' (AnyOf CFixedRateBond' fb)) CInstrument'
-> GenForeignPtr (AnyOf CFixedRateBond' fb) CBond'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBond' (AnyOf CFixedRateBond' fb)) CInstrument'
 -> GenForeignPtr (AnyOf CFixedRateBond' fb) CBond')
-> (GenFixedRateBond fb
    -> GenForeignPtr
         (AnyOf CBond' (AnyOf CFixedRateBond' fb)) CInstrument')
-> GenFixedRateBond fb
-> GenForeignPtr (AnyOf CFixedRateBond' fb) CBond'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenFixedRateBond fb
-> GenForeignPtr
     (AnyOf CBond' (AnyOf CFixedRateBond' fb)) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
newGenFixedRateBond :: GenForeignPtr fb CFixedRateBond' -> IO (GenFixedRateBond fb)
newGenFixedRateBond :: forall fb.
GenForeignPtr fb CFixedRateBond' -> IO (GenFixedRateBond fb)
newGenFixedRateBond = GenFixedRateBond fb -> IO (GenFixedRateBond fb)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenFixedRateBond fb -> IO (GenFixedRateBond fb))
-> (GenForeignPtr fb CFixedRateBond' -> GenFixedRateBond fb)
-> GenForeignPtr fb CFixedRateBond'
-> IO (GenFixedRateBond fb)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBond' (AnyOf CFixedRateBond' fb)) CInstrument'
-> GenFixedRateBond fb
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr
   (AnyOf CBond' (AnyOf CFixedRateBond' fb)) CInstrument'
 -> GenFixedRateBond fb)
-> (GenForeignPtr fb CFixedRateBond'
    -> GenForeignPtr
         (AnyOf CBond' (AnyOf CFixedRateBond' fb)) CInstrument')
-> GenForeignPtr fb CFixedRateBond'
-> GenFixedRateBond fb
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CFixedRateBond' fb) CBond'
-> GenForeignPtr
     (AnyOf CBond' (AnyOf CFixedRateBond' fb)) CInstrument'
GenForeignPtr (AnyOf CFixedRateBond' fb) CBond'
-> GenForeignPtr
     (AnyOf CBond' (AnyOf CFixedRateBond' fb)) (Base CBond')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CFixedRateBond' fb) CBond'
 -> GenForeignPtr
      (AnyOf CBond' (AnyOf CFixedRateBond' fb)) CInstrument')
-> (GenForeignPtr fb CFixedRateBond'
    -> GenForeignPtr (AnyOf CFixedRateBond' fb) CBond')
-> GenForeignPtr fb CFixedRateBond'
-> GenForeignPtr
     (AnyOf CBond' (AnyOf CFixedRateBond' fb)) CInstrument'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr fb CFixedRateBond'
-> GenForeignPtr (AnyOf CFixedRateBond' fb) CBond'
GenForeignPtr fb CFixedRateBond'
-> GenForeignPtr (AnyOf CFixedRateBond' fb) (Base CFixedRateBond')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf

-- |Italian BTP (Buono Poliennali del Tesoro): a 'FixedRateBond' with the Italian Treasury's own
-- hardcoded conventions (semiannual, Actual\/Actual ISMA, ModifiedFollowing, TARGET payment
-- calendar, par redemption unless overridden) -- see 'QuantLib.Instrument.Bond.btp'.
data CBTP'
type CBTP = ForeignPtr CBTP'
-- |A 'FixedRateBond'; see the hierarchy under t'GenInstrument'.
type BTP = GenFixedRateBond CBTP
foreign import ccall unsafe "ql.h &qlFreeBtp" qlFreeBtp :: FinalizerPtr CBTP'
instance Finalizable CBTP' where finalize :: FinalizerPtr CBTP'
finalize = FinalizerPtr CBTP'
qlFreeBtp
foreign import ccall "ql.h qlBtpAsFixedRateBond" qlBtpAsFixedRateBond :: Ptr CBTP' -> IO (Ptr CFixedRateBond')
instance Upcastable CBTP' where {type Base CBTP' = CFixedRateBond'; upcast :: Ptr CBTP' -> IO (Ptr (Base CBTP'))
upcast = Ptr CBTP' -> IO (Ptr CFixedRateBond')
Ptr CBTP' -> IO (Ptr (Base CBTP'))
qlBtpAsFixedRateBond}
peekBTP :: Ptr CBTP' -> IO BTP
peekBTP :: Ptr CBTP' -> IO BTP
peekBTP = Ptr CBTP' -> IO (GenForeignPtr (ForeignPtr CBTP') CFixedRateBond')
Ptr CBTP' -> IO (GenForeignPtr (ForeignPtr CBTP') (Base CBTP'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CBTP'
 -> IO (GenForeignPtr (ForeignPtr CBTP') CFixedRateBond'))
-> (GenForeignPtr (ForeignPtr CBTP') CFixedRateBond' -> IO BTP)
-> Ptr CBTP'
-> IO BTP
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CBTP') CFixedRateBond' -> IO BTP
forall fb.
GenForeignPtr fb CFixedRateBond' -> IO (GenFixedRateBond fb)
newGenFixedRateBond
withBTP :: BTP -> (Ptr CBTP' -> IO b) -> IO b
withBTP :: forall b. BTP -> (Ptr CBTP' -> IO b) -> IO b
withBTP = ForeignPtr CBTP' -> (Ptr CBTP' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CBTP' -> (Ptr CBTP' -> IO b) -> IO b)
-> (BTP -> ForeignPtr CBTP') -> BTP -> (Ptr CBTP' -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CBTP') CFixedRateBond'
-> ForeignPtr CBTP'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CBTP') CFixedRateBond'
 -> ForeignPtr CBTP')
-> (BTP -> GenForeignPtr (ForeignPtr CBTP') CFixedRateBond')
-> BTP
-> ForeignPtr CBTP'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CFixedRateBond' (ForeignPtr CBTP')) CBond'
-> GenForeignPtr (ForeignPtr CBTP') CFixedRateBond'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CFixedRateBond' (ForeignPtr CBTP')) CBond'
 -> GenForeignPtr (ForeignPtr CBTP') CFixedRateBond')
-> (BTP
    -> GenForeignPtr (AnyOf CFixedRateBond' (ForeignPtr CBTP')) CBond')
-> BTP
-> GenForeignPtr (ForeignPtr CBTP') CFixedRateBond'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBond' (AnyOf CFixedRateBond' (ForeignPtr CBTP')))
  CInstrument'
-> GenForeignPtr (AnyOf CFixedRateBond' (ForeignPtr CBTP')) CBond'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBond' (AnyOf CFixedRateBond' (ForeignPtr CBTP')))
   CInstrument'
 -> GenForeignPtr (AnyOf CFixedRateBond' (ForeignPtr CBTP')) CBond')
-> (BTP
    -> GenForeignPtr
         (AnyOf CBond' (AnyOf CFixedRateBond' (ForeignPtr CBTP')))
         CInstrument')
-> BTP
-> GenForeignPtr (AnyOf CFixedRateBond' (ForeignPtr CBTP')) CBond'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BTP
-> GenForeignPtr
     (AnyOf CBond' (AnyOf CFixedRateBond' (ForeignPtr CBTP')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
withBTPArray :: [BTP] -> ((CUInt, Ptr (Ptr CBTP')) -> IO b) -> IO b
withBTPArray :: forall b. [BTP] -> ((CUInt, Ptr (Ptr CBTP')) -> IO b) -> IO b
withBTPArray = (BTP -> (Ptr CBTP' -> IO b) -> IO b)
-> [BTP] -> ((CUInt, Ptr (Ptr CBTP')) -> IO b) -> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray BTP -> (Ptr CBTP' -> IO b) -> IO b
forall b. BTP -> (Ptr CBTP' -> IO b) -> IO b
withBTP

-- |A weighted collection of BTPs with live clean-price quotes -- see
-- 'QuantLib.Instrument.Bond.rendistatoBasket'.
data CRendistatoBasket
newtype RendistatoBasket = RendistatoBasket {RendistatoBasket -> Standalone CRendistatoBasket
getCRendistatoBasket :: Standalone CRendistatoBasket}
foreign import ccall unsafe "ql.h &qlFreeRendistatoBasket" qlFreeRendistatoBasket :: FinalizerPtr CRendistatoBasket
instance Finalizable CRendistatoBasket where finalize :: FinalizerPtr CRendistatoBasket
finalize = FinalizerPtr CRendistatoBasket
qlFreeRendistatoBasket
peekRendistatoBasket :: Ptr CRendistatoBasket -> IO RendistatoBasket
peekRendistatoBasket :: Ptr CRendistatoBasket -> IO RendistatoBasket
peekRendistatoBasket = Standalone CRendistatoBasket -> RendistatoBasket
RendistatoBasket (Standalone CRendistatoBasket -> RendistatoBasket)
-> (Ptr CRendistatoBasket -> IO (Standalone CRendistatoBasket))
-> Ptr CRendistatoBasket
-> IO RendistatoBasket
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CRendistatoBasket -> IO (Standalone CRendistatoBasket)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withRendistatoBasket :: RendistatoBasket -> (Ptr CRendistatoBasket -> IO b) -> IO b
withRendistatoBasket :: forall b.
RendistatoBasket -> (Ptr CRendistatoBasket -> IO b) -> IO b
withRendistatoBasket = Standalone CRendistatoBasket
-> (Ptr CRendistatoBasket -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CRendistatoBasket
 -> (Ptr CRendistatoBasket -> IO b) -> IO b)
-> (RendistatoBasket -> Standalone CRendistatoBasket)
-> RendistatoBasket
-> (Ptr CRendistatoBasket -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RendistatoBasket -> Standalone CRendistatoBasket
getCRendistatoBasket

-- |QuantLib's own BTP-vs-swap-curve relative-value calculator -- see
-- 'QuantLib.Instrument.Bond.rendistatoCalculator'.
data CRendistatoCalculator
newtype RendistatoCalculator = RendistatoCalculator {RendistatoCalculator -> Standalone CRendistatoCalculator
getCRendistatoCalculator :: Standalone CRendistatoCalculator}
foreign import ccall unsafe "ql.h &qlFreeRendistatoCalculator" qlFreeRendistatoCalculator :: FinalizerPtr CRendistatoCalculator
instance Finalizable CRendistatoCalculator where finalize :: FinalizerPtr CRendistatoCalculator
finalize = FinalizerPtr CRendistatoCalculator
qlFreeRendistatoCalculator
peekRendistatoCalculator :: Ptr CRendistatoCalculator -> IO RendistatoCalculator
peekRendistatoCalculator :: Ptr CRendistatoCalculator -> IO RendistatoCalculator
peekRendistatoCalculator = Standalone CRendistatoCalculator -> RendistatoCalculator
RendistatoCalculator (Standalone CRendistatoCalculator -> RendistatoCalculator)
-> (Ptr CRendistatoCalculator
    -> IO (Standalone CRendistatoCalculator))
-> Ptr CRendistatoCalculator
-> IO RendistatoCalculator
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CRendistatoCalculator -> IO (Standalone CRendistatoCalculator)
forall a. Finalizable a => Ptr a -> IO (Standalone a)
peekStandalone
withRendistatoCalculator :: RendistatoCalculator -> (Ptr CRendistatoCalculator -> IO b) -> IO b
withRendistatoCalculator :: forall b.
RendistatoCalculator -> (Ptr CRendistatoCalculator -> IO b) -> IO b
withRendistatoCalculator = Standalone CRendistatoCalculator
-> (Ptr CRendistatoCalculator -> IO b) -> IO b
forall a b. Standalone a -> (Ptr a -> IO b) -> IO b
withStandalone (Standalone CRendistatoCalculator
 -> (Ptr CRendistatoCalculator -> IO b) -> IO b)
-> (RendistatoCalculator -> Standalone CRendistatoCalculator)
-> RendistatoCalculator
-> (Ptr CRendistatoCalculator -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RendistatoCalculator -> Standalone CRendistatoCalculator
getCRendistatoCalculator

data CCPIBond'
type CCPIBond = ForeignPtr CCPIBond'
-- |A 'Bond'; see the hierarchy under t'GenInstrument'.
type CPIBond = GenBond CCPIBond
foreign import ccall unsafe "ql.h &qlFreeCPIBond" qlFreeCPIBond :: FinalizerPtr CCPIBond'
instance Finalizable CCPIBond' where finalize :: FinalizerPtr CCPIBond'
finalize = FinalizerPtr CCPIBond'
qlFreeCPIBond
foreign import ccall "ql.h qlCPIBondAsBond" qlCPIBondAsBond :: Ptr CCPIBond' -> IO (Ptr CBond')
instance Upcastable CCPIBond' where {type Base CCPIBond' = CBond'; upcast :: Ptr CCPIBond' -> IO (Ptr (Base CCPIBond'))
upcast = Ptr CCPIBond' -> IO (Ptr CBond')
Ptr CCPIBond' -> IO (Ptr (Base CCPIBond'))
qlCPIBondAsBond}
peekCPIBond :: Ptr CCPIBond' -> IO CPIBond
peekCPIBond :: Ptr CCPIBond' -> IO CPIBond
peekCPIBond = Ptr CCPIBond' -> IO CPIBond
forall b.
(Finalizable b, Upcastable b, Base b ~ CBond') =>
Ptr b -> IO (GenBond (ForeignPtr b))
peekGenBond
withCPIBond :: CPIBond -> (Ptr CCPIBond' -> IO b) -> IO b
withCPIBond :: forall b. CPIBond -> (Ptr CCPIBond' -> IO b) -> IO b
withCPIBond = ForeignPtr CCPIBond' -> (Ptr CCPIBond' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CCPIBond' -> (Ptr CCPIBond' -> IO b) -> IO b)
-> (CPIBond -> ForeignPtr CCPIBond')
-> CPIBond
-> (Ptr CCPIBond' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CCPIBond') CBond' -> ForeignPtr CCPIBond'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CCPIBond') CBond'
 -> ForeignPtr CCPIBond')
-> (CPIBond -> GenForeignPtr (ForeignPtr CCPIBond') CBond')
-> CPIBond
-> ForeignPtr CCPIBond'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CBond' (ForeignPtr CCPIBond')) CInstrument'
-> GenForeignPtr (ForeignPtr CCPIBond') CBond'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CBond' (ForeignPtr CCPIBond')) CInstrument'
 -> GenForeignPtr (ForeignPtr CCPIBond') CBond')
-> (CPIBond
    -> GenForeignPtr
         (AnyOf CBond' (ForeignPtr CCPIBond')) CInstrument')
-> CPIBond
-> GenForeignPtr (ForeignPtr CCPIBond') CBond'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CPIBond
-> GenForeignPtr (AnyOf CBond' (ForeignPtr CCPIBond')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CCallableBond'
type CCallableBond = ForeignPtr CCallableBond'
-- |A 'Bond'; see the hierarchy under t'GenInstrument'.
type CallableBond = GenBond CCallableBond
foreign import ccall unsafe "ql.h &qlFreeCallableBond" qlFreeCallableBond :: FinalizerPtr CCallableBond'
instance Finalizable CCallableBond' where finalize :: FinalizerPtr CCallableBond'
finalize = FinalizerPtr CCallableBond'
qlFreeCallableBond
foreign import ccall "ql.h qlCallableBondAsBond" qlCallableBondAsBond :: Ptr CCallableBond' -> IO (Ptr CBond')
instance Upcastable CCallableBond' where {type Base CCallableBond' = CBond'; upcast :: Ptr CCallableBond' -> IO (Ptr (Base CCallableBond'))
upcast = Ptr CCallableBond' -> IO (Ptr CBond')
Ptr CCallableBond' -> IO (Ptr (Base CCallableBond'))
qlCallableBondAsBond}
peekCallableBond :: Ptr CCallableBond' -> IO CallableBond
peekCallableBond :: Ptr CCallableBond' -> IO CallableBond
peekCallableBond = Ptr CCallableBond' -> IO CallableBond
forall b.
(Finalizable b, Upcastable b, Base b ~ CBond') =>
Ptr b -> IO (GenBond (ForeignPtr b))
peekGenBond
withCallableBond :: CallableBond -> (Ptr CCallableBond' -> IO b) -> IO b
withCallableBond :: forall b. CallableBond -> (Ptr CCallableBond' -> IO b) -> IO b
withCallableBond = ForeignPtr CCallableBond' -> (Ptr CCallableBond' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CCallableBond' -> (Ptr CCallableBond' -> IO b) -> IO b)
-> (CallableBond -> ForeignPtr CCallableBond')
-> CallableBond
-> (Ptr CCallableBond' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CCallableBond') CBond'
-> ForeignPtr CCallableBond'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CCallableBond') CBond'
 -> ForeignPtr CCallableBond')
-> (CallableBond
    -> GenForeignPtr (ForeignPtr CCallableBond') CBond')
-> CallableBond
-> ForeignPtr CCallableBond'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CBond' (ForeignPtr CCallableBond')) CInstrument'
-> GenForeignPtr (ForeignPtr CCallableBond') CBond'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CBond' (ForeignPtr CCallableBond')) CInstrument'
 -> GenForeignPtr (ForeignPtr CCallableBond') CBond')
-> (CallableBond
    -> GenForeignPtr
         (AnyOf CBond' (ForeignPtr CCallableBond')) CInstrument')
-> CallableBond
-> GenForeignPtr (ForeignPtr CCallableBond') CBond'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CallableBond
-> GenForeignPtr
     (AnyOf CBond' (ForeignPtr CCallableBond')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

-- FixedVsFloatingSwap sits between Swap and VanillaSwap (upstream: VanillaSwap, OvernightIndexedSwap
-- and MultipleResetsSwap all derive from it, but only VanillaSwap is modelled through it here --
-- the others still upcast straight to Swap, collapsing the intermediate level as usual). It earns
-- its own family level (mirrors MultiAssetOption/MargrabeOption's one-more-AnyOf-layer shape)
-- because SwaptionHelper::underlying() (QuantLib/Model.chs) returns exactly this type, and its own
-- getters (fairRate, fairSpread, fixedLeg*, floatingLeg*) are inherited, not VanillaSwap-specific --
-- binding them generically over 'GenFixedVsFloatingSwap' avoids a cast to reach them from that
-- getter's result. FixedVsFloatingSwap itself is abstract upstream (pure virtual
-- setupFloatingArguments), so hasquant binds no constructor for it directly.
data CFixedVsFloatingSwap'
type GenFixedVsFloatingSwap f = GenSwap (AnyOf CFixedVsFloatingSwap' f)
type CFixedVsFloatingSwap = ForeignPtr CFixedVsFloatingSwap'
-- |A 'Swap'; see the hierarchy under t'GenInstrument'.
type FixedVsFloatingSwap = GenFixedVsFloatingSwap CFixedVsFloatingSwap
data CVanillaSwap'
type CVanillaSwap = ForeignPtr CVanillaSwap'
-- |A 'FixedVsFloatingSwap'; see the hierarchy under t'GenInstrument'.
type VanillaSwap = GenFixedVsFloatingSwap CVanillaSwap
foreign import ccall unsafe "ql.h &qlFreeFixedVsFloatingSwap" qlFreeFixedVsFloatingSwap :: FinalizerPtr CFixedVsFloatingSwap'
foreign import ccall unsafe "ql.h &qlFreeVanillaSwap" qlFreeVanillaSwap :: FinalizerPtr CVanillaSwap'
instance Finalizable CFixedVsFloatingSwap' where finalize :: FinalizerPtr CFixedVsFloatingSwap'
finalize = FinalizerPtr CFixedVsFloatingSwap'
qlFreeFixedVsFloatingSwap
instance Finalizable CVanillaSwap' where finalize :: FinalizerPtr CVanillaSwap'
finalize = FinalizerPtr CVanillaSwap'
qlFreeVanillaSwap
foreign import ccall "ql.h qlFixedVsFloatingSwapAsSwap" qlFixedVsFloatingSwapAsSwap :: Ptr CFixedVsFloatingSwap' -> IO (Ptr CSwap')
foreign import ccall "ql.h qlVanillaSwapAsFixedVsFloatingSwap" qlVanillaSwapAsFixedVsFloatingSwap :: Ptr CVanillaSwap' -> IO (Ptr CFixedVsFloatingSwap')
instance Upcastable CFixedVsFloatingSwap' where {type Base CFixedVsFloatingSwap' = CSwap'; upcast :: Ptr CFixedVsFloatingSwap' -> IO (Ptr (Base CFixedVsFloatingSwap'))
upcast = Ptr CFixedVsFloatingSwap' -> IO (Ptr CSwap')
Ptr CFixedVsFloatingSwap' -> IO (Ptr (Base CFixedVsFloatingSwap'))
qlFixedVsFloatingSwapAsSwap}
instance Upcastable CVanillaSwap' where {type Base CVanillaSwap' = CFixedVsFloatingSwap'; upcast :: Ptr CVanillaSwap' -> IO (Ptr (Base CVanillaSwap'))
upcast = Ptr CVanillaSwap' -> IO (Ptr CFixedVsFloatingSwap')
Ptr CVanillaSwap' -> IO (Ptr (Base CVanillaSwap'))
qlVanillaSwapAsFixedVsFloatingSwap}
asFixedVsFloatingSwap :: GenFixedVsFloatingSwap f -> IO FixedVsFloatingSwap
asFixedVsFloatingSwap :: forall f. GenFixedVsFloatingSwap f -> IO FixedVsFloatingSwap
asFixedVsFloatingSwap = (Ptr CFixedVsFloatingSwap' -> IO FixedVsFloatingSwap)
-> GenForeignPtr f CFixedVsFloatingSwap' -> IO FixedVsFloatingSwap
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CFixedVsFloatingSwap' -> IO FixedVsFloatingSwap
peekFixedVsFloatingSwap (GenForeignPtr f CFixedVsFloatingSwap' -> IO FixedVsFloatingSwap)
-> (GenFixedVsFloatingSwap f
    -> GenForeignPtr f CFixedVsFloatingSwap')
-> GenFixedVsFloatingSwap f
-> IO FixedVsFloatingSwap
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap'
-> GenForeignPtr f CFixedVsFloatingSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap'
 -> GenForeignPtr f CFixedVsFloatingSwap')
-> (GenFixedVsFloatingSwap f
    -> GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap')
-> GenFixedVsFloatingSwap f
-> GenForeignPtr f CFixedVsFloatingSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) CInstrument'
-> GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) CInstrument'
 -> GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap')
-> (GenFixedVsFloatingSwap f
    -> GenForeignPtr
         (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) CInstrument')
-> GenFixedVsFloatingSwap f
-> GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenFixedVsFloatingSwap f
-> GenForeignPtr
     (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
peekFixedVsFloatingSwap :: Ptr CFixedVsFloatingSwap' -> IO FixedVsFloatingSwap
peekFixedVsFloatingSwap :: Ptr CFixedVsFloatingSwap' -> IO FixedVsFloatingSwap
peekFixedVsFloatingSwap = Ptr CFixedVsFloatingSwap'
-> IO
     (GenForeignPtr
        (ForeignPtr CFixedVsFloatingSwap') CFixedVsFloatingSwap')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CFixedVsFloatingSwap'
 -> IO
      (GenForeignPtr
         (ForeignPtr CFixedVsFloatingSwap') CFixedVsFloatingSwap'))
-> (GenForeignPtr
      (ForeignPtr CFixedVsFloatingSwap') CFixedVsFloatingSwap'
    -> IO FixedVsFloatingSwap)
-> Ptr CFixedVsFloatingSwap'
-> IO FixedVsFloatingSwap
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CFixedVsFloatingSwap') CFixedVsFloatingSwap'
-> IO FixedVsFloatingSwap
forall f.
GenForeignPtr f CFixedVsFloatingSwap'
-> IO (GenFixedVsFloatingSwap f)
newGenFixedVsFloatingSwap
withFixedVsFloatingSwap :: GenFixedVsFloatingSwap f -> (Ptr CFixedVsFloatingSwap' -> IO b) -> IO b
withFixedVsFloatingSwap :: forall f b.
GenFixedVsFloatingSwap f
-> (Ptr CFixedVsFloatingSwap' -> IO b) -> IO b
withFixedVsFloatingSwap = GenForeignPtr f CFixedVsFloatingSwap'
-> (Ptr CFixedVsFloatingSwap' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr f CFixedVsFloatingSwap'
 -> (Ptr CFixedVsFloatingSwap' -> IO b) -> IO b)
-> (GenFixedVsFloatingSwap f
    -> GenForeignPtr f CFixedVsFloatingSwap')
-> GenFixedVsFloatingSwap f
-> (Ptr CFixedVsFloatingSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap'
-> GenForeignPtr f CFixedVsFloatingSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap'
 -> GenForeignPtr f CFixedVsFloatingSwap')
-> (GenFixedVsFloatingSwap f
    -> GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap')
-> GenFixedVsFloatingSwap f
-> GenForeignPtr f CFixedVsFloatingSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) CInstrument'
-> GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) CInstrument'
 -> GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap')
-> (GenFixedVsFloatingSwap f
    -> GenForeignPtr
         (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) CInstrument')
-> GenFixedVsFloatingSwap f
-> GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenFixedVsFloatingSwap f
-> GenForeignPtr
     (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
newGenFixedVsFloatingSwap :: GenForeignPtr f CFixedVsFloatingSwap' -> IO (GenFixedVsFloatingSwap f)
newGenFixedVsFloatingSwap :: forall f.
GenForeignPtr f CFixedVsFloatingSwap'
-> IO (GenFixedVsFloatingSwap f)
newGenFixedVsFloatingSwap = GenFixedVsFloatingSwap f -> IO (GenFixedVsFloatingSwap f)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenFixedVsFloatingSwap f -> IO (GenFixedVsFloatingSwap f))
-> (GenForeignPtr f CFixedVsFloatingSwap'
    -> GenFixedVsFloatingSwap f)
-> GenForeignPtr f CFixedVsFloatingSwap'
-> IO (GenFixedVsFloatingSwap f)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) CInstrument'
-> GenFixedVsFloatingSwap f
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr
   (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) CInstrument'
 -> GenFixedVsFloatingSwap f)
-> (GenForeignPtr f CFixedVsFloatingSwap'
    -> GenForeignPtr
         (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) CInstrument')
-> GenForeignPtr f CFixedVsFloatingSwap'
-> GenFixedVsFloatingSwap f
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap'
-> GenForeignPtr
     (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) CInstrument'
GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap'
-> GenForeignPtr
     (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) (Base CSwap')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap'
 -> GenForeignPtr
      (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) CInstrument')
-> (GenForeignPtr f CFixedVsFloatingSwap'
    -> GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap')
-> GenForeignPtr f CFixedVsFloatingSwap'
-> GenForeignPtr
     (AnyOf CSwap' (AnyOf CFixedVsFloatingSwap' f)) CInstrument'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr f CFixedVsFloatingSwap'
-> GenForeignPtr (AnyOf CFixedVsFloatingSwap' f) CSwap'
GenForeignPtr f CFixedVsFloatingSwap'
-> GenForeignPtr
     (AnyOf CFixedVsFloatingSwap' f) (Base CFixedVsFloatingSwap')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekVanillaSwap :: Ptr CVanillaSwap' -> IO VanillaSwap
peekVanillaSwap :: Ptr CVanillaSwap' -> IO VanillaSwap
peekVanillaSwap = Ptr CVanillaSwap'
-> IO
     (GenForeignPtr (ForeignPtr CVanillaSwap') CFixedVsFloatingSwap')
Ptr CVanillaSwap'
-> IO
     (GenForeignPtr (ForeignPtr CVanillaSwap') (Base CVanillaSwap'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CVanillaSwap'
 -> IO
      (GenForeignPtr (ForeignPtr CVanillaSwap') CFixedVsFloatingSwap'))
-> (GenForeignPtr (ForeignPtr CVanillaSwap') CFixedVsFloatingSwap'
    -> IO VanillaSwap)
-> Ptr CVanillaSwap'
-> IO VanillaSwap
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CVanillaSwap') CFixedVsFloatingSwap'
-> IO VanillaSwap
forall f.
GenForeignPtr f CFixedVsFloatingSwap'
-> IO (GenFixedVsFloatingSwap f)
newGenFixedVsFloatingSwap
withVanillaSwap :: VanillaSwap -> (Ptr CVanillaSwap' -> IO b) -> IO b
withVanillaSwap :: forall b. VanillaSwap -> (Ptr CVanillaSwap' -> IO b) -> IO b
withVanillaSwap = ForeignPtr CVanillaSwap' -> (Ptr CVanillaSwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CVanillaSwap' -> (Ptr CVanillaSwap' -> IO b) -> IO b)
-> (VanillaSwap -> ForeignPtr CVanillaSwap')
-> VanillaSwap
-> (Ptr CVanillaSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CVanillaSwap') CFixedVsFloatingSwap'
-> ForeignPtr CVanillaSwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CVanillaSwap') CFixedVsFloatingSwap'
 -> ForeignPtr CVanillaSwap')
-> (VanillaSwap
    -> GenForeignPtr (ForeignPtr CVanillaSwap') CFixedVsFloatingSwap')
-> VanillaSwap
-> ForeignPtr CVanillaSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CFixedVsFloatingSwap' (ForeignPtr CVanillaSwap')) CSwap'
-> GenForeignPtr (ForeignPtr CVanillaSwap') CFixedVsFloatingSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CFixedVsFloatingSwap' (ForeignPtr CVanillaSwap')) CSwap'
 -> GenForeignPtr (ForeignPtr CVanillaSwap') CFixedVsFloatingSwap')
-> (VanillaSwap
    -> GenForeignPtr
         (AnyOf CFixedVsFloatingSwap' (ForeignPtr CVanillaSwap')) CSwap')
-> VanillaSwap
-> GenForeignPtr (ForeignPtr CVanillaSwap') CFixedVsFloatingSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CSwap' (AnyOf CFixedVsFloatingSwap' (ForeignPtr CVanillaSwap')))
  CInstrument'
-> GenForeignPtr
     (AnyOf CFixedVsFloatingSwap' (ForeignPtr CVanillaSwap')) CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CSwap' (AnyOf CFixedVsFloatingSwap' (ForeignPtr CVanillaSwap')))
   CInstrument'
 -> GenForeignPtr
      (AnyOf CFixedVsFloatingSwap' (ForeignPtr CVanillaSwap')) CSwap')
-> (VanillaSwap
    -> GenForeignPtr
         (AnyOf
            CSwap' (AnyOf CFixedVsFloatingSwap' (ForeignPtr CVanillaSwap')))
         CInstrument')
-> VanillaSwap
-> GenForeignPtr
     (AnyOf CFixedVsFloatingSwap' (ForeignPtr CVanillaSwap')) CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VanillaSwap
-> GenForeignPtr
     (AnyOf
        CSwap' (AnyOf CFixedVsFloatingSwap' (ForeignPtr CVanillaSwap')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

-- ConstNotionalCrossCurrencySwap sits between Swap and its two owned leaves
-- (ConstNotionalCrossCurrencyBasisSwap, ConstNotionalCrossCurrencyFixedVsFloatingSwap). It earns
-- its own family level (mirrors FixedVsFloatingSwap/VanillaSwap just above) because its own
-- getters (legCurrency, inCcyLegBps, inCcyLegNpv, npvDateDiscounts) are inherited by both leaves
-- and are bound generically over 'GenConstNotionalCrossCurrencySwap', while each leaf keeps its
-- own engine-dispatched getters (fairPaySpread/fairRecSpread, fairRate/fairSpread) reachable only
-- through the real leaf pointer. Unlike FixedVsFloatingSwap, the base class is concrete upstream
-- and hasquant binds its own 2-leg/N-leg constructors directly at this level.
data CConstNotionalCrossCurrencySwap'
type GenConstNotionalCrossCurrencySwap x = GenSwap (AnyOf CConstNotionalCrossCurrencySwap' x)
type CConstNotionalCrossCurrencySwap = ForeignPtr CConstNotionalCrossCurrencySwap'
-- |A 'Swap'; see the hierarchy under t'GenInstrument'.
type ConstNotionalCrossCurrencySwap = GenConstNotionalCrossCurrencySwap CConstNotionalCrossCurrencySwap
data CConstNotionalCrossCurrencyBasisSwap'
type CConstNotionalCrossCurrencyBasisSwap = ForeignPtr CConstNotionalCrossCurrencyBasisSwap'
-- |A 'ConstNotionalCrossCurrencySwap'; see the hierarchy under t'GenInstrument'.
type ConstNotionalCrossCurrencyBasisSwap = GenConstNotionalCrossCurrencySwap CConstNotionalCrossCurrencyBasisSwap
data CConstNotionalCrossCurrencyFixedVsFloatingSwap'
type CConstNotionalCrossCurrencyFixedVsFloatingSwap = ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
-- |A 'ConstNotionalCrossCurrencySwap'; see the hierarchy under t'GenInstrument'.
type ConstNotionalCrossCurrencyFixedVsFloatingSwap = GenConstNotionalCrossCurrencySwap CConstNotionalCrossCurrencyFixedVsFloatingSwap
foreign import ccall unsafe "ql.h &qlFreeConstNotionalCrossCurrencySwap" qlFreeConstNotionalCrossCurrencySwap :: FinalizerPtr CConstNotionalCrossCurrencySwap'
foreign import ccall unsafe "ql.h &qlFreeConstNotionalCrossCurrencyBasisSwap" qlFreeConstNotionalCrossCurrencyBasisSwap :: FinalizerPtr CConstNotionalCrossCurrencyBasisSwap'
foreign import ccall unsafe "ql.h &qlFreeConstNotionalCrossCurrencyFixedVsFloatingSwap" qlFreeConstNotionalCrossCurrencyFixedVsFloatingSwap :: FinalizerPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
instance Finalizable CConstNotionalCrossCurrencySwap' where finalize :: FinalizerPtr CConstNotionalCrossCurrencySwap'
finalize = FinalizerPtr CConstNotionalCrossCurrencySwap'
qlFreeConstNotionalCrossCurrencySwap
instance Finalizable CConstNotionalCrossCurrencyBasisSwap' where finalize :: FinalizerPtr CConstNotionalCrossCurrencyBasisSwap'
finalize = FinalizerPtr CConstNotionalCrossCurrencyBasisSwap'
qlFreeConstNotionalCrossCurrencyBasisSwap
instance Finalizable CConstNotionalCrossCurrencyFixedVsFloatingSwap' where finalize :: FinalizerPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
finalize = FinalizerPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
qlFreeConstNotionalCrossCurrencyFixedVsFloatingSwap
foreign import ccall "ql.h qlConstNotionalCrossCurrencySwapAsSwap" qlConstNotionalCrossCurrencySwapAsSwap :: Ptr CConstNotionalCrossCurrencySwap' -> IO (Ptr CSwap')
foreign import ccall "ql.h qlConstNotionalCrossCurrencyBasisSwapAsConstNotionalCrossCurrencySwap" qlConstNotionalCrossCurrencyBasisSwapAsConstNotionalCrossCurrencySwap :: Ptr CConstNotionalCrossCurrencyBasisSwap' -> IO (Ptr CConstNotionalCrossCurrencySwap')
foreign import ccall "ql.h qlConstNotionalCrossCurrencyFixedVsFloatingSwapAsConstNotionalCrossCurrencySwap" qlConstNotionalCrossCurrencyFixedVsFloatingSwapAsConstNotionalCrossCurrencySwap :: Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap' -> IO (Ptr CConstNotionalCrossCurrencySwap')
instance Upcastable CConstNotionalCrossCurrencySwap' where {type Base CConstNotionalCrossCurrencySwap' = CSwap'; upcast :: Ptr CConstNotionalCrossCurrencySwap'
-> IO (Ptr (Base CConstNotionalCrossCurrencySwap'))
upcast = Ptr CConstNotionalCrossCurrencySwap' -> IO (Ptr CSwap')
Ptr CConstNotionalCrossCurrencySwap'
-> IO (Ptr (Base CConstNotionalCrossCurrencySwap'))
qlConstNotionalCrossCurrencySwapAsSwap}
instance Upcastable CConstNotionalCrossCurrencyBasisSwap' where {type Base CConstNotionalCrossCurrencyBasisSwap' = CConstNotionalCrossCurrencySwap'; upcast :: Ptr CConstNotionalCrossCurrencyBasisSwap'
-> IO (Ptr (Base CConstNotionalCrossCurrencyBasisSwap'))
upcast = Ptr CConstNotionalCrossCurrencyBasisSwap'
-> IO (Ptr CConstNotionalCrossCurrencySwap')
Ptr CConstNotionalCrossCurrencyBasisSwap'
-> IO (Ptr (Base CConstNotionalCrossCurrencyBasisSwap'))
qlConstNotionalCrossCurrencyBasisSwapAsConstNotionalCrossCurrencySwap}
instance Upcastable CConstNotionalCrossCurrencyFixedVsFloatingSwap' where {type Base CConstNotionalCrossCurrencyFixedVsFloatingSwap' = CConstNotionalCrossCurrencySwap'; upcast :: Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
-> IO (Ptr (Base CConstNotionalCrossCurrencyFixedVsFloatingSwap'))
upcast = Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
-> IO (Ptr CConstNotionalCrossCurrencySwap')
Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
-> IO (Ptr (Base CConstNotionalCrossCurrencyFixedVsFloatingSwap'))
qlConstNotionalCrossCurrencyFixedVsFloatingSwapAsConstNotionalCrossCurrencySwap}
asConstNotionalCrossCurrencySwap :: GenConstNotionalCrossCurrencySwap x -> IO ConstNotionalCrossCurrencySwap
asConstNotionalCrossCurrencySwap :: forall x.
GenConstNotionalCrossCurrencySwap x
-> IO ConstNotionalCrossCurrencySwap
asConstNotionalCrossCurrencySwap = (Ptr CConstNotionalCrossCurrencySwap'
 -> IO ConstNotionalCrossCurrencySwap)
-> GenForeignPtr x CConstNotionalCrossCurrencySwap'
-> IO ConstNotionalCrossCurrencySwap
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CConstNotionalCrossCurrencySwap'
-> IO ConstNotionalCrossCurrencySwap
peekConstNotionalCrossCurrencySwap (GenForeignPtr x CConstNotionalCrossCurrencySwap'
 -> IO ConstNotionalCrossCurrencySwap)
-> (GenConstNotionalCrossCurrencySwap x
    -> GenForeignPtr x CConstNotionalCrossCurrencySwap')
-> GenConstNotionalCrossCurrencySwap x
-> IO ConstNotionalCrossCurrencySwap
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap'
-> GenForeignPtr x CConstNotionalCrossCurrencySwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap'
 -> GenForeignPtr x CConstNotionalCrossCurrencySwap')
-> (GenConstNotionalCrossCurrencySwap x
    -> GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap')
-> GenConstNotionalCrossCurrencySwap x
-> GenForeignPtr x CConstNotionalCrossCurrencySwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
  CInstrument'
-> GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
   CInstrument'
 -> GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap')
-> (GenConstNotionalCrossCurrencySwap x
    -> GenForeignPtr
         (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
         CInstrument')
-> GenConstNotionalCrossCurrencySwap x
-> GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenConstNotionalCrossCurrencySwap x
-> GenForeignPtr
     (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
peekConstNotionalCrossCurrencySwap :: Ptr CConstNotionalCrossCurrencySwap' -> IO ConstNotionalCrossCurrencySwap
peekConstNotionalCrossCurrencySwap :: Ptr CConstNotionalCrossCurrencySwap'
-> IO ConstNotionalCrossCurrencySwap
peekConstNotionalCrossCurrencySwap = Ptr CConstNotionalCrossCurrencySwap'
-> IO
     (GenForeignPtr
        (ForeignPtr CConstNotionalCrossCurrencySwap')
        CConstNotionalCrossCurrencySwap')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CConstNotionalCrossCurrencySwap'
 -> IO
      (GenForeignPtr
         (ForeignPtr CConstNotionalCrossCurrencySwap')
         CConstNotionalCrossCurrencySwap'))
-> (GenForeignPtr
      (ForeignPtr CConstNotionalCrossCurrencySwap')
      CConstNotionalCrossCurrencySwap'
    -> IO ConstNotionalCrossCurrencySwap)
-> Ptr CConstNotionalCrossCurrencySwap'
-> IO ConstNotionalCrossCurrencySwap
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CConstNotionalCrossCurrencySwap')
  CConstNotionalCrossCurrencySwap'
-> IO ConstNotionalCrossCurrencySwap
forall x.
GenForeignPtr x CConstNotionalCrossCurrencySwap'
-> IO (GenConstNotionalCrossCurrencySwap x)
newGenConstNotionalCrossCurrencySwap
withConstNotionalCrossCurrencySwap :: GenConstNotionalCrossCurrencySwap x -> (Ptr CConstNotionalCrossCurrencySwap' -> IO b) -> IO b
withConstNotionalCrossCurrencySwap :: forall x b.
GenConstNotionalCrossCurrencySwap x
-> (Ptr CConstNotionalCrossCurrencySwap' -> IO b) -> IO b
withConstNotionalCrossCurrencySwap = GenForeignPtr x CConstNotionalCrossCurrencySwap'
-> (Ptr CConstNotionalCrossCurrencySwap' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr x CConstNotionalCrossCurrencySwap'
 -> (Ptr CConstNotionalCrossCurrencySwap' -> IO b) -> IO b)
-> (GenConstNotionalCrossCurrencySwap x
    -> GenForeignPtr x CConstNotionalCrossCurrencySwap')
-> GenConstNotionalCrossCurrencySwap x
-> (Ptr CConstNotionalCrossCurrencySwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap'
-> GenForeignPtr x CConstNotionalCrossCurrencySwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap'
 -> GenForeignPtr x CConstNotionalCrossCurrencySwap')
-> (GenConstNotionalCrossCurrencySwap x
    -> GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap')
-> GenConstNotionalCrossCurrencySwap x
-> GenForeignPtr x CConstNotionalCrossCurrencySwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
  CInstrument'
-> GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
   CInstrument'
 -> GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap')
-> (GenConstNotionalCrossCurrencySwap x
    -> GenForeignPtr
         (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
         CInstrument')
-> GenConstNotionalCrossCurrencySwap x
-> GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenConstNotionalCrossCurrencySwap x
-> GenForeignPtr
     (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
newGenConstNotionalCrossCurrencySwap :: GenForeignPtr x CConstNotionalCrossCurrencySwap' -> IO (GenConstNotionalCrossCurrencySwap x)
newGenConstNotionalCrossCurrencySwap :: forall x.
GenForeignPtr x CConstNotionalCrossCurrencySwap'
-> IO (GenConstNotionalCrossCurrencySwap x)
newGenConstNotionalCrossCurrencySwap = GenConstNotionalCrossCurrencySwap x
-> IO (GenConstNotionalCrossCurrencySwap x)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenConstNotionalCrossCurrencySwap x
 -> IO (GenConstNotionalCrossCurrencySwap x))
-> (GenForeignPtr x CConstNotionalCrossCurrencySwap'
    -> GenConstNotionalCrossCurrencySwap x)
-> GenForeignPtr x CConstNotionalCrossCurrencySwap'
-> IO (GenConstNotionalCrossCurrencySwap x)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
  CInstrument'
-> GenConstNotionalCrossCurrencySwap x
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr
   (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
   CInstrument'
 -> GenConstNotionalCrossCurrencySwap x)
-> (GenForeignPtr x CConstNotionalCrossCurrencySwap'
    -> GenForeignPtr
         (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
         CInstrument')
-> GenForeignPtr x CConstNotionalCrossCurrencySwap'
-> GenConstNotionalCrossCurrencySwap x
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap'
-> GenForeignPtr
     (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
     CInstrument'
GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap'
-> GenForeignPtr
     (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
     (Base CSwap')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap'
 -> GenForeignPtr
      (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
      CInstrument')
-> (GenForeignPtr x CConstNotionalCrossCurrencySwap'
    -> GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap')
-> GenForeignPtr x CConstNotionalCrossCurrencySwap'
-> GenForeignPtr
     (AnyOf CSwap' (AnyOf CConstNotionalCrossCurrencySwap' x))
     CInstrument'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr x CConstNotionalCrossCurrencySwap'
-> GenForeignPtr (AnyOf CConstNotionalCrossCurrencySwap' x) CSwap'
GenForeignPtr x CConstNotionalCrossCurrencySwap'
-> GenForeignPtr
     (AnyOf CConstNotionalCrossCurrencySwap' x)
     (Base CConstNotionalCrossCurrencySwap')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
peekConstNotionalCrossCurrencyBasisSwap :: Ptr CConstNotionalCrossCurrencyBasisSwap' -> IO ConstNotionalCrossCurrencyBasisSwap
peekConstNotionalCrossCurrencyBasisSwap :: Ptr CConstNotionalCrossCurrencyBasisSwap'
-> IO ConstNotionalCrossCurrencyBasisSwap
peekConstNotionalCrossCurrencyBasisSwap = Ptr CConstNotionalCrossCurrencyBasisSwap'
-> IO
     (GenForeignPtr
        (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')
        CConstNotionalCrossCurrencySwap')
Ptr CConstNotionalCrossCurrencyBasisSwap'
-> IO
     (GenForeignPtr
        (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')
        (Base CConstNotionalCrossCurrencyBasisSwap'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CConstNotionalCrossCurrencyBasisSwap'
 -> IO
      (GenForeignPtr
         (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')
         CConstNotionalCrossCurrencySwap'))
-> (GenForeignPtr
      (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')
      CConstNotionalCrossCurrencySwap'
    -> IO ConstNotionalCrossCurrencyBasisSwap)
-> Ptr CConstNotionalCrossCurrencyBasisSwap'
-> IO ConstNotionalCrossCurrencyBasisSwap
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')
  CConstNotionalCrossCurrencySwap'
-> IO ConstNotionalCrossCurrencyBasisSwap
forall x.
GenForeignPtr x CConstNotionalCrossCurrencySwap'
-> IO (GenConstNotionalCrossCurrencySwap x)
newGenConstNotionalCrossCurrencySwap
withConstNotionalCrossCurrencyBasisSwap :: ConstNotionalCrossCurrencyBasisSwap -> (Ptr CConstNotionalCrossCurrencyBasisSwap' -> IO b) -> IO b
withConstNotionalCrossCurrencyBasisSwap :: forall b.
ConstNotionalCrossCurrencyBasisSwap
-> (Ptr CConstNotionalCrossCurrencyBasisSwap' -> IO b) -> IO b
withConstNotionalCrossCurrencyBasisSwap = ForeignPtr CConstNotionalCrossCurrencyBasisSwap'
-> (Ptr CConstNotionalCrossCurrencyBasisSwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CConstNotionalCrossCurrencyBasisSwap'
 -> (Ptr CConstNotionalCrossCurrencyBasisSwap' -> IO b) -> IO b)
-> (ConstNotionalCrossCurrencyBasisSwap
    -> ForeignPtr CConstNotionalCrossCurrencyBasisSwap')
-> ConstNotionalCrossCurrencyBasisSwap
-> (Ptr CConstNotionalCrossCurrencyBasisSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')
  CConstNotionalCrossCurrencySwap'
-> ForeignPtr CConstNotionalCrossCurrencyBasisSwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')
   CConstNotionalCrossCurrencySwap'
 -> ForeignPtr CConstNotionalCrossCurrencyBasisSwap')
-> (ConstNotionalCrossCurrencyBasisSwap
    -> GenForeignPtr
         (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')
         CConstNotionalCrossCurrencySwap')
-> ConstNotionalCrossCurrencyBasisSwap
-> ForeignPtr CConstNotionalCrossCurrencyBasisSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CConstNotionalCrossCurrencySwap'
     (ForeignPtr CConstNotionalCrossCurrencyBasisSwap'))
  CSwap'
-> GenForeignPtr
     (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')
     CConstNotionalCrossCurrencySwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CConstNotionalCrossCurrencySwap'
      (ForeignPtr CConstNotionalCrossCurrencyBasisSwap'))
   CSwap'
 -> GenForeignPtr
      (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')
      CConstNotionalCrossCurrencySwap')
-> (ConstNotionalCrossCurrencyBasisSwap
    -> GenForeignPtr
         (AnyOf
            CConstNotionalCrossCurrencySwap'
            (ForeignPtr CConstNotionalCrossCurrencyBasisSwap'))
         CSwap')
-> ConstNotionalCrossCurrencyBasisSwap
-> GenForeignPtr
     (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')
     CConstNotionalCrossCurrencySwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CSwap'
     (AnyOf
        CConstNotionalCrossCurrencySwap'
        (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')))
  CInstrument'
-> GenForeignPtr
     (AnyOf
        CConstNotionalCrossCurrencySwap'
        (ForeignPtr CConstNotionalCrossCurrencyBasisSwap'))
     CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CSwap'
      (AnyOf
         CConstNotionalCrossCurrencySwap'
         (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')))
   CInstrument'
 -> GenForeignPtr
      (AnyOf
         CConstNotionalCrossCurrencySwap'
         (ForeignPtr CConstNotionalCrossCurrencyBasisSwap'))
      CSwap')
-> (ConstNotionalCrossCurrencyBasisSwap
    -> GenForeignPtr
         (AnyOf
            CSwap'
            (AnyOf
               CConstNotionalCrossCurrencySwap'
               (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')))
         CInstrument')
-> ConstNotionalCrossCurrencyBasisSwap
-> GenForeignPtr
     (AnyOf
        CConstNotionalCrossCurrencySwap'
        (ForeignPtr CConstNotionalCrossCurrencyBasisSwap'))
     CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ConstNotionalCrossCurrencyBasisSwap
-> GenForeignPtr
     (AnyOf
        CSwap'
        (AnyOf
           CConstNotionalCrossCurrencySwap'
           (ForeignPtr CConstNotionalCrossCurrencyBasisSwap')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
peekConstNotionalCrossCurrencyFixedVsFloatingSwap :: Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap' -> IO ConstNotionalCrossCurrencyFixedVsFloatingSwap
peekConstNotionalCrossCurrencyFixedVsFloatingSwap :: Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
-> IO ConstNotionalCrossCurrencyFixedVsFloatingSwap
peekConstNotionalCrossCurrencyFixedVsFloatingSwap = Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
-> IO
     (GenForeignPtr
        (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')
        CConstNotionalCrossCurrencySwap')
Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
-> IO
     (GenForeignPtr
        (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')
        (Base CConstNotionalCrossCurrencyFixedVsFloatingSwap'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
 -> IO
      (GenForeignPtr
         (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')
         CConstNotionalCrossCurrencySwap'))
-> (GenForeignPtr
      (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')
      CConstNotionalCrossCurrencySwap'
    -> IO ConstNotionalCrossCurrencyFixedVsFloatingSwap)
-> Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
-> IO ConstNotionalCrossCurrencyFixedVsFloatingSwap
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')
  CConstNotionalCrossCurrencySwap'
-> IO ConstNotionalCrossCurrencyFixedVsFloatingSwap
forall x.
GenForeignPtr x CConstNotionalCrossCurrencySwap'
-> IO (GenConstNotionalCrossCurrencySwap x)
newGenConstNotionalCrossCurrencySwap
withConstNotionalCrossCurrencyFixedVsFloatingSwap :: ConstNotionalCrossCurrencyFixedVsFloatingSwap -> (Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap' -> IO b) -> IO b
withConstNotionalCrossCurrencyFixedVsFloatingSwap :: forall b.
ConstNotionalCrossCurrencyFixedVsFloatingSwap
-> (Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap' -> IO b)
-> IO b
withConstNotionalCrossCurrencyFixedVsFloatingSwap = ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
-> (Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap' -> IO b)
-> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
 -> (Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap' -> IO b)
 -> IO b)
-> (ConstNotionalCrossCurrencyFixedVsFloatingSwap
    -> ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')
-> ConstNotionalCrossCurrencyFixedVsFloatingSwap
-> (Ptr CConstNotionalCrossCurrencyFixedVsFloatingSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')
  CConstNotionalCrossCurrencySwap'
-> ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')
   CConstNotionalCrossCurrencySwap'
 -> ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')
-> (ConstNotionalCrossCurrencyFixedVsFloatingSwap
    -> GenForeignPtr
         (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')
         CConstNotionalCrossCurrencySwap')
-> ConstNotionalCrossCurrencyFixedVsFloatingSwap
-> ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CConstNotionalCrossCurrencySwap'
     (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap'))
  CSwap'
-> GenForeignPtr
     (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')
     CConstNotionalCrossCurrencySwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CConstNotionalCrossCurrencySwap'
      (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap'))
   CSwap'
 -> GenForeignPtr
      (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')
      CConstNotionalCrossCurrencySwap')
-> (ConstNotionalCrossCurrencyFixedVsFloatingSwap
    -> GenForeignPtr
         (AnyOf
            CConstNotionalCrossCurrencySwap'
            (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap'))
         CSwap')
-> ConstNotionalCrossCurrencyFixedVsFloatingSwap
-> GenForeignPtr
     (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')
     CConstNotionalCrossCurrencySwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CSwap'
     (AnyOf
        CConstNotionalCrossCurrencySwap'
        (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')))
  CInstrument'
-> GenForeignPtr
     (AnyOf
        CConstNotionalCrossCurrencySwap'
        (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap'))
     CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CSwap'
      (AnyOf
         CConstNotionalCrossCurrencySwap'
         (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')))
   CInstrument'
 -> GenForeignPtr
      (AnyOf
         CConstNotionalCrossCurrencySwap'
         (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap'))
      CSwap')
-> (ConstNotionalCrossCurrencyFixedVsFloatingSwap
    -> GenForeignPtr
         (AnyOf
            CSwap'
            (AnyOf
               CConstNotionalCrossCurrencySwap'
               (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')))
         CInstrument')
-> ConstNotionalCrossCurrencyFixedVsFloatingSwap
-> GenForeignPtr
     (AnyOf
        CConstNotionalCrossCurrencySwap'
        (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap'))
     CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ConstNotionalCrossCurrencyFixedVsFloatingSwap
-> GenForeignPtr
     (AnyOf
        CSwap'
        (AnyOf
           CConstNotionalCrossCurrencySwap'
           (ForeignPtr CConstNotionalCrossCurrencyFixedVsFloatingSwap')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CNonstandardSwap'
type CNonstandardSwap = ForeignPtr CNonstandardSwap'
-- |A 'Swap'; see the hierarchy under t'GenInstrument'.
type NonstandardSwap = GenSwap CNonstandardSwap
foreign import ccall unsafe "ql.h &qlFreeNonstandardSwap" qlFreeNonstandardSwap :: FinalizerPtr CNonstandardSwap'
instance Finalizable CNonstandardSwap' where finalize :: FinalizerPtr CNonstandardSwap'
finalize = FinalizerPtr CNonstandardSwap'
qlFreeNonstandardSwap
foreign import ccall "ql.h qlNonstandardSwapAsSwap" qlNonstandardSwapAsSwap :: Ptr CNonstandardSwap' -> IO (Ptr CSwap')
instance Upcastable CNonstandardSwap' where {type Base CNonstandardSwap' = CSwap'; upcast :: Ptr CNonstandardSwap' -> IO (Ptr (Base CNonstandardSwap'))
upcast = Ptr CNonstandardSwap' -> IO (Ptr CSwap')
Ptr CNonstandardSwap' -> IO (Ptr (Base CNonstandardSwap'))
qlNonstandardSwapAsSwap}
peekNonstandardSwap :: Ptr CNonstandardSwap' -> IO NonstandardSwap
peekNonstandardSwap :: Ptr CNonstandardSwap' -> IO NonstandardSwap
peekNonstandardSwap = Ptr CNonstandardSwap' -> IO NonstandardSwap
forall s.
(Finalizable s, Upcastable s, Base s ~ CSwap') =>
Ptr s -> IO (GenSwap (ForeignPtr s))
peekGenSwap
withNonstandardSwap :: NonstandardSwap -> (Ptr CNonstandardSwap' -> IO b) -> IO b
withNonstandardSwap :: forall b.
NonstandardSwap -> (Ptr CNonstandardSwap' -> IO b) -> IO b
withNonstandardSwap = ForeignPtr CNonstandardSwap'
-> (Ptr CNonstandardSwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CNonstandardSwap'
 -> (Ptr CNonstandardSwap' -> IO b) -> IO b)
-> (NonstandardSwap -> ForeignPtr CNonstandardSwap')
-> NonstandardSwap
-> (Ptr CNonstandardSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CNonstandardSwap') CSwap'
-> ForeignPtr CNonstandardSwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CNonstandardSwap') CSwap'
 -> ForeignPtr CNonstandardSwap')
-> (NonstandardSwap
    -> GenForeignPtr (ForeignPtr CNonstandardSwap') CSwap')
-> NonstandardSwap
-> ForeignPtr CNonstandardSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwap' (ForeignPtr CNonstandardSwap')) CInstrument'
-> GenForeignPtr (ForeignPtr CNonstandardSwap') CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CSwap' (ForeignPtr CNonstandardSwap')) CInstrument'
 -> GenForeignPtr (ForeignPtr CNonstandardSwap') CSwap')
-> (NonstandardSwap
    -> GenForeignPtr
         (AnyOf CSwap' (ForeignPtr CNonstandardSwap')) CInstrument')
-> NonstandardSwap
-> GenForeignPtr (ForeignPtr CNonstandardSwap') CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonstandardSwap
-> GenForeignPtr
     (AnyOf CSwap' (ForeignPtr CNonstandardSwap')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CFloatFloatSwap'
type CFloatFloatSwap = ForeignPtr CFloatFloatSwap'
-- |A 'Swap'; see the hierarchy under t'GenInstrument'.
type FloatFloatSwap = GenSwap CFloatFloatSwap
foreign import ccall unsafe "ql.h &qlFreeFloatFloatSwap" qlFreeFloatFloatSwap :: FinalizerPtr CFloatFloatSwap'
instance Finalizable CFloatFloatSwap' where finalize :: FinalizerPtr CFloatFloatSwap'
finalize = FinalizerPtr CFloatFloatSwap'
qlFreeFloatFloatSwap
foreign import ccall "ql.h qlFloatFloatSwapAsSwap" qlFloatFloatSwapAsSwap :: Ptr CFloatFloatSwap' -> IO (Ptr CSwap')
instance Upcastable CFloatFloatSwap' where {type Base CFloatFloatSwap' = CSwap'; upcast :: Ptr CFloatFloatSwap' -> IO (Ptr (Base CFloatFloatSwap'))
upcast = Ptr CFloatFloatSwap' -> IO (Ptr CSwap')
Ptr CFloatFloatSwap' -> IO (Ptr (Base CFloatFloatSwap'))
qlFloatFloatSwapAsSwap}
peekFloatFloatSwap :: Ptr CFloatFloatSwap' -> IO FloatFloatSwap
peekFloatFloatSwap :: Ptr CFloatFloatSwap' -> IO FloatFloatSwap
peekFloatFloatSwap = Ptr CFloatFloatSwap' -> IO FloatFloatSwap
forall s.
(Finalizable s, Upcastable s, Base s ~ CSwap') =>
Ptr s -> IO (GenSwap (ForeignPtr s))
peekGenSwap
withFloatFloatSwap :: FloatFloatSwap -> (Ptr CFloatFloatSwap' -> IO b) -> IO b
withFloatFloatSwap :: forall b. FloatFloatSwap -> (Ptr CFloatFloatSwap' -> IO b) -> IO b
withFloatFloatSwap = ForeignPtr CFloatFloatSwap'
-> (Ptr CFloatFloatSwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CFloatFloatSwap'
 -> (Ptr CFloatFloatSwap' -> IO b) -> IO b)
-> (FloatFloatSwap -> ForeignPtr CFloatFloatSwap')
-> FloatFloatSwap
-> (Ptr CFloatFloatSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CFloatFloatSwap') CSwap'
-> ForeignPtr CFloatFloatSwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CFloatFloatSwap') CSwap'
 -> ForeignPtr CFloatFloatSwap')
-> (FloatFloatSwap
    -> GenForeignPtr (ForeignPtr CFloatFloatSwap') CSwap')
-> FloatFloatSwap
-> ForeignPtr CFloatFloatSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwap' (ForeignPtr CFloatFloatSwap')) CInstrument'
-> GenForeignPtr (ForeignPtr CFloatFloatSwap') CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CSwap' (ForeignPtr CFloatFloatSwap')) CInstrument'
 -> GenForeignPtr (ForeignPtr CFloatFloatSwap') CSwap')
-> (FloatFloatSwap
    -> GenForeignPtr
         (AnyOf CSwap' (ForeignPtr CFloatFloatSwap')) CInstrument')
-> FloatFloatSwap
-> GenForeignPtr (ForeignPtr CFloatFloatSwap') CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FloatFloatSwap
-> GenForeignPtr
     (AnyOf CSwap' (ForeignPtr CFloatFloatSwap')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CAssetSwap'
type CAssetSwap = ForeignPtr CAssetSwap'
-- |A 'Swap'; see the hierarchy under t'GenInstrument'.
type AssetSwap = GenSwap CAssetSwap
foreign import ccall unsafe "ql.h &qlFreeAssetSwap" qlFreeAssetSwap :: FinalizerPtr CAssetSwap'
instance Finalizable CAssetSwap' where finalize :: FinalizerPtr CAssetSwap'
finalize = FinalizerPtr CAssetSwap'
qlFreeAssetSwap
foreign import ccall "ql.h qlAssetSwapAsSwap" qlAssetSwapAsSwap :: Ptr CAssetSwap' -> IO (Ptr CSwap')
instance Upcastable CAssetSwap' where {type Base CAssetSwap' = CSwap'; upcast :: Ptr CAssetSwap' -> IO (Ptr (Base CAssetSwap'))
upcast = Ptr CAssetSwap' -> IO (Ptr CSwap')
Ptr CAssetSwap' -> IO (Ptr (Base CAssetSwap'))
qlAssetSwapAsSwap}
peekAssetSwap :: Ptr CAssetSwap' -> IO AssetSwap
peekAssetSwap :: Ptr CAssetSwap' -> IO AssetSwap
peekAssetSwap = Ptr CAssetSwap' -> IO AssetSwap
forall s.
(Finalizable s, Upcastable s, Base s ~ CSwap') =>
Ptr s -> IO (GenSwap (ForeignPtr s))
peekGenSwap
withAssetSwap :: AssetSwap -> (Ptr CAssetSwap' -> IO b) -> IO b
withAssetSwap :: forall b. AssetSwap -> (Ptr CAssetSwap' -> IO b) -> IO b
withAssetSwap = ForeignPtr CAssetSwap' -> (Ptr CAssetSwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CAssetSwap' -> (Ptr CAssetSwap' -> IO b) -> IO b)
-> (AssetSwap -> ForeignPtr CAssetSwap')
-> AssetSwap
-> (Ptr CAssetSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CAssetSwap') CSwap'
-> ForeignPtr CAssetSwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CAssetSwap') CSwap'
 -> ForeignPtr CAssetSwap')
-> (AssetSwap -> GenForeignPtr (ForeignPtr CAssetSwap') CSwap')
-> AssetSwap
-> ForeignPtr CAssetSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CSwap' (ForeignPtr CAssetSwap')) CInstrument'
-> GenForeignPtr (ForeignPtr CAssetSwap') CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CSwap' (ForeignPtr CAssetSwap')) CInstrument'
 -> GenForeignPtr (ForeignPtr CAssetSwap') CSwap')
-> (AssetSwap
    -> GenForeignPtr
         (AnyOf CSwap' (ForeignPtr CAssetSwap')) CInstrument')
-> AssetSwap
-> GenForeignPtr (ForeignPtr CAssetSwap') CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AssetSwap
-> GenForeignPtr
     (AnyOf CSwap' (ForeignPtr CAssetSwap')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CBMASwap'
type CBMASwap = ForeignPtr CBMASwap'
-- |A 'Swap'; see the hierarchy under t'GenInstrument'.
type BMASwap = GenSwap CBMASwap
foreign import ccall unsafe "ql.h &qlFreeBMASwap" qlFreeBMASwap :: FinalizerPtr CBMASwap'
instance Finalizable CBMASwap' where finalize :: FinalizerPtr CBMASwap'
finalize = FinalizerPtr CBMASwap'
qlFreeBMASwap
foreign import ccall "ql.h qlBMASwapAsSwap" qlBMASwapAsSwap :: Ptr CBMASwap' -> IO (Ptr CSwap')
instance Upcastable CBMASwap' where {type Base CBMASwap' = CSwap'; upcast :: Ptr CBMASwap' -> IO (Ptr (Base CBMASwap'))
upcast = Ptr CBMASwap' -> IO (Ptr CSwap')
Ptr CBMASwap' -> IO (Ptr (Base CBMASwap'))
qlBMASwapAsSwap}
peekBMASwap :: Ptr CBMASwap' -> IO BMASwap
peekBMASwap :: Ptr CBMASwap' -> IO BMASwap
peekBMASwap = Ptr CBMASwap' -> IO BMASwap
forall s.
(Finalizable s, Upcastable s, Base s ~ CSwap') =>
Ptr s -> IO (GenSwap (ForeignPtr s))
peekGenSwap
withBMASwap :: BMASwap -> (Ptr CBMASwap' -> IO b) -> IO b
withBMASwap :: forall b. BMASwap -> (Ptr CBMASwap' -> IO b) -> IO b
withBMASwap = ForeignPtr CBMASwap' -> (Ptr CBMASwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CBMASwap' -> (Ptr CBMASwap' -> IO b) -> IO b)
-> (BMASwap -> ForeignPtr CBMASwap')
-> BMASwap
-> (Ptr CBMASwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CBMASwap') CSwap' -> ForeignPtr CBMASwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CBMASwap') CSwap'
 -> ForeignPtr CBMASwap')
-> (BMASwap -> GenForeignPtr (ForeignPtr CBMASwap') CSwap')
-> BMASwap
-> ForeignPtr CBMASwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CSwap' (ForeignPtr CBMASwap')) CInstrument'
-> GenForeignPtr (ForeignPtr CBMASwap') CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CSwap' (ForeignPtr CBMASwap')) CInstrument'
 -> GenForeignPtr (ForeignPtr CBMASwap') CSwap')
-> (BMASwap
    -> GenForeignPtr
         (AnyOf CSwap' (ForeignPtr CBMASwap')) CInstrument')
-> BMASwap
-> GenForeignPtr (ForeignPtr CBMASwap') CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BMASwap
-> GenForeignPtr (AnyOf CSwap' (ForeignPtr CBMASwap')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data COvernightIndexedSwap'
type COvernightIndexedSwap = ForeignPtr COvernightIndexedSwap'
-- |A 'Swap'; see the hierarchy under t'GenInstrument'.
type OvernightIndexedSwap = GenSwap COvernightIndexedSwap
foreign import ccall unsafe "ql.h &qlFreeOvernightIndexedSwap" qlFreeOvernightIndexedSwap :: FinalizerPtr COvernightIndexedSwap'
instance Finalizable COvernightIndexedSwap' where finalize :: FinalizerPtr COvernightIndexedSwap'
finalize = FinalizerPtr COvernightIndexedSwap'
qlFreeOvernightIndexedSwap
foreign import ccall "ql.h qlOvernightIndexedSwapAsSwap" qlOvernightIndexedSwapAsSwap :: Ptr COvernightIndexedSwap' -> IO (Ptr CSwap')
instance Upcastable COvernightIndexedSwap' where {type Base COvernightIndexedSwap' = CSwap'; upcast :: Ptr COvernightIndexedSwap'
-> IO (Ptr (Base COvernightIndexedSwap'))
upcast = Ptr COvernightIndexedSwap' -> IO (Ptr CSwap')
Ptr COvernightIndexedSwap'
-> IO (Ptr (Base COvernightIndexedSwap'))
qlOvernightIndexedSwapAsSwap}
peekOvernightIndexedSwap :: Ptr COvernightIndexedSwap' -> IO OvernightIndexedSwap
peekOvernightIndexedSwap :: Ptr COvernightIndexedSwap' -> IO OvernightIndexedSwap
peekOvernightIndexedSwap = Ptr COvernightIndexedSwap' -> IO OvernightIndexedSwap
forall s.
(Finalizable s, Upcastable s, Base s ~ CSwap') =>
Ptr s -> IO (GenSwap (ForeignPtr s))
peekGenSwap
withOvernightIndexedSwap :: OvernightIndexedSwap -> (Ptr COvernightIndexedSwap' -> IO b) -> IO b
withOvernightIndexedSwap :: forall b.
OvernightIndexedSwap
-> (Ptr COvernightIndexedSwap' -> IO b) -> IO b
withOvernightIndexedSwap = ForeignPtr COvernightIndexedSwap'
-> (Ptr COvernightIndexedSwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr COvernightIndexedSwap'
 -> (Ptr COvernightIndexedSwap' -> IO b) -> IO b)
-> (OvernightIndexedSwap -> ForeignPtr COvernightIndexedSwap')
-> OvernightIndexedSwap
-> (Ptr COvernightIndexedSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr COvernightIndexedSwap') CSwap'
-> ForeignPtr COvernightIndexedSwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr COvernightIndexedSwap') CSwap'
 -> ForeignPtr COvernightIndexedSwap')
-> (OvernightIndexedSwap
    -> GenForeignPtr (ForeignPtr COvernightIndexedSwap') CSwap')
-> OvernightIndexedSwap
-> ForeignPtr COvernightIndexedSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwap' (ForeignPtr COvernightIndexedSwap')) CInstrument'
-> GenForeignPtr (ForeignPtr COvernightIndexedSwap') CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CSwap' (ForeignPtr COvernightIndexedSwap')) CInstrument'
 -> GenForeignPtr (ForeignPtr COvernightIndexedSwap') CSwap')
-> (OvernightIndexedSwap
    -> GenForeignPtr
         (AnyOf CSwap' (ForeignPtr COvernightIndexedSwap')) CInstrument')
-> OvernightIndexedSwap
-> GenForeignPtr (ForeignPtr COvernightIndexedSwap') CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OvernightIndexedSwap
-> GenForeignPtr
     (AnyOf CSwap' (ForeignPtr COvernightIndexedSwap')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CZeroCouponInflationSwap'
type CZeroCouponInflationSwap = ForeignPtr CZeroCouponInflationSwap'
-- |A 'Swap'; see the hierarchy under t'GenInstrument'.
type ZeroCouponInflationSwap = GenSwap CZeroCouponInflationSwap
foreign import ccall unsafe "ql.h &qlFreeZeroCouponInflationSwap" qlFreeZeroCouponInflationSwap :: FinalizerPtr CZeroCouponInflationSwap'
instance Finalizable CZeroCouponInflationSwap' where finalize :: FinalizerPtr CZeroCouponInflationSwap'
finalize = FinalizerPtr CZeroCouponInflationSwap'
qlFreeZeroCouponInflationSwap
foreign import ccall "ql.h qlZeroCouponInflationSwapAsSwap" qlZeroCouponInflationSwapAsSwap :: Ptr CZeroCouponInflationSwap' -> IO (Ptr CSwap')
instance Upcastable CZeroCouponInflationSwap' where {type Base CZeroCouponInflationSwap' = CSwap'; upcast :: Ptr CZeroCouponInflationSwap'
-> IO (Ptr (Base CZeroCouponInflationSwap'))
upcast = Ptr CZeroCouponInflationSwap' -> IO (Ptr CSwap')
Ptr CZeroCouponInflationSwap'
-> IO (Ptr (Base CZeroCouponInflationSwap'))
qlZeroCouponInflationSwapAsSwap}
peekZeroCouponInflationSwap :: Ptr CZeroCouponInflationSwap' -> IO ZeroCouponInflationSwap
peekZeroCouponInflationSwap :: Ptr CZeroCouponInflationSwap' -> IO ZeroCouponInflationSwap
peekZeroCouponInflationSwap = Ptr CZeroCouponInflationSwap' -> IO ZeroCouponInflationSwap
forall s.
(Finalizable s, Upcastable s, Base s ~ CSwap') =>
Ptr s -> IO (GenSwap (ForeignPtr s))
peekGenSwap
withZeroCouponInflationSwap :: ZeroCouponInflationSwap -> (Ptr CZeroCouponInflationSwap' -> IO b) -> IO b
withZeroCouponInflationSwap :: forall b.
ZeroCouponInflationSwap
-> (Ptr CZeroCouponInflationSwap' -> IO b) -> IO b
withZeroCouponInflationSwap = ForeignPtr CZeroCouponInflationSwap'
-> (Ptr CZeroCouponInflationSwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CZeroCouponInflationSwap'
 -> (Ptr CZeroCouponInflationSwap' -> IO b) -> IO b)
-> (ZeroCouponInflationSwap
    -> ForeignPtr CZeroCouponInflationSwap')
-> ZeroCouponInflationSwap
-> (Ptr CZeroCouponInflationSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CZeroCouponInflationSwap') CSwap'
-> ForeignPtr CZeroCouponInflationSwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CZeroCouponInflationSwap') CSwap'
 -> ForeignPtr CZeroCouponInflationSwap')
-> (ZeroCouponInflationSwap
    -> GenForeignPtr (ForeignPtr CZeroCouponInflationSwap') CSwap')
-> ZeroCouponInflationSwap
-> ForeignPtr CZeroCouponInflationSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwap' (ForeignPtr CZeroCouponInflationSwap')) CInstrument'
-> GenForeignPtr (ForeignPtr CZeroCouponInflationSwap') CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CSwap' (ForeignPtr CZeroCouponInflationSwap')) CInstrument'
 -> GenForeignPtr (ForeignPtr CZeroCouponInflationSwap') CSwap')
-> (ZeroCouponInflationSwap
    -> GenForeignPtr
         (AnyOf CSwap' (ForeignPtr CZeroCouponInflationSwap')) CInstrument')
-> ZeroCouponInflationSwap
-> GenForeignPtr (ForeignPtr CZeroCouponInflationSwap') CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ZeroCouponInflationSwap
-> GenForeignPtr
     (AnyOf CSwap' (ForeignPtr CZeroCouponInflationSwap')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CYearOnYearInflationSwap'
type CYearOnYearInflationSwap = ForeignPtr CYearOnYearInflationSwap'
-- |A 'Swap'; see the hierarchy under t'GenInstrument'.
type YearOnYearInflationSwap = GenSwap CYearOnYearInflationSwap
foreign import ccall unsafe "ql.h &qlFreeYearOnYearInflationSwap" qlFreeYearOnYearInflationSwap :: FinalizerPtr CYearOnYearInflationSwap'
instance Finalizable CYearOnYearInflationSwap' where finalize :: FinalizerPtr CYearOnYearInflationSwap'
finalize = FinalizerPtr CYearOnYearInflationSwap'
qlFreeYearOnYearInflationSwap
foreign import ccall "ql.h qlYearOnYearInflationSwapAsSwap" qlYearOnYearInflationSwapAsSwap :: Ptr CYearOnYearInflationSwap' -> IO (Ptr CSwap')
instance Upcastable CYearOnYearInflationSwap' where {type Base CYearOnYearInflationSwap' = CSwap'; upcast :: Ptr CYearOnYearInflationSwap'
-> IO (Ptr (Base CYearOnYearInflationSwap'))
upcast = Ptr CYearOnYearInflationSwap' -> IO (Ptr CSwap')
Ptr CYearOnYearInflationSwap'
-> IO (Ptr (Base CYearOnYearInflationSwap'))
qlYearOnYearInflationSwapAsSwap}
peekYearOnYearInflationSwap :: Ptr CYearOnYearInflationSwap' -> IO YearOnYearInflationSwap
peekYearOnYearInflationSwap :: Ptr CYearOnYearInflationSwap' -> IO YearOnYearInflationSwap
peekYearOnYearInflationSwap = Ptr CYearOnYearInflationSwap' -> IO YearOnYearInflationSwap
forall s.
(Finalizable s, Upcastable s, Base s ~ CSwap') =>
Ptr s -> IO (GenSwap (ForeignPtr s))
peekGenSwap
withYearOnYearInflationSwap :: YearOnYearInflationSwap -> (Ptr CYearOnYearInflationSwap' -> IO b) -> IO b
withYearOnYearInflationSwap :: forall b.
YearOnYearInflationSwap
-> (Ptr CYearOnYearInflationSwap' -> IO b) -> IO b
withYearOnYearInflationSwap = ForeignPtr CYearOnYearInflationSwap'
-> (Ptr CYearOnYearInflationSwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CYearOnYearInflationSwap'
 -> (Ptr CYearOnYearInflationSwap' -> IO b) -> IO b)
-> (YearOnYearInflationSwap
    -> ForeignPtr CYearOnYearInflationSwap')
-> YearOnYearInflationSwap
-> (Ptr CYearOnYearInflationSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CYearOnYearInflationSwap') CSwap'
-> ForeignPtr CYearOnYearInflationSwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CYearOnYearInflationSwap') CSwap'
 -> ForeignPtr CYearOnYearInflationSwap')
-> (YearOnYearInflationSwap
    -> GenForeignPtr (ForeignPtr CYearOnYearInflationSwap') CSwap')
-> YearOnYearInflationSwap
-> ForeignPtr CYearOnYearInflationSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwap' (ForeignPtr CYearOnYearInflationSwap')) CInstrument'
-> GenForeignPtr (ForeignPtr CYearOnYearInflationSwap') CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CSwap' (ForeignPtr CYearOnYearInflationSwap')) CInstrument'
 -> GenForeignPtr (ForeignPtr CYearOnYearInflationSwap') CSwap')
-> (YearOnYearInflationSwap
    -> GenForeignPtr
         (AnyOf CSwap' (ForeignPtr CYearOnYearInflationSwap')) CInstrument')
-> YearOnYearInflationSwap
-> GenForeignPtr (ForeignPtr CYearOnYearInflationSwap') CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. YearOnYearInflationSwap
-> GenForeignPtr
     (AnyOf CSwap' (ForeignPtr CYearOnYearInflationSwap')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CCPISwap'
type CCPISwap = ForeignPtr CCPISwap'
-- |A 'Swap'; see the hierarchy under t'GenInstrument'.
type CPISwap = GenSwap CCPISwap
foreign import ccall unsafe "ql.h &qlFreeCPISwap" qlFreeCPISwap :: FinalizerPtr CCPISwap'
instance Finalizable CCPISwap' where finalize :: FinalizerPtr CCPISwap'
finalize = FinalizerPtr CCPISwap'
qlFreeCPISwap
foreign import ccall "ql.h qlCPISwapAsSwap" qlCPISwapAsSwap :: Ptr CCPISwap' -> IO (Ptr CSwap')
instance Upcastable CCPISwap' where {type Base CCPISwap' = CSwap'; upcast :: Ptr CCPISwap' -> IO (Ptr (Base CCPISwap'))
upcast = Ptr CCPISwap' -> IO (Ptr CSwap')
Ptr CCPISwap' -> IO (Ptr (Base CCPISwap'))
qlCPISwapAsSwap}
peekCPISwap :: Ptr CCPISwap' -> IO CPISwap
peekCPISwap :: Ptr CCPISwap' -> IO CPISwap
peekCPISwap = Ptr CCPISwap' -> IO CPISwap
forall s.
(Finalizable s, Upcastable s, Base s ~ CSwap') =>
Ptr s -> IO (GenSwap (ForeignPtr s))
peekGenSwap
withCPISwap :: CPISwap -> (Ptr CCPISwap' -> IO b) -> IO b
withCPISwap :: forall b. CPISwap -> (Ptr CCPISwap' -> IO b) -> IO b
withCPISwap = ForeignPtr CCPISwap' -> (Ptr CCPISwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CCPISwap' -> (Ptr CCPISwap' -> IO b) -> IO b)
-> (CPISwap -> ForeignPtr CCPISwap')
-> CPISwap
-> (Ptr CCPISwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CCPISwap') CSwap' -> ForeignPtr CCPISwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CCPISwap') CSwap'
 -> ForeignPtr CCPISwap')
-> (CPISwap -> GenForeignPtr (ForeignPtr CCPISwap') CSwap')
-> CPISwap
-> ForeignPtr CCPISwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CSwap' (ForeignPtr CCPISwap')) CInstrument'
-> GenForeignPtr (ForeignPtr CCPISwap') CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CSwap' (ForeignPtr CCPISwap')) CInstrument'
 -> GenForeignPtr (ForeignPtr CCPISwap') CSwap')
-> (CPISwap
    -> GenForeignPtr
         (AnyOf CSwap' (ForeignPtr CCPISwap')) CInstrument')
-> CPISwap
-> GenForeignPtr (ForeignPtr CCPISwap') CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CPISwap
-> GenForeignPtr (AnyOf CSwap' (ForeignPtr CCPISwap')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CZeroCouponSwap'
type CZeroCouponSwap = ForeignPtr CZeroCouponSwap'
-- |A 'Swap'; see the hierarchy under t'GenInstrument'.
type ZeroCouponSwap = GenSwap CZeroCouponSwap
foreign import ccall unsafe "ql.h &qlFreeZeroCouponSwap" qlFreeZeroCouponSwap :: FinalizerPtr CZeroCouponSwap'
instance Finalizable CZeroCouponSwap' where finalize :: FinalizerPtr CZeroCouponSwap'
finalize = FinalizerPtr CZeroCouponSwap'
qlFreeZeroCouponSwap
foreign import ccall "ql.h qlZeroCouponSwapAsSwap" qlZeroCouponSwapAsSwap :: Ptr CZeroCouponSwap' -> IO (Ptr CSwap')
instance Upcastable CZeroCouponSwap' where {type Base CZeroCouponSwap' = CSwap'; upcast :: Ptr CZeroCouponSwap' -> IO (Ptr (Base CZeroCouponSwap'))
upcast = Ptr CZeroCouponSwap' -> IO (Ptr CSwap')
Ptr CZeroCouponSwap' -> IO (Ptr (Base CZeroCouponSwap'))
qlZeroCouponSwapAsSwap}
peekZeroCouponSwap :: Ptr CZeroCouponSwap' -> IO ZeroCouponSwap
peekZeroCouponSwap :: Ptr CZeroCouponSwap' -> IO ZeroCouponSwap
peekZeroCouponSwap = Ptr CZeroCouponSwap' -> IO ZeroCouponSwap
forall s.
(Finalizable s, Upcastable s, Base s ~ CSwap') =>
Ptr s -> IO (GenSwap (ForeignPtr s))
peekGenSwap
withZeroCouponSwap :: ZeroCouponSwap -> (Ptr CZeroCouponSwap' -> IO b) -> IO b
withZeroCouponSwap :: forall b. ZeroCouponSwap -> (Ptr CZeroCouponSwap' -> IO b) -> IO b
withZeroCouponSwap = ForeignPtr CZeroCouponSwap'
-> (Ptr CZeroCouponSwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CZeroCouponSwap'
 -> (Ptr CZeroCouponSwap' -> IO b) -> IO b)
-> (ZeroCouponSwap -> ForeignPtr CZeroCouponSwap')
-> ZeroCouponSwap
-> (Ptr CZeroCouponSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CZeroCouponSwap') CSwap'
-> ForeignPtr CZeroCouponSwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CZeroCouponSwap') CSwap'
 -> ForeignPtr CZeroCouponSwap')
-> (ZeroCouponSwap
    -> GenForeignPtr (ForeignPtr CZeroCouponSwap') CSwap')
-> ZeroCouponSwap
-> ForeignPtr CZeroCouponSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwap' (ForeignPtr CZeroCouponSwap')) CInstrument'
-> GenForeignPtr (ForeignPtr CZeroCouponSwap') CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CSwap' (ForeignPtr CZeroCouponSwap')) CInstrument'
 -> GenForeignPtr (ForeignPtr CZeroCouponSwap') CSwap')
-> (ZeroCouponSwap
    -> GenForeignPtr
         (AnyOf CSwap' (ForeignPtr CZeroCouponSwap')) CInstrument')
-> ZeroCouponSwap
-> GenForeignPtr (ForeignPtr CZeroCouponSwap') CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ZeroCouponSwap
-> GenForeignPtr
     (AnyOf CSwap' (ForeignPtr CZeroCouponSwap')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CEquityTotalReturnSwap'
type CEquityTotalReturnSwap = ForeignPtr CEquityTotalReturnSwap'
-- |A 'Swap'; see the hierarchy under t'GenInstrument'.
type EquityTotalReturnSwap = GenSwap CEquityTotalReturnSwap
foreign import ccall unsafe "ql.h &qlFreeEquityTotalReturnSwap" qlFreeEquityTotalReturnSwap :: FinalizerPtr CEquityTotalReturnSwap'
instance Finalizable CEquityTotalReturnSwap' where finalize :: FinalizerPtr CEquityTotalReturnSwap'
finalize = FinalizerPtr CEquityTotalReturnSwap'
qlFreeEquityTotalReturnSwap
foreign import ccall "ql.h qlEquityTotalReturnSwapAsSwap" qlEquityTotalReturnSwapAsSwap :: Ptr CEquityTotalReturnSwap' -> IO (Ptr CSwap')
instance Upcastable CEquityTotalReturnSwap' where {type Base CEquityTotalReturnSwap' = CSwap'; upcast :: Ptr CEquityTotalReturnSwap'
-> IO (Ptr (Base CEquityTotalReturnSwap'))
upcast = Ptr CEquityTotalReturnSwap' -> IO (Ptr CSwap')
Ptr CEquityTotalReturnSwap'
-> IO (Ptr (Base CEquityTotalReturnSwap'))
qlEquityTotalReturnSwapAsSwap}
peekEquityTotalReturnSwap :: Ptr CEquityTotalReturnSwap' -> IO EquityTotalReturnSwap
peekEquityTotalReturnSwap :: Ptr CEquityTotalReturnSwap' -> IO EquityTotalReturnSwap
peekEquityTotalReturnSwap = Ptr CEquityTotalReturnSwap' -> IO EquityTotalReturnSwap
forall s.
(Finalizable s, Upcastable s, Base s ~ CSwap') =>
Ptr s -> IO (GenSwap (ForeignPtr s))
peekGenSwap
withEquityTotalReturnSwap :: EquityTotalReturnSwap -> (Ptr CEquityTotalReturnSwap' -> IO b) -> IO b
withEquityTotalReturnSwap :: forall b.
EquityTotalReturnSwap
-> (Ptr CEquityTotalReturnSwap' -> IO b) -> IO b
withEquityTotalReturnSwap = ForeignPtr CEquityTotalReturnSwap'
-> (Ptr CEquityTotalReturnSwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CEquityTotalReturnSwap'
 -> (Ptr CEquityTotalReturnSwap' -> IO b) -> IO b)
-> (EquityTotalReturnSwap -> ForeignPtr CEquityTotalReturnSwap')
-> EquityTotalReturnSwap
-> (Ptr CEquityTotalReturnSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CEquityTotalReturnSwap') CSwap'
-> ForeignPtr CEquityTotalReturnSwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CEquityTotalReturnSwap') CSwap'
 -> ForeignPtr CEquityTotalReturnSwap')
-> (EquityTotalReturnSwap
    -> GenForeignPtr (ForeignPtr CEquityTotalReturnSwap') CSwap')
-> EquityTotalReturnSwap
-> ForeignPtr CEquityTotalReturnSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CSwap' (ForeignPtr CEquityTotalReturnSwap')) CInstrument'
-> GenForeignPtr (ForeignPtr CEquityTotalReturnSwap') CSwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CSwap' (ForeignPtr CEquityTotalReturnSwap')) CInstrument'
 -> GenForeignPtr (ForeignPtr CEquityTotalReturnSwap') CSwap')
-> (EquityTotalReturnSwap
    -> GenForeignPtr
         (AnyOf CSwap' (ForeignPtr CEquityTotalReturnSwap')) CInstrument')
-> EquityTotalReturnSwap
-> GenForeignPtr (ForeignPtr CEquityTotalReturnSwap') CSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EquityTotalReturnSwap
-> GenForeignPtr
     (AnyOf CSwap' (ForeignPtr CEquityTotalReturnSwap')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CCdsOption'
type CCdsOption = ForeignPtr CCdsOption'
-- |An 'Option'; see the hierarchy under t'GenInstrument'.
type CdsOption = GenOption CCdsOption
foreign import ccall unsafe "ql.h &qlFreeCdsOption" qlFreeCdsOption :: FinalizerPtr CCdsOption'
instance Finalizable CCdsOption' where finalize :: FinalizerPtr CCdsOption'
finalize = FinalizerPtr CCdsOption'
qlFreeCdsOption
foreign import ccall "ql.h qlCdsOptionAsOption" qlCdsOptionAsOption :: Ptr CCdsOption' -> IO (Ptr COption')
instance Upcastable CCdsOption' where {type Base CCdsOption' = COption'; upcast :: Ptr CCdsOption' -> IO (Ptr (Base CCdsOption'))
upcast = Ptr CCdsOption' -> IO (Ptr COption')
Ptr CCdsOption' -> IO (Ptr (Base CCdsOption'))
qlCdsOptionAsOption}
peekCdsOption :: Ptr CCdsOption' -> IO CdsOption
peekCdsOption :: Ptr CCdsOption' -> IO CdsOption
peekCdsOption = Ptr CCdsOption' -> IO CdsOption
forall o.
(Finalizable o, Upcastable o, Base o ~ COption') =>
Ptr o -> IO (GenOption (ForeignPtr o))
peekGenOption
withCdsOption :: CdsOption -> (Ptr CCdsOption' -> IO b) -> IO b
withCdsOption :: forall b. CdsOption -> (Ptr CCdsOption' -> IO b) -> IO b
withCdsOption = ForeignPtr CCdsOption' -> (Ptr CCdsOption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CCdsOption' -> (Ptr CCdsOption' -> IO b) -> IO b)
-> (CdsOption -> ForeignPtr CCdsOption')
-> CdsOption
-> (Ptr CCdsOption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CCdsOption') COption'
-> ForeignPtr CCdsOption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CCdsOption') COption'
 -> ForeignPtr CCdsOption')
-> (CdsOption -> GenForeignPtr (ForeignPtr CCdsOption') COption')
-> CdsOption
-> ForeignPtr CCdsOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COption' (ForeignPtr CCdsOption')) CInstrument'
-> GenForeignPtr (ForeignPtr CCdsOption') COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COption' (ForeignPtr CCdsOption')) CInstrument'
 -> GenForeignPtr (ForeignPtr CCdsOption') COption')
-> (CdsOption
    -> GenForeignPtr
         (AnyOf COption' (ForeignPtr CCdsOption')) CInstrument')
-> CdsOption
-> GenForeignPtr (ForeignPtr CCdsOption') COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CdsOption
-> GenForeignPtr
     (AnyOf COption' (ForeignPtr CCdsOption')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CSwaption'
type CSwaption = ForeignPtr CSwaption'
-- |An 'Option'; see the hierarchy under t'GenInstrument'.
type Swaption = GenOption CSwaption
foreign import ccall unsafe "ql.h &qlFreeSwaption" qlFreeSwaption :: FinalizerPtr CSwaption'
instance Finalizable CSwaption' where finalize :: FinalizerPtr CSwaption'
finalize = FinalizerPtr CSwaption'
qlFreeSwaption
foreign import ccall "ql.h qlSwaptionAsOption" qlSwaptionAsOption :: Ptr CSwaption' -> IO (Ptr COption')
instance Upcastable CSwaption' where {type Base CSwaption' = COption'; upcast :: Ptr CSwaption' -> IO (Ptr (Base CSwaption'))
upcast = Ptr CSwaption' -> IO (Ptr COption')
Ptr CSwaption' -> IO (Ptr (Base CSwaption'))
qlSwaptionAsOption}
peekSwaption :: Ptr CSwaption' -> IO Swaption
peekSwaption :: Ptr CSwaption' -> IO Swaption
peekSwaption = Ptr CSwaption' -> IO Swaption
forall o.
(Finalizable o, Upcastable o, Base o ~ COption') =>
Ptr o -> IO (GenOption (ForeignPtr o))
peekGenOption
withSwaption :: Swaption -> (Ptr CSwaption' -> IO b) -> IO b
withSwaption :: forall b. Swaption -> (Ptr CSwaption' -> IO b) -> IO b
withSwaption = ForeignPtr CSwaption' -> (Ptr CSwaption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CSwaption' -> (Ptr CSwaption' -> IO b) -> IO b)
-> (Swaption -> ForeignPtr CSwaption')
-> Swaption
-> (Ptr CSwaption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CSwaption') COption'
-> ForeignPtr CSwaption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CSwaption') COption'
 -> ForeignPtr CSwaption')
-> (Swaption -> GenForeignPtr (ForeignPtr CSwaption') COption')
-> Swaption
-> ForeignPtr CSwaption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf COption' (ForeignPtr CSwaption')) CInstrument'
-> GenForeignPtr (ForeignPtr CSwaption') COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COption' (ForeignPtr CSwaption')) CInstrument'
 -> GenForeignPtr (ForeignPtr CSwaption') COption')
-> (Swaption
    -> GenForeignPtr
         (AnyOf COption' (ForeignPtr CSwaption')) CInstrument')
-> Swaption
-> GenForeignPtr (ForeignPtr CSwaption') COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Swaption
-> GenForeignPtr
     (AnyOf COption' (ForeignPtr CSwaption')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CIrregularSwaption'
type CIrregularSwaption = ForeignPtr CIrregularSwaption'
-- |An 'Option'; see the hierarchy under t'GenInstrument'.
type IrregularSwaption = GenOption CIrregularSwaption
foreign import ccall unsafe "ql.h &qlFreeIrregularSwaption" qlFreeIrregularSwaption :: FinalizerPtr CIrregularSwaption'
instance Finalizable CIrregularSwaption' where finalize :: FinalizerPtr CIrregularSwaption'
finalize = FinalizerPtr CIrregularSwaption'
qlFreeIrregularSwaption
foreign import ccall "ql.h qlIrregularSwaptionAsOption" qlIrregularSwaptionAsOption :: Ptr CIrregularSwaption' -> IO (Ptr COption')
instance Upcastable CIrregularSwaption' where {type Base CIrregularSwaption' = COption'; upcast :: Ptr CIrregularSwaption' -> IO (Ptr (Base CIrregularSwaption'))
upcast = Ptr CIrregularSwaption' -> IO (Ptr COption')
Ptr CIrregularSwaption' -> IO (Ptr (Base CIrregularSwaption'))
qlIrregularSwaptionAsOption}
peekIrregularSwaption :: Ptr CIrregularSwaption' -> IO IrregularSwaption
peekIrregularSwaption :: Ptr CIrregularSwaption' -> IO IrregularSwaption
peekIrregularSwaption = Ptr CIrregularSwaption' -> IO IrregularSwaption
forall o.
(Finalizable o, Upcastable o, Base o ~ COption') =>
Ptr o -> IO (GenOption (ForeignPtr o))
peekGenOption
withIrregularSwaption :: IrregularSwaption -> (Ptr CIrregularSwaption' -> IO b) -> IO b
withIrregularSwaption :: forall b.
IrregularSwaption -> (Ptr CIrregularSwaption' -> IO b) -> IO b
withIrregularSwaption = ForeignPtr CIrregularSwaption'
-> (Ptr CIrregularSwaption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CIrregularSwaption'
 -> (Ptr CIrregularSwaption' -> IO b) -> IO b)
-> (IrregularSwaption -> ForeignPtr CIrregularSwaption')
-> IrregularSwaption
-> (Ptr CIrregularSwaption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CIrregularSwaption') COption'
-> ForeignPtr CIrregularSwaption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CIrregularSwaption') COption'
 -> ForeignPtr CIrregularSwaption')
-> (IrregularSwaption
    -> GenForeignPtr (ForeignPtr CIrregularSwaption') COption')
-> IrregularSwaption
-> ForeignPtr CIrregularSwaption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COption' (ForeignPtr CIrregularSwaption')) CInstrument'
-> GenForeignPtr (ForeignPtr CIrregularSwaption') COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COption' (ForeignPtr CIrregularSwaption')) CInstrument'
 -> GenForeignPtr (ForeignPtr CIrregularSwaption') COption')
-> (IrregularSwaption
    -> GenForeignPtr
         (AnyOf COption' (ForeignPtr CIrregularSwaption')) CInstrument')
-> IrregularSwaption
-> GenForeignPtr (ForeignPtr CIrregularSwaption') COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IrregularSwaption
-> GenForeignPtr
     (AnyOf COption' (ForeignPtr CIrregularSwaption')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CNonstandardSwaption'
type CNonstandardSwaption = ForeignPtr CNonstandardSwaption'
-- |An 'Option'; see the hierarchy under t'GenInstrument'.
type NonstandardSwaption = GenOption CNonstandardSwaption
foreign import ccall unsafe "ql.h &qlFreeNonstandardSwaption" qlFreeNonstandardSwaption :: FinalizerPtr CNonstandardSwaption'
instance Finalizable CNonstandardSwaption' where finalize :: FinalizerPtr CNonstandardSwaption'
finalize = FinalizerPtr CNonstandardSwaption'
qlFreeNonstandardSwaption
foreign import ccall "ql.h qlNonstandardSwaptionAsOption" qlNonstandardSwaptionAsOption :: Ptr CNonstandardSwaption' -> IO (Ptr COption')
instance Upcastable CNonstandardSwaption' where {type Base CNonstandardSwaption' = COption'; upcast :: Ptr CNonstandardSwaption' -> IO (Ptr (Base CNonstandardSwaption'))
upcast = Ptr CNonstandardSwaption' -> IO (Ptr COption')
Ptr CNonstandardSwaption' -> IO (Ptr (Base CNonstandardSwaption'))
qlNonstandardSwaptionAsOption}
peekNonstandardSwaption :: Ptr CNonstandardSwaption' -> IO NonstandardSwaption
peekNonstandardSwaption :: Ptr CNonstandardSwaption' -> IO NonstandardSwaption
peekNonstandardSwaption = Ptr CNonstandardSwaption' -> IO NonstandardSwaption
forall o.
(Finalizable o, Upcastable o, Base o ~ COption') =>
Ptr o -> IO (GenOption (ForeignPtr o))
peekGenOption
withNonstandardSwaption :: NonstandardSwaption -> (Ptr CNonstandardSwaption' -> IO b) -> IO b
withNonstandardSwaption :: forall b.
NonstandardSwaption -> (Ptr CNonstandardSwaption' -> IO b) -> IO b
withNonstandardSwaption = ForeignPtr CNonstandardSwaption'
-> (Ptr CNonstandardSwaption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CNonstandardSwaption'
 -> (Ptr CNonstandardSwaption' -> IO b) -> IO b)
-> (NonstandardSwaption -> ForeignPtr CNonstandardSwaption')
-> NonstandardSwaption
-> (Ptr CNonstandardSwaption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CNonstandardSwaption') COption'
-> ForeignPtr CNonstandardSwaption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CNonstandardSwaption') COption'
 -> ForeignPtr CNonstandardSwaption')
-> (NonstandardSwaption
    -> GenForeignPtr (ForeignPtr CNonstandardSwaption') COption')
-> NonstandardSwaption
-> ForeignPtr CNonstandardSwaption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COption' (ForeignPtr CNonstandardSwaption')) CInstrument'
-> GenForeignPtr (ForeignPtr CNonstandardSwaption') COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COption' (ForeignPtr CNonstandardSwaption')) CInstrument'
 -> GenForeignPtr (ForeignPtr CNonstandardSwaption') COption')
-> (NonstandardSwaption
    -> GenForeignPtr
         (AnyOf COption' (ForeignPtr CNonstandardSwaption')) CInstrument')
-> NonstandardSwaption
-> GenForeignPtr (ForeignPtr CNonstandardSwaption') COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonstandardSwaption
-> GenForeignPtr
     (AnyOf COption' (ForeignPtr CNonstandardSwaption')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CFloatFloatSwaption'
type CFloatFloatSwaption = ForeignPtr CFloatFloatSwaption'
-- |An 'Option'; see the hierarchy under t'GenInstrument'.
type FloatFloatSwaption = GenOption CFloatFloatSwaption
foreign import ccall unsafe "ql.h &qlFreeFloatFloatSwaption" qlFreeFloatFloatSwaption :: FinalizerPtr CFloatFloatSwaption'
instance Finalizable CFloatFloatSwaption' where finalize :: FinalizerPtr CFloatFloatSwaption'
finalize = FinalizerPtr CFloatFloatSwaption'
qlFreeFloatFloatSwaption
foreign import ccall "ql.h qlFloatFloatSwaptionAsOption" qlFloatFloatSwaptionAsOption :: Ptr CFloatFloatSwaption' -> IO (Ptr COption')
instance Upcastable CFloatFloatSwaption' where {type Base CFloatFloatSwaption' = COption'; upcast :: Ptr CFloatFloatSwaption' -> IO (Ptr (Base CFloatFloatSwaption'))
upcast = Ptr CFloatFloatSwaption' -> IO (Ptr COption')
Ptr CFloatFloatSwaption' -> IO (Ptr (Base CFloatFloatSwaption'))
qlFloatFloatSwaptionAsOption}
peekFloatFloatSwaption :: Ptr CFloatFloatSwaption' -> IO FloatFloatSwaption
peekFloatFloatSwaption :: Ptr CFloatFloatSwaption' -> IO FloatFloatSwaption
peekFloatFloatSwaption = Ptr CFloatFloatSwaption' -> IO FloatFloatSwaption
forall o.
(Finalizable o, Upcastable o, Base o ~ COption') =>
Ptr o -> IO (GenOption (ForeignPtr o))
peekGenOption
withFloatFloatSwaption :: FloatFloatSwaption -> (Ptr CFloatFloatSwaption' -> IO b) -> IO b
withFloatFloatSwaption :: forall b.
FloatFloatSwaption -> (Ptr CFloatFloatSwaption' -> IO b) -> IO b
withFloatFloatSwaption = ForeignPtr CFloatFloatSwaption'
-> (Ptr CFloatFloatSwaption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CFloatFloatSwaption'
 -> (Ptr CFloatFloatSwaption' -> IO b) -> IO b)
-> (FloatFloatSwaption -> ForeignPtr CFloatFloatSwaption')
-> FloatFloatSwaption
-> (Ptr CFloatFloatSwaption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CFloatFloatSwaption') COption'
-> ForeignPtr CFloatFloatSwaption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CFloatFloatSwaption') COption'
 -> ForeignPtr CFloatFloatSwaption')
-> (FloatFloatSwaption
    -> GenForeignPtr (ForeignPtr CFloatFloatSwaption') COption')
-> FloatFloatSwaption
-> ForeignPtr CFloatFloatSwaption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COption' (ForeignPtr CFloatFloatSwaption')) CInstrument'
-> GenForeignPtr (ForeignPtr CFloatFloatSwaption') COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COption' (ForeignPtr CFloatFloatSwaption')) CInstrument'
 -> GenForeignPtr (ForeignPtr CFloatFloatSwaption') COption')
-> (FloatFloatSwaption
    -> GenForeignPtr
         (AnyOf COption' (ForeignPtr CFloatFloatSwaption')) CInstrument')
-> FloatFloatSwaption
-> GenForeignPtr (ForeignPtr CFloatFloatSwaption') COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FloatFloatSwaption
-> GenForeignPtr
     (AnyOf COption' (ForeignPtr CFloatFloatSwaption')) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CMultiAssetOption'
data CMargrabeOption'
data CEverestOption'
type GenMultiAssetOption mo = GenOption (AnyOf CMultiAssetOption' mo)
type CMultiAssetOption = ForeignPtr CMultiAssetOption'
-- |An 'Option'; see the hierarchy under t'GenInstrument'.
type MultiAssetOption = GenMultiAssetOption CMultiAssetOption
type CMargrabeOption = ForeignPtr CMargrabeOption'
-- |A 'MultiAssetOption'; see the hierarchy under t'GenInstrument'.
type MargrabeOption = GenMultiAssetOption CMargrabeOption
type CEverestOption = ForeignPtr CEverestOption'
-- |A 'MultiAssetOption'; see the hierarchy under t'GenInstrument'.
type EverestOption = GenMultiAssetOption CEverestOption
foreign import ccall unsafe "ql.h &qlFreeMultiAssetOption" qlFreeMultiAssetOption :: FinalizerPtr CMultiAssetOption'
foreign import ccall unsafe "ql.h &qlFreeMargrabeOption" qlFreeMargrabeOption :: FinalizerPtr CMargrabeOption'
foreign import ccall unsafe "ql.h &qlFreeEverestOption" qlFreeEverestOption :: FinalizerPtr CEverestOption'
instance Finalizable CMultiAssetOption' where finalize :: FinalizerPtr CMultiAssetOption'
finalize = FinalizerPtr CMultiAssetOption'
qlFreeMultiAssetOption
instance Finalizable CMargrabeOption' where finalize :: FinalizerPtr CMargrabeOption'
finalize = FinalizerPtr CMargrabeOption'
qlFreeMargrabeOption
instance Finalizable CEverestOption' where finalize :: FinalizerPtr CEverestOption'
finalize = FinalizerPtr CEverestOption'
qlFreeEverestOption
foreign import ccall "ql.h qlMultiAssetOptionAsOption" qlMultiAssetOptionAsOption :: Ptr CMultiAssetOption' -> IO (Ptr COption')
foreign import ccall "ql.h qlMargrabeOptionAsMultiAssetOption" qlMargrabeOptionAsMultiAssetOption :: Ptr CMargrabeOption' -> IO (Ptr CMultiAssetOption')
foreign import ccall "ql.h qlEverestOptionAsMultiAssetOption" qlEverestOptionAsMultiAssetOption :: Ptr CEverestOption' -> IO (Ptr CMultiAssetOption')
instance Upcastable CMultiAssetOption' where {type Base CMultiAssetOption' = COption'; upcast :: Ptr CMultiAssetOption' -> IO (Ptr (Base CMultiAssetOption'))
upcast = Ptr CMultiAssetOption' -> IO (Ptr COption')
Ptr CMultiAssetOption' -> IO (Ptr (Base CMultiAssetOption'))
qlMultiAssetOptionAsOption}
instance Upcastable CMargrabeOption' where {type Base CMargrabeOption' = CMultiAssetOption'; upcast :: Ptr CMargrabeOption' -> IO (Ptr (Base CMargrabeOption'))
upcast = Ptr CMargrabeOption' -> IO (Ptr CMultiAssetOption')
Ptr CMargrabeOption' -> IO (Ptr (Base CMargrabeOption'))
qlMargrabeOptionAsMultiAssetOption}
instance Upcastable CEverestOption' where {type Base CEverestOption' = CMultiAssetOption'; upcast :: Ptr CEverestOption' -> IO (Ptr (Base CEverestOption'))
upcast = Ptr CEverestOption' -> IO (Ptr CMultiAssetOption')
Ptr CEverestOption' -> IO (Ptr (Base CEverestOption'))
qlEverestOptionAsMultiAssetOption}
asMultiAssetOption :: GenMultiAssetOption mo -> IO MultiAssetOption
asMultiAssetOption :: forall mo. GenMultiAssetOption mo -> IO MultiAssetOption
asMultiAssetOption = (Ptr CMultiAssetOption' -> IO MultiAssetOption)
-> GenForeignPtr mo CMultiAssetOption' -> IO MultiAssetOption
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr CMultiAssetOption' -> IO MultiAssetOption
peekMultiAssetOption (GenForeignPtr mo CMultiAssetOption' -> IO MultiAssetOption)
-> (GenMultiAssetOption mo -> GenForeignPtr mo CMultiAssetOption')
-> GenMultiAssetOption mo
-> IO MultiAssetOption
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CMultiAssetOption' mo) COption'
-> GenForeignPtr mo CMultiAssetOption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CMultiAssetOption' mo) COption'
 -> GenForeignPtr mo CMultiAssetOption')
-> (GenMultiAssetOption mo
    -> GenForeignPtr (AnyOf CMultiAssetOption' mo) COption')
-> GenMultiAssetOption mo
-> GenForeignPtr mo CMultiAssetOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COption' (AnyOf CMultiAssetOption' mo)) CInstrument'
-> GenForeignPtr (AnyOf CMultiAssetOption' mo) COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COption' (AnyOf CMultiAssetOption' mo)) CInstrument'
 -> GenForeignPtr (AnyOf CMultiAssetOption' mo) COption')
-> (GenMultiAssetOption mo
    -> GenForeignPtr
         (AnyOf COption' (AnyOf CMultiAssetOption' mo)) CInstrument')
-> GenMultiAssetOption mo
-> GenForeignPtr (AnyOf CMultiAssetOption' mo) COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenMultiAssetOption mo
-> GenForeignPtr
     (AnyOf COption' (AnyOf CMultiAssetOption' mo)) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
peekMultiAssetOption :: Ptr CMultiAssetOption' -> IO MultiAssetOption
peekMultiAssetOption :: Ptr CMultiAssetOption' -> IO MultiAssetOption
peekMultiAssetOption = Ptr CMultiAssetOption'
-> IO
     (GenForeignPtr (ForeignPtr CMultiAssetOption') CMultiAssetOption')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr CMultiAssetOption'
 -> IO
      (GenForeignPtr (ForeignPtr CMultiAssetOption') CMultiAssetOption'))
-> (GenForeignPtr
      (ForeignPtr CMultiAssetOption') CMultiAssetOption'
    -> IO MultiAssetOption)
-> Ptr CMultiAssetOption'
-> IO MultiAssetOption
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CMultiAssetOption') CMultiAssetOption'
-> IO MultiAssetOption
forall mo.
GenForeignPtr mo CMultiAssetOption' -> IO (GenMultiAssetOption mo)
newGenMultiAssetOption
withMultiAssetOption :: GenMultiAssetOption mo -> (Ptr CMultiAssetOption' -> IO b) -> IO b
withMultiAssetOption :: forall mo b.
GenMultiAssetOption mo -> (Ptr CMultiAssetOption' -> IO b) -> IO b
withMultiAssetOption = GenForeignPtr mo CMultiAssetOption'
-> (Ptr CMultiAssetOption' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr mo CMultiAssetOption'
 -> (Ptr CMultiAssetOption' -> IO b) -> IO b)
-> (GenMultiAssetOption mo -> GenForeignPtr mo CMultiAssetOption')
-> GenMultiAssetOption mo
-> (Ptr CMultiAssetOption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CMultiAssetOption' mo) COption'
-> GenForeignPtr mo CMultiAssetOption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CMultiAssetOption' mo) COption'
 -> GenForeignPtr mo CMultiAssetOption')
-> (GenMultiAssetOption mo
    -> GenForeignPtr (AnyOf CMultiAssetOption' mo) COption')
-> GenMultiAssetOption mo
-> GenForeignPtr mo CMultiAssetOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COption' (AnyOf CMultiAssetOption' mo)) CInstrument'
-> GenForeignPtr (AnyOf CMultiAssetOption' mo) COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COption' (AnyOf CMultiAssetOption' mo)) CInstrument'
 -> GenForeignPtr (AnyOf CMultiAssetOption' mo) COption')
-> (GenMultiAssetOption mo
    -> GenForeignPtr
         (AnyOf COption' (AnyOf CMultiAssetOption' mo)) CInstrument')
-> GenMultiAssetOption mo
-> GenForeignPtr (AnyOf CMultiAssetOption' mo) COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenMultiAssetOption mo
-> GenForeignPtr
     (AnyOf COption' (AnyOf CMultiAssetOption' mo)) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
newGenMultiAssetOption :: GenForeignPtr mo CMultiAssetOption' -> IO (GenMultiAssetOption mo)
newGenMultiAssetOption :: forall mo.
GenForeignPtr mo CMultiAssetOption' -> IO (GenMultiAssetOption mo)
newGenMultiAssetOption = GenMultiAssetOption mo -> IO (GenMultiAssetOption mo)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenMultiAssetOption mo -> IO (GenMultiAssetOption mo))
-> (GenForeignPtr mo CMultiAssetOption' -> GenMultiAssetOption mo)
-> GenForeignPtr mo CMultiAssetOption'
-> IO (GenMultiAssetOption mo)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COption' (AnyOf CMultiAssetOption' mo)) CInstrument'
-> GenMultiAssetOption mo
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr
   (AnyOf COption' (AnyOf CMultiAssetOption' mo)) CInstrument'
 -> GenMultiAssetOption mo)
-> (GenForeignPtr mo CMultiAssetOption'
    -> GenForeignPtr
         (AnyOf COption' (AnyOf CMultiAssetOption' mo)) CInstrument')
-> GenForeignPtr mo CMultiAssetOption'
-> GenMultiAssetOption mo
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CMultiAssetOption' mo) COption'
-> GenForeignPtr
     (AnyOf COption' (AnyOf CMultiAssetOption' mo)) CInstrument'
GenForeignPtr (AnyOf CMultiAssetOption' mo) COption'
-> GenForeignPtr
     (AnyOf COption' (AnyOf CMultiAssetOption' mo)) (Base COption')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CMultiAssetOption' mo) COption'
 -> GenForeignPtr
      (AnyOf COption' (AnyOf CMultiAssetOption' mo)) CInstrument')
-> (GenForeignPtr mo CMultiAssetOption'
    -> GenForeignPtr (AnyOf CMultiAssetOption' mo) COption')
-> GenForeignPtr mo CMultiAssetOption'
-> GenForeignPtr
     (AnyOf COption' (AnyOf CMultiAssetOption' mo)) CInstrument'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr mo CMultiAssetOption'
-> GenForeignPtr (AnyOf CMultiAssetOption' mo) COption'
GenForeignPtr mo CMultiAssetOption'
-> GenForeignPtr
     (AnyOf CMultiAssetOption' mo) (Base CMultiAssetOption')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf

peekMargrabeOption :: Ptr CMargrabeOption' -> IO MargrabeOption
peekMargrabeOption :: Ptr CMargrabeOption' -> IO MargrabeOption
peekMargrabeOption = Ptr CMargrabeOption'
-> IO
     (GenForeignPtr (ForeignPtr CMargrabeOption') CMultiAssetOption')
Ptr CMargrabeOption'
-> IO
     (GenForeignPtr
        (ForeignPtr CMargrabeOption') (Base CMargrabeOption'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CMargrabeOption'
 -> IO
      (GenForeignPtr (ForeignPtr CMargrabeOption') CMultiAssetOption'))
-> (GenForeignPtr (ForeignPtr CMargrabeOption') CMultiAssetOption'
    -> IO MargrabeOption)
-> Ptr CMargrabeOption'
-> IO MargrabeOption
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CMargrabeOption') CMultiAssetOption'
-> IO MargrabeOption
forall mo.
GenForeignPtr mo CMultiAssetOption' -> IO (GenMultiAssetOption mo)
newGenMultiAssetOption
withMargrabeOption :: MargrabeOption -> (Ptr CMargrabeOption' -> IO b) -> IO b
withMargrabeOption :: forall b. MargrabeOption -> (Ptr CMargrabeOption' -> IO b) -> IO b
withMargrabeOption = ForeignPtr CMargrabeOption'
-> (Ptr CMargrabeOption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CMargrabeOption'
 -> (Ptr CMargrabeOption' -> IO b) -> IO b)
-> (MargrabeOption -> ForeignPtr CMargrabeOption')
-> MargrabeOption
-> (Ptr CMargrabeOption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CMargrabeOption') CMultiAssetOption'
-> ForeignPtr CMargrabeOption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CMargrabeOption') CMultiAssetOption'
 -> ForeignPtr CMargrabeOption')
-> (MargrabeOption
    -> GenForeignPtr (ForeignPtr CMargrabeOption') CMultiAssetOption')
-> MargrabeOption
-> ForeignPtr CMargrabeOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CMultiAssetOption' (ForeignPtr CMargrabeOption')) COption'
-> GenForeignPtr (ForeignPtr CMargrabeOption') CMultiAssetOption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CMultiAssetOption' (ForeignPtr CMargrabeOption')) COption'
 -> GenForeignPtr (ForeignPtr CMargrabeOption') CMultiAssetOption')
-> (MargrabeOption
    -> GenForeignPtr
         (AnyOf CMultiAssetOption' (ForeignPtr CMargrabeOption')) COption')
-> MargrabeOption
-> GenForeignPtr (ForeignPtr CMargrabeOption') CMultiAssetOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     COption' (AnyOf CMultiAssetOption' (ForeignPtr CMargrabeOption')))
  CInstrument'
-> GenForeignPtr
     (AnyOf CMultiAssetOption' (ForeignPtr CMargrabeOption')) COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      COption' (AnyOf CMultiAssetOption' (ForeignPtr CMargrabeOption')))
   CInstrument'
 -> GenForeignPtr
      (AnyOf CMultiAssetOption' (ForeignPtr CMargrabeOption')) COption')
-> (MargrabeOption
    -> GenForeignPtr
         (AnyOf
            COption' (AnyOf CMultiAssetOption' (ForeignPtr CMargrabeOption')))
         CInstrument')
-> MargrabeOption
-> GenForeignPtr
     (AnyOf CMultiAssetOption' (ForeignPtr CMargrabeOption')) COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. MargrabeOption
-> GenForeignPtr
     (AnyOf
        COption' (AnyOf CMultiAssetOption' (ForeignPtr CMargrabeOption')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

peekEverestOption :: Ptr CEverestOption' -> IO EverestOption
peekEverestOption :: Ptr CEverestOption' -> IO EverestOption
peekEverestOption = Ptr CEverestOption'
-> IO
     (GenForeignPtr (ForeignPtr CEverestOption') CMultiAssetOption')
Ptr CEverestOption'
-> IO
     (GenForeignPtr (ForeignPtr CEverestOption') (Base CEverestOption'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CEverestOption'
 -> IO
      (GenForeignPtr (ForeignPtr CEverestOption') CMultiAssetOption'))
-> (GenForeignPtr (ForeignPtr CEverestOption') CMultiAssetOption'
    -> IO EverestOption)
-> Ptr CEverestOption'
-> IO EverestOption
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CEverestOption') CMultiAssetOption'
-> IO EverestOption
forall mo.
GenForeignPtr mo CMultiAssetOption' -> IO (GenMultiAssetOption mo)
newGenMultiAssetOption
withEverestOption :: EverestOption -> (Ptr CEverestOption' -> IO b) -> IO b
withEverestOption :: forall b. EverestOption -> (Ptr CEverestOption' -> IO b) -> IO b
withEverestOption = ForeignPtr CEverestOption' -> (Ptr CEverestOption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CEverestOption'
 -> (Ptr CEverestOption' -> IO b) -> IO b)
-> (EverestOption -> ForeignPtr CEverestOption')
-> EverestOption
-> (Ptr CEverestOption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CEverestOption') CMultiAssetOption'
-> ForeignPtr CEverestOption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CEverestOption') CMultiAssetOption'
 -> ForeignPtr CEverestOption')
-> (EverestOption
    -> GenForeignPtr (ForeignPtr CEverestOption') CMultiAssetOption')
-> EverestOption
-> ForeignPtr CEverestOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CMultiAssetOption' (ForeignPtr CEverestOption')) COption'
-> GenForeignPtr (ForeignPtr CEverestOption') CMultiAssetOption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CMultiAssetOption' (ForeignPtr CEverestOption')) COption'
 -> GenForeignPtr (ForeignPtr CEverestOption') CMultiAssetOption')
-> (EverestOption
    -> GenForeignPtr
         (AnyOf CMultiAssetOption' (ForeignPtr CEverestOption')) COption')
-> EverestOption
-> GenForeignPtr (ForeignPtr CEverestOption') CMultiAssetOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     COption' (AnyOf CMultiAssetOption' (ForeignPtr CEverestOption')))
  CInstrument'
-> GenForeignPtr
     (AnyOf CMultiAssetOption' (ForeignPtr CEverestOption')) COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      COption' (AnyOf CMultiAssetOption' (ForeignPtr CEverestOption')))
   CInstrument'
 -> GenForeignPtr
      (AnyOf CMultiAssetOption' (ForeignPtr CEverestOption')) COption')
-> (EverestOption
    -> GenForeignPtr
         (AnyOf
            COption' (AnyOf CMultiAssetOption' (ForeignPtr CEverestOption')))
         CInstrument')
-> EverestOption
-> GenForeignPtr
     (AnyOf CMultiAssetOption' (ForeignPtr CEverestOption')) COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EverestOption
-> GenForeignPtr
     (AnyOf
        COption' (AnyOf CMultiAssetOption' (ForeignPtr CEverestOption')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data COneAssetOption'
type GenOneAssetOption oo = GenOption (AnyOf COneAssetOption' oo)
type COneAssetOption = ForeignPtr COneAssetOption'
-- |An 'Option'; see the hierarchy under t'GenInstrument'.
type OneAssetOption = GenOneAssetOption COneAssetOption
foreign import ccall unsafe "ql.h &qlFreeOneAssetOption" qlFreeOneAssetOption :: FinalizerPtr COneAssetOption'
instance Finalizable COneAssetOption' where finalize :: FinalizerPtr COneAssetOption'
finalize = FinalizerPtr COneAssetOption'
qlFreeOneAssetOption
foreign import ccall "ql.h qlOneAssetOptionAsOption" qlOneAssetOptionAsOption :: Ptr COneAssetOption' -> IO (Ptr COption')
instance Upcastable COneAssetOption' where {type Base COneAssetOption' = COption'; upcast :: Ptr COneAssetOption' -> IO (Ptr (Base COneAssetOption'))
upcast = Ptr COneAssetOption' -> IO (Ptr COption')
Ptr COneAssetOption' -> IO (Ptr (Base COneAssetOption'))
qlOneAssetOptionAsOption}
asOneAssetOption :: GenOneAssetOption oo -> IO OneAssetOption
asOneAssetOption :: forall oo. GenOneAssetOption oo -> IO OneAssetOption
asOneAssetOption = (Ptr COneAssetOption' -> IO OneAssetOption)
-> GenForeignPtr oo COneAssetOption' -> IO OneAssetOption
forall b r a. (Ptr b -> IO r) -> GenForeignPtr a b -> IO r
transferGenForeignPtr Ptr COneAssetOption' -> IO OneAssetOption
peekOneAssetOption (GenForeignPtr oo COneAssetOption' -> IO OneAssetOption)
-> (GenOneAssetOption oo -> GenForeignPtr oo COneAssetOption')
-> GenOneAssetOption oo
-> IO OneAssetOption
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf COneAssetOption' oo) COption'
-> GenForeignPtr oo COneAssetOption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf COneAssetOption' oo) COption'
 -> GenForeignPtr oo COneAssetOption')
-> (GenOneAssetOption oo
    -> GenForeignPtr (AnyOf COneAssetOption' oo) COption')
-> GenOneAssetOption oo
-> GenForeignPtr oo COneAssetOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COption' (AnyOf COneAssetOption' oo)) CInstrument'
-> GenForeignPtr (AnyOf COneAssetOption' oo) COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COption' (AnyOf COneAssetOption' oo)) CInstrument'
 -> GenForeignPtr (AnyOf COneAssetOption' oo) COption')
-> (GenOneAssetOption oo
    -> GenForeignPtr
         (AnyOf COption' (AnyOf COneAssetOption' oo)) CInstrument')
-> GenOneAssetOption oo
-> GenForeignPtr (AnyOf COneAssetOption' oo) COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenOneAssetOption oo
-> GenForeignPtr
     (AnyOf COption' (AnyOf COneAssetOption' oo)) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
peekOneAssetOption :: Ptr COneAssetOption' -> IO OneAssetOption
peekOneAssetOption :: Ptr COneAssetOption' -> IO OneAssetOption
peekOneAssetOption = Ptr COneAssetOption'
-> IO
     (GenForeignPtr (ForeignPtr COneAssetOption') COneAssetOption')
forall a.
Finalizable a =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) a)
newCastForeignPtr (Ptr COneAssetOption'
 -> IO
      (GenForeignPtr (ForeignPtr COneAssetOption') COneAssetOption'))
-> (GenForeignPtr (ForeignPtr COneAssetOption') COneAssetOption'
    -> IO OneAssetOption)
-> Ptr COneAssetOption'
-> IO OneAssetOption
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr COneAssetOption') COneAssetOption'
-> IO OneAssetOption
forall oo.
GenForeignPtr oo COneAssetOption' -> IO (GenOneAssetOption oo)
newGenOneAssetOption
withOneAssetOption :: GenOneAssetOption oo -> (Ptr COneAssetOption' -> IO b) -> IO b
withOneAssetOption :: forall oo b.
GenOneAssetOption oo -> (Ptr COneAssetOption' -> IO b) -> IO b
withOneAssetOption = GenForeignPtr oo COneAssetOption'
-> (Ptr COneAssetOption' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr oo COneAssetOption'
 -> (Ptr COneAssetOption' -> IO b) -> IO b)
-> (GenOneAssetOption oo -> GenForeignPtr oo COneAssetOption')
-> GenOneAssetOption oo
-> (Ptr COneAssetOption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf COneAssetOption' oo) COption'
-> GenForeignPtr oo COneAssetOption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf COneAssetOption' oo) COption'
 -> GenForeignPtr oo COneAssetOption')
-> (GenOneAssetOption oo
    -> GenForeignPtr (AnyOf COneAssetOption' oo) COption')
-> GenOneAssetOption oo
-> GenForeignPtr oo COneAssetOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COption' (AnyOf COneAssetOption' oo)) CInstrument'
-> GenForeignPtr (AnyOf COneAssetOption' oo) COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COption' (AnyOf COneAssetOption' oo)) CInstrument'
 -> GenForeignPtr (AnyOf COneAssetOption' oo) COption')
-> (GenOneAssetOption oo
    -> GenForeignPtr
         (AnyOf COption' (AnyOf COneAssetOption' oo)) CInstrument')
-> GenOneAssetOption oo
-> GenForeignPtr (AnyOf COneAssetOption' oo) COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenOneAssetOption oo
-> GenForeignPtr
     (AnyOf COption' (AnyOf COneAssetOption' oo)) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
newGenOneAssetOption :: GenForeignPtr oo COneAssetOption' -> IO (GenOneAssetOption oo)
newGenOneAssetOption :: forall oo.
GenForeignPtr oo COneAssetOption' -> IO (GenOneAssetOption oo)
newGenOneAssetOption = GenOneAssetOption oo -> IO (GenOneAssetOption oo)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenOneAssetOption oo -> IO (GenOneAssetOption oo))
-> (GenForeignPtr oo COneAssetOption' -> GenOneAssetOption oo)
-> GenForeignPtr oo COneAssetOption'
-> IO (GenOneAssetOption oo)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COption' (AnyOf COneAssetOption' oo)) CInstrument'
-> GenOneAssetOption oo
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr
   (AnyOf COption' (AnyOf COneAssetOption' oo)) CInstrument'
 -> GenOneAssetOption oo)
-> (GenForeignPtr oo COneAssetOption'
    -> GenForeignPtr
         (AnyOf COption' (AnyOf COneAssetOption' oo)) CInstrument')
-> GenForeignPtr oo COneAssetOption'
-> GenOneAssetOption oo
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf COneAssetOption' oo) COption'
-> GenForeignPtr
     (AnyOf COption' (AnyOf COneAssetOption' oo)) CInstrument'
GenForeignPtr (AnyOf COneAssetOption' oo) COption'
-> GenForeignPtr
     (AnyOf COption' (AnyOf COneAssetOption' oo)) (Base COption')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf COneAssetOption' oo) COption'
 -> GenForeignPtr
      (AnyOf COption' (AnyOf COneAssetOption' oo)) CInstrument')
-> (GenForeignPtr oo COneAssetOption'
    -> GenForeignPtr (AnyOf COneAssetOption' oo) COption')
-> GenForeignPtr oo COneAssetOption'
-> GenForeignPtr
     (AnyOf COption' (AnyOf COneAssetOption' oo)) CInstrument'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr oo COneAssetOption'
-> GenForeignPtr (AnyOf COneAssetOption' oo) COption'
GenForeignPtr oo COneAssetOption'
-> GenForeignPtr
     (AnyOf COneAssetOption' oo) (Base COneAssetOption')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf

data CBarrierOption'
type CBarrierOption = ForeignPtr CBarrierOption'
-- |An 'OneAssetOption'; see the hierarchy under t'GenInstrument'.
type BarrierOption = GenOneAssetOption CBarrierOption
foreign import ccall unsafe "ql.h &qlFreeBarrierOption" qlFreeBarrierOption :: FinalizerPtr CBarrierOption'
instance Finalizable CBarrierOption' where finalize :: FinalizerPtr CBarrierOption'
finalize = FinalizerPtr CBarrierOption'
qlFreeBarrierOption
foreign import ccall "ql.h qlBarrierOptionAsOneAssetOption" qlBarrierOptionAsOneAssetOption :: Ptr CBarrierOption' -> IO (Ptr COneAssetOption')
instance Upcastable CBarrierOption' where {type Base CBarrierOption' = COneAssetOption'; upcast :: Ptr CBarrierOption' -> IO (Ptr (Base CBarrierOption'))
upcast = Ptr CBarrierOption' -> IO (Ptr COneAssetOption')
Ptr CBarrierOption' -> IO (Ptr (Base CBarrierOption'))
qlBarrierOptionAsOneAssetOption}
peekBarrierOption :: Ptr CBarrierOption' -> IO BarrierOption
peekBarrierOption :: Ptr CBarrierOption' -> IO BarrierOption
peekBarrierOption = Ptr CBarrierOption'
-> IO (GenForeignPtr (ForeignPtr CBarrierOption') COneAssetOption')
Ptr CBarrierOption'
-> IO
     (GenForeignPtr (ForeignPtr CBarrierOption') (Base CBarrierOption'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CBarrierOption'
 -> IO
      (GenForeignPtr (ForeignPtr CBarrierOption') COneAssetOption'))
-> (GenForeignPtr (ForeignPtr CBarrierOption') COneAssetOption'
    -> IO BarrierOption)
-> Ptr CBarrierOption'
-> IO BarrierOption
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CBarrierOption') COneAssetOption'
-> IO BarrierOption
forall oo.
GenForeignPtr oo COneAssetOption' -> IO (GenOneAssetOption oo)
newGenOneAssetOption
withBarrierOption :: BarrierOption -> (Ptr CBarrierOption' -> IO b) -> IO b
withBarrierOption :: forall b. BarrierOption -> (Ptr CBarrierOption' -> IO b) -> IO b
withBarrierOption = ForeignPtr CBarrierOption' -> (Ptr CBarrierOption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CBarrierOption'
 -> (Ptr CBarrierOption' -> IO b) -> IO b)
-> (BarrierOption -> ForeignPtr CBarrierOption')
-> BarrierOption
-> (Ptr CBarrierOption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CBarrierOption') COneAssetOption'
-> ForeignPtr CBarrierOption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CBarrierOption') COneAssetOption'
 -> ForeignPtr CBarrierOption')
-> (BarrierOption
    -> GenForeignPtr (ForeignPtr CBarrierOption') COneAssetOption')
-> BarrierOption
-> ForeignPtr CBarrierOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COneAssetOption' (ForeignPtr CBarrierOption')) COption'
-> GenForeignPtr (ForeignPtr CBarrierOption') COneAssetOption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COneAssetOption' (ForeignPtr CBarrierOption')) COption'
 -> GenForeignPtr (ForeignPtr CBarrierOption') COneAssetOption')
-> (BarrierOption
    -> GenForeignPtr
         (AnyOf COneAssetOption' (ForeignPtr CBarrierOption')) COption')
-> BarrierOption
-> GenForeignPtr (ForeignPtr CBarrierOption') COneAssetOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     COption' (AnyOf COneAssetOption' (ForeignPtr CBarrierOption')))
  CInstrument'
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CBarrierOption')) COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      COption' (AnyOf COneAssetOption' (ForeignPtr CBarrierOption')))
   CInstrument'
 -> GenForeignPtr
      (AnyOf COneAssetOption' (ForeignPtr CBarrierOption')) COption')
-> (BarrierOption
    -> GenForeignPtr
         (AnyOf
            COption' (AnyOf COneAssetOption' (ForeignPtr CBarrierOption')))
         CInstrument')
-> BarrierOption
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CBarrierOption')) COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BarrierOption
-> GenForeignPtr
     (AnyOf
        COption' (AnyOf COneAssetOption' (ForeignPtr CBarrierOption')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CSoftBarrierOption'
type CSoftBarrierOption = ForeignPtr CSoftBarrierOption'
-- |An 'OneAssetOption'; see the hierarchy under t'GenInstrument'.
type SoftBarrierOption = GenOneAssetOption CSoftBarrierOption
foreign import ccall unsafe "ql.h &qlFreeSoftBarrierOption" qlFreeSoftBarrierOption :: FinalizerPtr CSoftBarrierOption'
instance Finalizable CSoftBarrierOption' where finalize :: FinalizerPtr CSoftBarrierOption'
finalize = FinalizerPtr CSoftBarrierOption'
qlFreeSoftBarrierOption
foreign import ccall "ql.h qlSoftBarrierOptionAsOneAssetOption" qlSoftBarrierOptionAsOneAssetOption :: Ptr CSoftBarrierOption' -> IO (Ptr COneAssetOption')
instance Upcastable CSoftBarrierOption' where {type Base CSoftBarrierOption' = COneAssetOption'; upcast :: Ptr CSoftBarrierOption' -> IO (Ptr (Base CSoftBarrierOption'))
upcast = Ptr CSoftBarrierOption' -> IO (Ptr COneAssetOption')
Ptr CSoftBarrierOption' -> IO (Ptr (Base CSoftBarrierOption'))
qlSoftBarrierOptionAsOneAssetOption}
peekSoftBarrierOption :: Ptr CSoftBarrierOption' -> IO SoftBarrierOption
peekSoftBarrierOption :: Ptr CSoftBarrierOption' -> IO SoftBarrierOption
peekSoftBarrierOption = Ptr CSoftBarrierOption'
-> IO
     (GenForeignPtr (ForeignPtr CSoftBarrierOption') COneAssetOption')
Ptr CSoftBarrierOption'
-> IO
     (GenForeignPtr
        (ForeignPtr CSoftBarrierOption') (Base CSoftBarrierOption'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CSoftBarrierOption'
 -> IO
      (GenForeignPtr (ForeignPtr CSoftBarrierOption') COneAssetOption'))
-> (GenForeignPtr (ForeignPtr CSoftBarrierOption') COneAssetOption'
    -> IO SoftBarrierOption)
-> Ptr CSoftBarrierOption'
-> IO SoftBarrierOption
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CSoftBarrierOption') COneAssetOption'
-> IO SoftBarrierOption
forall oo.
GenForeignPtr oo COneAssetOption' -> IO (GenOneAssetOption oo)
newGenOneAssetOption
withSoftBarrierOption :: SoftBarrierOption -> (Ptr CSoftBarrierOption' -> IO b) -> IO b
withSoftBarrierOption :: forall b.
SoftBarrierOption -> (Ptr CSoftBarrierOption' -> IO b) -> IO b
withSoftBarrierOption = ForeignPtr CSoftBarrierOption'
-> (Ptr CSoftBarrierOption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CSoftBarrierOption'
 -> (Ptr CSoftBarrierOption' -> IO b) -> IO b)
-> (SoftBarrierOption -> ForeignPtr CSoftBarrierOption')
-> SoftBarrierOption
-> (Ptr CSoftBarrierOption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CSoftBarrierOption') COneAssetOption'
-> ForeignPtr CSoftBarrierOption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CSoftBarrierOption') COneAssetOption'
 -> ForeignPtr CSoftBarrierOption')
-> (SoftBarrierOption
    -> GenForeignPtr (ForeignPtr CSoftBarrierOption') COneAssetOption')
-> SoftBarrierOption
-> ForeignPtr CSoftBarrierOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COneAssetOption' (ForeignPtr CSoftBarrierOption')) COption'
-> GenForeignPtr (ForeignPtr CSoftBarrierOption') COneAssetOption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COneAssetOption' (ForeignPtr CSoftBarrierOption')) COption'
 -> GenForeignPtr (ForeignPtr CSoftBarrierOption') COneAssetOption')
-> (SoftBarrierOption
    -> GenForeignPtr
         (AnyOf COneAssetOption' (ForeignPtr CSoftBarrierOption')) COption')
-> SoftBarrierOption
-> GenForeignPtr (ForeignPtr CSoftBarrierOption') COneAssetOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     COption' (AnyOf COneAssetOption' (ForeignPtr CSoftBarrierOption')))
  CInstrument'
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CSoftBarrierOption')) COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      COption' (AnyOf COneAssetOption' (ForeignPtr CSoftBarrierOption')))
   CInstrument'
 -> GenForeignPtr
      (AnyOf COneAssetOption' (ForeignPtr CSoftBarrierOption')) COption')
-> (SoftBarrierOption
    -> GenForeignPtr
         (AnyOf
            COption' (AnyOf COneAssetOption' (ForeignPtr CSoftBarrierOption')))
         CInstrument')
-> SoftBarrierOption
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CSoftBarrierOption')) COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SoftBarrierOption
-> GenForeignPtr
     (AnyOf
        COption' (AnyOf COneAssetOption' (ForeignPtr CSoftBarrierOption')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CDoubleBarrierOption'
type CDoubleBarrierOption = ForeignPtr CDoubleBarrierOption'
-- |An 'OneAssetOption'; see the hierarchy under t'GenInstrument'.
type DoubleBarrierOption = GenOneAssetOption CDoubleBarrierOption
foreign import ccall unsafe "ql.h &qlFreeDoubleBarrierOption" qlFreeDoubleBarrierOption :: FinalizerPtr CDoubleBarrierOption'
instance Finalizable CDoubleBarrierOption' where finalize :: FinalizerPtr CDoubleBarrierOption'
finalize = FinalizerPtr CDoubleBarrierOption'
qlFreeDoubleBarrierOption
foreign import ccall "ql.h qlDoubleBarrierOptionAsOneAssetOption" qlDoubleBarrierOptionAsOneAssetOption :: Ptr CDoubleBarrierOption' -> IO (Ptr COneAssetOption')
instance Upcastable CDoubleBarrierOption' where {type Base CDoubleBarrierOption' = COneAssetOption'; upcast :: Ptr CDoubleBarrierOption' -> IO (Ptr (Base CDoubleBarrierOption'))
upcast = Ptr CDoubleBarrierOption' -> IO (Ptr COneAssetOption')
Ptr CDoubleBarrierOption' -> IO (Ptr (Base CDoubleBarrierOption'))
qlDoubleBarrierOptionAsOneAssetOption}
peekDoubleBarrierOption :: Ptr CDoubleBarrierOption' -> IO DoubleBarrierOption
peekDoubleBarrierOption :: Ptr CDoubleBarrierOption' -> IO DoubleBarrierOption
peekDoubleBarrierOption = Ptr CDoubleBarrierOption'
-> IO
     (GenForeignPtr (ForeignPtr CDoubleBarrierOption') COneAssetOption')
Ptr CDoubleBarrierOption'
-> IO
     (GenForeignPtr
        (ForeignPtr CDoubleBarrierOption') (Base CDoubleBarrierOption'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CDoubleBarrierOption'
 -> IO
      (GenForeignPtr
         (ForeignPtr CDoubleBarrierOption') COneAssetOption'))
-> (GenForeignPtr
      (ForeignPtr CDoubleBarrierOption') COneAssetOption'
    -> IO DoubleBarrierOption)
-> Ptr CDoubleBarrierOption'
-> IO DoubleBarrierOption
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CDoubleBarrierOption') COneAssetOption'
-> IO DoubleBarrierOption
forall oo.
GenForeignPtr oo COneAssetOption' -> IO (GenOneAssetOption oo)
newGenOneAssetOption
withDoubleBarrierOption :: DoubleBarrierOption -> (Ptr CDoubleBarrierOption' -> IO b) -> IO b
withDoubleBarrierOption :: forall b.
DoubleBarrierOption -> (Ptr CDoubleBarrierOption' -> IO b) -> IO b
withDoubleBarrierOption = ForeignPtr CDoubleBarrierOption'
-> (Ptr CDoubleBarrierOption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CDoubleBarrierOption'
 -> (Ptr CDoubleBarrierOption' -> IO b) -> IO b)
-> (DoubleBarrierOption -> ForeignPtr CDoubleBarrierOption')
-> DoubleBarrierOption
-> (Ptr CDoubleBarrierOption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CDoubleBarrierOption') COneAssetOption'
-> ForeignPtr CDoubleBarrierOption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CDoubleBarrierOption') COneAssetOption'
 -> ForeignPtr CDoubleBarrierOption')
-> (DoubleBarrierOption
    -> GenForeignPtr
         (ForeignPtr CDoubleBarrierOption') COneAssetOption')
-> DoubleBarrierOption
-> ForeignPtr CDoubleBarrierOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COneAssetOption' (ForeignPtr CDoubleBarrierOption'))
  COption'
-> GenForeignPtr
     (ForeignPtr CDoubleBarrierOption') COneAssetOption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COneAssetOption' (ForeignPtr CDoubleBarrierOption'))
   COption'
 -> GenForeignPtr
      (ForeignPtr CDoubleBarrierOption') COneAssetOption')
-> (DoubleBarrierOption
    -> GenForeignPtr
         (AnyOf COneAssetOption' (ForeignPtr CDoubleBarrierOption'))
         COption')
-> DoubleBarrierOption
-> GenForeignPtr
     (ForeignPtr CDoubleBarrierOption') COneAssetOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     COption'
     (AnyOf COneAssetOption' (ForeignPtr CDoubleBarrierOption')))
  CInstrument'
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CDoubleBarrierOption'))
     COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      COption'
      (AnyOf COneAssetOption' (ForeignPtr CDoubleBarrierOption')))
   CInstrument'
 -> GenForeignPtr
      (AnyOf COneAssetOption' (ForeignPtr CDoubleBarrierOption'))
      COption')
-> (DoubleBarrierOption
    -> GenForeignPtr
         (AnyOf
            COption'
            (AnyOf COneAssetOption' (ForeignPtr CDoubleBarrierOption')))
         CInstrument')
-> DoubleBarrierOption
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CDoubleBarrierOption'))
     COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DoubleBarrierOption
-> GenForeignPtr
     (AnyOf
        COption'
        (AnyOf COneAssetOption' (ForeignPtr CDoubleBarrierOption')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CQuantoForwardVanillaOption'
type CQuantoForwardVanillaOption = ForeignPtr CQuantoForwardVanillaOption'
-- |An 'OneAssetOption'; see the hierarchy under t'GenInstrument'.
type QuantoForwardVanillaOption = GenOneAssetOption CQuantoForwardVanillaOption
foreign import ccall unsafe "ql.h &qlFreeQuantoForwardVanillaOption" qlFreeQuantoForwardVanillaOption :: FinalizerPtr CQuantoForwardVanillaOption'
instance Finalizable CQuantoForwardVanillaOption' where finalize :: FinalizerPtr CQuantoForwardVanillaOption'
finalize = FinalizerPtr CQuantoForwardVanillaOption'
qlFreeQuantoForwardVanillaOption
foreign import ccall "ql.h qlQuantoForwardVanillaOptionAsOneAssetOption" qlQuantoForwardVanillaOptionAsOneAssetOption :: Ptr CQuantoForwardVanillaOption' -> IO (Ptr COneAssetOption')
instance Upcastable CQuantoForwardVanillaOption' where {type Base CQuantoForwardVanillaOption' = COneAssetOption'; upcast :: Ptr CQuantoForwardVanillaOption'
-> IO (Ptr (Base CQuantoForwardVanillaOption'))
upcast = Ptr CQuantoForwardVanillaOption' -> IO (Ptr COneAssetOption')
Ptr CQuantoForwardVanillaOption'
-> IO (Ptr (Base CQuantoForwardVanillaOption'))
qlQuantoForwardVanillaOptionAsOneAssetOption}
peekQuantoForwardVanillaOption :: Ptr CQuantoForwardVanillaOption' -> IO QuantoForwardVanillaOption
peekQuantoForwardVanillaOption :: Ptr CQuantoForwardVanillaOption' -> IO QuantoForwardVanillaOption
peekQuantoForwardVanillaOption = Ptr CQuantoForwardVanillaOption'
-> IO
     (GenForeignPtr
        (ForeignPtr CQuantoForwardVanillaOption') COneAssetOption')
Ptr CQuantoForwardVanillaOption'
-> IO
     (GenForeignPtr
        (ForeignPtr CQuantoForwardVanillaOption')
        (Base CQuantoForwardVanillaOption'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CQuantoForwardVanillaOption'
 -> IO
      (GenForeignPtr
         (ForeignPtr CQuantoForwardVanillaOption') COneAssetOption'))
-> (GenForeignPtr
      (ForeignPtr CQuantoForwardVanillaOption') COneAssetOption'
    -> IO QuantoForwardVanillaOption)
-> Ptr CQuantoForwardVanillaOption'
-> IO QuantoForwardVanillaOption
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CQuantoForwardVanillaOption') COneAssetOption'
-> IO QuantoForwardVanillaOption
forall oo.
GenForeignPtr oo COneAssetOption' -> IO (GenOneAssetOption oo)
newGenOneAssetOption
withQuantoForwardVanillaOption :: QuantoForwardVanillaOption -> (Ptr CQuantoForwardVanillaOption' -> IO b) -> IO b
withQuantoForwardVanillaOption :: forall b.
QuantoForwardVanillaOption
-> (Ptr CQuantoForwardVanillaOption' -> IO b) -> IO b
withQuantoForwardVanillaOption = ForeignPtr CQuantoForwardVanillaOption'
-> (Ptr CQuantoForwardVanillaOption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CQuantoForwardVanillaOption'
 -> (Ptr CQuantoForwardVanillaOption' -> IO b) -> IO b)
-> (QuantoForwardVanillaOption
    -> ForeignPtr CQuantoForwardVanillaOption')
-> QuantoForwardVanillaOption
-> (Ptr CQuantoForwardVanillaOption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CQuantoForwardVanillaOption') COneAssetOption'
-> ForeignPtr CQuantoForwardVanillaOption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CQuantoForwardVanillaOption') COneAssetOption'
 -> ForeignPtr CQuantoForwardVanillaOption')
-> (QuantoForwardVanillaOption
    -> GenForeignPtr
         (ForeignPtr CQuantoForwardVanillaOption') COneAssetOption')
-> QuantoForwardVanillaOption
-> ForeignPtr CQuantoForwardVanillaOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COneAssetOption' (ForeignPtr CQuantoForwardVanillaOption'))
  COption'
-> GenForeignPtr
     (ForeignPtr CQuantoForwardVanillaOption') COneAssetOption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COneAssetOption' (ForeignPtr CQuantoForwardVanillaOption'))
   COption'
 -> GenForeignPtr
      (ForeignPtr CQuantoForwardVanillaOption') COneAssetOption')
-> (QuantoForwardVanillaOption
    -> GenForeignPtr
         (AnyOf COneAssetOption' (ForeignPtr CQuantoForwardVanillaOption'))
         COption')
-> QuantoForwardVanillaOption
-> GenForeignPtr
     (ForeignPtr CQuantoForwardVanillaOption') COneAssetOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     COption'
     (AnyOf COneAssetOption' (ForeignPtr CQuantoForwardVanillaOption')))
  CInstrument'
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CQuantoForwardVanillaOption'))
     COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      COption'
      (AnyOf COneAssetOption' (ForeignPtr CQuantoForwardVanillaOption')))
   CInstrument'
 -> GenForeignPtr
      (AnyOf COneAssetOption' (ForeignPtr CQuantoForwardVanillaOption'))
      COption')
-> (QuantoForwardVanillaOption
    -> GenForeignPtr
         (AnyOf
            COption'
            (AnyOf COneAssetOption' (ForeignPtr CQuantoForwardVanillaOption')))
         CInstrument')
-> QuantoForwardVanillaOption
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CQuantoForwardVanillaOption'))
     COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. QuantoForwardVanillaOption
-> GenForeignPtr
     (AnyOf
        COption'
        (AnyOf COneAssetOption' (ForeignPtr CQuantoForwardVanillaOption')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CQuantoVanillaOption'
type CQuantoVanillaOption = ForeignPtr CQuantoVanillaOption'
-- |An 'OneAssetOption'; see the hierarchy under t'GenInstrument'.
type QuantoVanillaOption = GenOneAssetOption CQuantoVanillaOption
foreign import ccall unsafe "ql.h &qlFreeQuantoVanillaOption" qlFreeQuantoVanillaOption :: FinalizerPtr CQuantoVanillaOption'
instance Finalizable CQuantoVanillaOption' where finalize :: FinalizerPtr CQuantoVanillaOption'
finalize = FinalizerPtr CQuantoVanillaOption'
qlFreeQuantoVanillaOption
foreign import ccall "ql.h qlQuantoVanillaOptionAsOneAssetOption" qlQuantoVanillaOptionAsOneAssetOption :: Ptr CQuantoVanillaOption' -> IO (Ptr COneAssetOption')
instance Upcastable CQuantoVanillaOption' where {type Base CQuantoVanillaOption' = COneAssetOption'; upcast :: Ptr CQuantoVanillaOption' -> IO (Ptr (Base CQuantoVanillaOption'))
upcast = Ptr CQuantoVanillaOption' -> IO (Ptr COneAssetOption')
Ptr CQuantoVanillaOption' -> IO (Ptr (Base CQuantoVanillaOption'))
qlQuantoVanillaOptionAsOneAssetOption}
peekQuantoVanillaOption :: Ptr CQuantoVanillaOption' -> IO QuantoVanillaOption
peekQuantoVanillaOption :: Ptr CQuantoVanillaOption' -> IO QuantoVanillaOption
peekQuantoVanillaOption = Ptr CQuantoVanillaOption'
-> IO
     (GenForeignPtr (ForeignPtr CQuantoVanillaOption') COneAssetOption')
Ptr CQuantoVanillaOption'
-> IO
     (GenForeignPtr
        (ForeignPtr CQuantoVanillaOption') (Base CQuantoVanillaOption'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CQuantoVanillaOption'
 -> IO
      (GenForeignPtr
         (ForeignPtr CQuantoVanillaOption') COneAssetOption'))
-> (GenForeignPtr
      (ForeignPtr CQuantoVanillaOption') COneAssetOption'
    -> IO QuantoVanillaOption)
-> Ptr CQuantoVanillaOption'
-> IO QuantoVanillaOption
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CQuantoVanillaOption') COneAssetOption'
-> IO QuantoVanillaOption
forall oo.
GenForeignPtr oo COneAssetOption' -> IO (GenOneAssetOption oo)
newGenOneAssetOption
withQuantoVanillaOption :: QuantoVanillaOption -> (Ptr CQuantoVanillaOption' -> IO b) -> IO b
withQuantoVanillaOption :: forall b.
QuantoVanillaOption -> (Ptr CQuantoVanillaOption' -> IO b) -> IO b
withQuantoVanillaOption = ForeignPtr CQuantoVanillaOption'
-> (Ptr CQuantoVanillaOption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CQuantoVanillaOption'
 -> (Ptr CQuantoVanillaOption' -> IO b) -> IO b)
-> (QuantoVanillaOption -> ForeignPtr CQuantoVanillaOption')
-> QuantoVanillaOption
-> (Ptr CQuantoVanillaOption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CQuantoVanillaOption') COneAssetOption'
-> ForeignPtr CQuantoVanillaOption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CQuantoVanillaOption') COneAssetOption'
 -> ForeignPtr CQuantoVanillaOption')
-> (QuantoVanillaOption
    -> GenForeignPtr
         (ForeignPtr CQuantoVanillaOption') COneAssetOption')
-> QuantoVanillaOption
-> ForeignPtr CQuantoVanillaOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COneAssetOption' (ForeignPtr CQuantoVanillaOption'))
  COption'
-> GenForeignPtr
     (ForeignPtr CQuantoVanillaOption') COneAssetOption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COneAssetOption' (ForeignPtr CQuantoVanillaOption'))
   COption'
 -> GenForeignPtr
      (ForeignPtr CQuantoVanillaOption') COneAssetOption')
-> (QuantoVanillaOption
    -> GenForeignPtr
         (AnyOf COneAssetOption' (ForeignPtr CQuantoVanillaOption'))
         COption')
-> QuantoVanillaOption
-> GenForeignPtr
     (ForeignPtr CQuantoVanillaOption') COneAssetOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     COption'
     (AnyOf COneAssetOption' (ForeignPtr CQuantoVanillaOption')))
  CInstrument'
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CQuantoVanillaOption'))
     COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      COption'
      (AnyOf COneAssetOption' (ForeignPtr CQuantoVanillaOption')))
   CInstrument'
 -> GenForeignPtr
      (AnyOf COneAssetOption' (ForeignPtr CQuantoVanillaOption'))
      COption')
-> (QuantoVanillaOption
    -> GenForeignPtr
         (AnyOf
            COption'
            (AnyOf COneAssetOption' (ForeignPtr CQuantoVanillaOption')))
         CInstrument')
-> QuantoVanillaOption
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CQuantoVanillaOption'))
     COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. QuantoVanillaOption
-> GenForeignPtr
     (AnyOf
        COption'
        (AnyOf COneAssetOption' (ForeignPtr CQuantoVanillaOption')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CVanillaOption'
type CVanillaOption = ForeignPtr CVanillaOption'
-- |An 'OneAssetOption'; see the hierarchy under t'GenInstrument'.
type VanillaOption = GenOneAssetOption CVanillaOption
foreign import ccall unsafe "ql.h &qlFreeVanillaOption" qlFreeVanillaOption :: FinalizerPtr CVanillaOption'
instance Finalizable CVanillaOption' where finalize :: FinalizerPtr CVanillaOption'
finalize = FinalizerPtr CVanillaOption'
qlFreeVanillaOption
foreign import ccall "ql.h qlVanillaOptionAsOneAssetOption" qlVanillaOptionAsOneAssetOption :: Ptr CVanillaOption' -> IO (Ptr COneAssetOption')
instance Upcastable CVanillaOption' where {type Base CVanillaOption' = COneAssetOption'; upcast :: Ptr CVanillaOption' -> IO (Ptr (Base CVanillaOption'))
upcast = Ptr CVanillaOption' -> IO (Ptr COneAssetOption')
Ptr CVanillaOption' -> IO (Ptr (Base CVanillaOption'))
qlVanillaOptionAsOneAssetOption}
peekVanillaOption :: Ptr CVanillaOption' -> IO VanillaOption
peekVanillaOption :: Ptr CVanillaOption' -> IO VanillaOption
peekVanillaOption = Ptr CVanillaOption'
-> IO (GenForeignPtr (ForeignPtr CVanillaOption') COneAssetOption')
Ptr CVanillaOption'
-> IO
     (GenForeignPtr (ForeignPtr CVanillaOption') (Base CVanillaOption'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CVanillaOption'
 -> IO
      (GenForeignPtr (ForeignPtr CVanillaOption') COneAssetOption'))
-> (GenForeignPtr (ForeignPtr CVanillaOption') COneAssetOption'
    -> IO VanillaOption)
-> Ptr CVanillaOption'
-> IO VanillaOption
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CVanillaOption') COneAssetOption'
-> IO VanillaOption
forall oo.
GenForeignPtr oo COneAssetOption' -> IO (GenOneAssetOption oo)
newGenOneAssetOption
withVanillaOption :: VanillaOption -> (Ptr CVanillaOption' -> IO b) -> IO b
withVanillaOption :: forall b. VanillaOption -> (Ptr CVanillaOption' -> IO b) -> IO b
withVanillaOption = ForeignPtr CVanillaOption' -> (Ptr CVanillaOption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CVanillaOption'
 -> (Ptr CVanillaOption' -> IO b) -> IO b)
-> (VanillaOption -> ForeignPtr CVanillaOption')
-> VanillaOption
-> (Ptr CVanillaOption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CVanillaOption') COneAssetOption'
-> ForeignPtr CVanillaOption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CVanillaOption') COneAssetOption'
 -> ForeignPtr CVanillaOption')
-> (VanillaOption
    -> GenForeignPtr (ForeignPtr CVanillaOption') COneAssetOption')
-> VanillaOption
-> ForeignPtr CVanillaOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COneAssetOption' (ForeignPtr CVanillaOption')) COption'
-> GenForeignPtr (ForeignPtr CVanillaOption') COneAssetOption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COneAssetOption' (ForeignPtr CVanillaOption')) COption'
 -> GenForeignPtr (ForeignPtr CVanillaOption') COneAssetOption')
-> (VanillaOption
    -> GenForeignPtr
         (AnyOf COneAssetOption' (ForeignPtr CVanillaOption')) COption')
-> VanillaOption
-> GenForeignPtr (ForeignPtr CVanillaOption') COneAssetOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     COption' (AnyOf COneAssetOption' (ForeignPtr CVanillaOption')))
  CInstrument'
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CVanillaOption')) COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      COption' (AnyOf COneAssetOption' (ForeignPtr CVanillaOption')))
   CInstrument'
 -> GenForeignPtr
      (AnyOf COneAssetOption' (ForeignPtr CVanillaOption')) COption')
-> (VanillaOption
    -> GenForeignPtr
         (AnyOf
            COption' (AnyOf COneAssetOption' (ForeignPtr CVanillaOption')))
         CInstrument')
-> VanillaOption
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CVanillaOption')) COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VanillaOption
-> GenForeignPtr
     (AnyOf
        COption' (AnyOf COneAssetOption' (ForeignPtr CVanillaOption')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument
withVanillaOptionArray :: [VanillaOption] -> ((CUInt, Ptr (Ptr CVanillaOption')) -> IO b) -> IO b
withVanillaOptionArray :: forall b.
[VanillaOption]
-> ((CUInt, Ptr (Ptr CVanillaOption')) -> IO b) -> IO b
withVanillaOptionArray = (VanillaOption -> (Ptr CVanillaOption' -> IO b) -> IO b)
-> [VanillaOption]
-> ((CUInt, Ptr (Ptr CVanillaOption')) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray VanillaOption -> (Ptr CVanillaOption' -> IO b) -> IO b
forall b. VanillaOption -> (Ptr CVanillaOption' -> IO b) -> IO b
withVanillaOption

data CQuantoBarrierOption'
type CQuantoBarrierOption = ForeignPtr CQuantoBarrierOption'
-- |An 'OneAssetOption'; see the hierarchy under t'GenInstrument'.
type QuantoBarrierOption = GenOneAssetOption CQuantoBarrierOption
foreign import ccall unsafe "ql.h &qlFreeQuantoBarrierOption" qlFreeQuantoBarrierOption :: FinalizerPtr CQuantoBarrierOption'
instance Finalizable CQuantoBarrierOption' where finalize :: FinalizerPtr CQuantoBarrierOption'
finalize = FinalizerPtr CQuantoBarrierOption'
qlFreeQuantoBarrierOption
foreign import ccall "ql.h qlQuantoBarrierOptionAsOneAssetOption" qlQuantoBarrierOptionAsOneAssetOption :: Ptr CQuantoBarrierOption' -> IO (Ptr COneAssetOption')
instance Upcastable CQuantoBarrierOption' where {type Base CQuantoBarrierOption' = COneAssetOption'; upcast :: Ptr CQuantoBarrierOption' -> IO (Ptr (Base CQuantoBarrierOption'))
upcast = Ptr CQuantoBarrierOption' -> IO (Ptr COneAssetOption')
Ptr CQuantoBarrierOption' -> IO (Ptr (Base CQuantoBarrierOption'))
qlQuantoBarrierOptionAsOneAssetOption}
peekQuantoBarrierOption :: Ptr CQuantoBarrierOption' -> IO QuantoBarrierOption
peekQuantoBarrierOption :: Ptr CQuantoBarrierOption' -> IO QuantoBarrierOption
peekQuantoBarrierOption = Ptr CQuantoBarrierOption'
-> IO
     (GenForeignPtr (ForeignPtr CQuantoBarrierOption') COneAssetOption')
Ptr CQuantoBarrierOption'
-> IO
     (GenForeignPtr
        (ForeignPtr CQuantoBarrierOption') (Base CQuantoBarrierOption'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CQuantoBarrierOption'
 -> IO
      (GenForeignPtr
         (ForeignPtr CQuantoBarrierOption') COneAssetOption'))
-> (GenForeignPtr
      (ForeignPtr CQuantoBarrierOption') COneAssetOption'
    -> IO QuantoBarrierOption)
-> Ptr CQuantoBarrierOption'
-> IO QuantoBarrierOption
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CQuantoBarrierOption') COneAssetOption'
-> IO QuantoBarrierOption
forall oo.
GenForeignPtr oo COneAssetOption' -> IO (GenOneAssetOption oo)
newGenOneAssetOption
withQuantoBarrierOption :: QuantoBarrierOption -> (Ptr CQuantoBarrierOption' -> IO b) -> IO b
withQuantoBarrierOption :: forall b.
QuantoBarrierOption -> (Ptr CQuantoBarrierOption' -> IO b) -> IO b
withQuantoBarrierOption = ForeignPtr CQuantoBarrierOption'
-> (Ptr CQuantoBarrierOption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CQuantoBarrierOption'
 -> (Ptr CQuantoBarrierOption' -> IO b) -> IO b)
-> (QuantoBarrierOption -> ForeignPtr CQuantoBarrierOption')
-> QuantoBarrierOption
-> (Ptr CQuantoBarrierOption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CQuantoBarrierOption') COneAssetOption'
-> ForeignPtr CQuantoBarrierOption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CQuantoBarrierOption') COneAssetOption'
 -> ForeignPtr CQuantoBarrierOption')
-> (QuantoBarrierOption
    -> GenForeignPtr
         (ForeignPtr CQuantoBarrierOption') COneAssetOption')
-> QuantoBarrierOption
-> ForeignPtr CQuantoBarrierOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COneAssetOption' (ForeignPtr CQuantoBarrierOption'))
  COption'
-> GenForeignPtr
     (ForeignPtr CQuantoBarrierOption') COneAssetOption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COneAssetOption' (ForeignPtr CQuantoBarrierOption'))
   COption'
 -> GenForeignPtr
      (ForeignPtr CQuantoBarrierOption') COneAssetOption')
-> (QuantoBarrierOption
    -> GenForeignPtr
         (AnyOf COneAssetOption' (ForeignPtr CQuantoBarrierOption'))
         COption')
-> QuantoBarrierOption
-> GenForeignPtr
     (ForeignPtr CQuantoBarrierOption') COneAssetOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     COption'
     (AnyOf COneAssetOption' (ForeignPtr CQuantoBarrierOption')))
  CInstrument'
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CQuantoBarrierOption'))
     COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      COption'
      (AnyOf COneAssetOption' (ForeignPtr CQuantoBarrierOption')))
   CInstrument'
 -> GenForeignPtr
      (AnyOf COneAssetOption' (ForeignPtr CQuantoBarrierOption'))
      COption')
-> (QuantoBarrierOption
    -> GenForeignPtr
         (AnyOf
            COption'
            (AnyOf COneAssetOption' (ForeignPtr CQuantoBarrierOption')))
         CInstrument')
-> QuantoBarrierOption
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CQuantoBarrierOption'))
     COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. QuantoBarrierOption
-> GenForeignPtr
     (AnyOf
        COption'
        (AnyOf COneAssetOption' (ForeignPtr CQuantoBarrierOption')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CQuantoDoubleBarrierOption'
type CQuantoDoubleBarrierOption = ForeignPtr CQuantoDoubleBarrierOption'
-- |An 'OneAssetOption'; see the hierarchy under t'GenInstrument'.
type QuantoDoubleBarrierOption = GenOneAssetOption CQuantoDoubleBarrierOption
foreign import ccall unsafe "ql.h &qlFreeQuantoDoubleBarrierOption" qlFreeQuantoDoubleBarrierOption :: FinalizerPtr CQuantoDoubleBarrierOption'
instance Finalizable CQuantoDoubleBarrierOption' where finalize :: FinalizerPtr CQuantoDoubleBarrierOption'
finalize = FinalizerPtr CQuantoDoubleBarrierOption'
qlFreeQuantoDoubleBarrierOption
foreign import ccall "ql.h qlQuantoDoubleBarrierOptionAsOneAssetOption" qlQuantoDoubleBarrierOptionAsOneAssetOption :: Ptr CQuantoDoubleBarrierOption' -> IO (Ptr COneAssetOption')
instance Upcastable CQuantoDoubleBarrierOption' where {type Base CQuantoDoubleBarrierOption' = COneAssetOption'; upcast :: Ptr CQuantoDoubleBarrierOption'
-> IO (Ptr (Base CQuantoDoubleBarrierOption'))
upcast = Ptr CQuantoDoubleBarrierOption' -> IO (Ptr COneAssetOption')
Ptr CQuantoDoubleBarrierOption'
-> IO (Ptr (Base CQuantoDoubleBarrierOption'))
qlQuantoDoubleBarrierOptionAsOneAssetOption}
peekQuantoDoubleBarrierOption :: Ptr CQuantoDoubleBarrierOption' -> IO QuantoDoubleBarrierOption
peekQuantoDoubleBarrierOption :: Ptr CQuantoDoubleBarrierOption' -> IO QuantoDoubleBarrierOption
peekQuantoDoubleBarrierOption = Ptr CQuantoDoubleBarrierOption'
-> IO
     (GenForeignPtr
        (ForeignPtr CQuantoDoubleBarrierOption') COneAssetOption')
Ptr CQuantoDoubleBarrierOption'
-> IO
     (GenForeignPtr
        (ForeignPtr CQuantoDoubleBarrierOption')
        (Base CQuantoDoubleBarrierOption'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CQuantoDoubleBarrierOption'
 -> IO
      (GenForeignPtr
         (ForeignPtr CQuantoDoubleBarrierOption') COneAssetOption'))
-> (GenForeignPtr
      (ForeignPtr CQuantoDoubleBarrierOption') COneAssetOption'
    -> IO QuantoDoubleBarrierOption)
-> Ptr CQuantoDoubleBarrierOption'
-> IO QuantoDoubleBarrierOption
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr
  (ForeignPtr CQuantoDoubleBarrierOption') COneAssetOption'
-> IO QuantoDoubleBarrierOption
forall oo.
GenForeignPtr oo COneAssetOption' -> IO (GenOneAssetOption oo)
newGenOneAssetOption
withQuantoDoubleBarrierOption :: QuantoDoubleBarrierOption -> (Ptr CQuantoDoubleBarrierOption' -> IO b) -> IO b
withQuantoDoubleBarrierOption :: forall b.
QuantoDoubleBarrierOption
-> (Ptr CQuantoDoubleBarrierOption' -> IO b) -> IO b
withQuantoDoubleBarrierOption = ForeignPtr CQuantoDoubleBarrierOption'
-> (Ptr CQuantoDoubleBarrierOption' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CQuantoDoubleBarrierOption'
 -> (Ptr CQuantoDoubleBarrierOption' -> IO b) -> IO b)
-> (QuantoDoubleBarrierOption
    -> ForeignPtr CQuantoDoubleBarrierOption')
-> QuantoDoubleBarrierOption
-> (Ptr CQuantoDoubleBarrierOption' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (ForeignPtr CQuantoDoubleBarrierOption') COneAssetOption'
-> ForeignPtr CQuantoDoubleBarrierOption'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr
   (ForeignPtr CQuantoDoubleBarrierOption') COneAssetOption'
 -> ForeignPtr CQuantoDoubleBarrierOption')
-> (QuantoDoubleBarrierOption
    -> GenForeignPtr
         (ForeignPtr CQuantoDoubleBarrierOption') COneAssetOption')
-> QuantoDoubleBarrierOption
-> ForeignPtr CQuantoDoubleBarrierOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf COneAssetOption' (ForeignPtr CQuantoDoubleBarrierOption'))
  COption'
-> GenForeignPtr
     (ForeignPtr CQuantoDoubleBarrierOption') COneAssetOption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf COneAssetOption' (ForeignPtr CQuantoDoubleBarrierOption'))
   COption'
 -> GenForeignPtr
      (ForeignPtr CQuantoDoubleBarrierOption') COneAssetOption')
-> (QuantoDoubleBarrierOption
    -> GenForeignPtr
         (AnyOf COneAssetOption' (ForeignPtr CQuantoDoubleBarrierOption'))
         COption')
-> QuantoDoubleBarrierOption
-> GenForeignPtr
     (ForeignPtr CQuantoDoubleBarrierOption') COneAssetOption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     COption'
     (AnyOf COneAssetOption' (ForeignPtr CQuantoDoubleBarrierOption')))
  CInstrument'
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CQuantoDoubleBarrierOption'))
     COption'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      COption'
      (AnyOf COneAssetOption' (ForeignPtr CQuantoDoubleBarrierOption')))
   CInstrument'
 -> GenForeignPtr
      (AnyOf COneAssetOption' (ForeignPtr CQuantoDoubleBarrierOption'))
      COption')
-> (QuantoDoubleBarrierOption
    -> GenForeignPtr
         (AnyOf
            COption'
            (AnyOf COneAssetOption' (ForeignPtr CQuantoDoubleBarrierOption')))
         CInstrument')
-> QuantoDoubleBarrierOption
-> GenForeignPtr
     (AnyOf COneAssetOption' (ForeignPtr CQuantoDoubleBarrierOption'))
     COption'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. QuantoDoubleBarrierOption
-> GenForeignPtr
     (AnyOf
        COption'
        (AnyOf COneAssetOption' (ForeignPtr CQuantoDoubleBarrierOption')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

-- Commodity/EnergyCommodity are abstract-here: Commodity's own constructor is never called
-- directly upstream (every concrete instrument goes through EnergyCommodity), and
-- EnergyCommodity::quantity() is pure virtual, so neither binds a constructor here -- both are
-- reachable only as upcast targets once a Stage-6 leaf (EnergyFuture, EnergyVanillaSwap,
-- EnergyBasisSwap) exists. Commodity::secondaryCosts()/EnergyCommodity::commodityType() are plain,
-- never-mutated echoes of each class's own constructor argument (commodity.hpp/energycommodity.hpp's
-- inline getters each just `return foo_;`) -- not bound, per CLAUDE.md's trivial-getter rule.
-- secondaryCostAmounts()/pricingErrors()/addPricingError are genuine (mutable, computed during
-- pricing); their generalized 'withCommodity' accessor and marshalling live below, next to the
-- Stage-6 leaves that finally give them a producer to verify against.
data CCommodity'
type GenCommodity c = GenInstrument (AnyOf CCommodity' c)
type CCommodity = ForeignPtr CCommodity'
-- |An 'Instrument'; see the hierarchy under t'GenInstrument'.
type Commodity = GenCommodity CCommodity
foreign import ccall unsafe "ql.h &qlFreeCommodity" qlFreeCommodity :: FinalizerPtr CCommodity'
instance Finalizable CCommodity' where finalize :: FinalizerPtr CCommodity'
finalize = FinalizerPtr CCommodity'
qlFreeCommodity
foreign import ccall "ql.h qlCommodityAsInstrument" qlCommodityAsInstrument :: Ptr CCommodity' -> IO (Ptr CInstrument')
instance Upcastable CCommodity' where {type Base CCommodity' = CInstrument'; upcast :: Ptr CCommodity' -> IO (Ptr (Base CCommodity'))
upcast = Ptr CCommodity' -> IO (Ptr CInstrument')
Ptr CCommodity' -> IO (Ptr (Base CCommodity'))
qlCommodityAsInstrument}

data CEnergyCommodity'
type GenEnergyCommodity e = GenCommodity (AnyOf CEnergyCommodity' e)
type CEnergyCommodity = ForeignPtr CEnergyCommodity'
type EnergyCommodity = GenEnergyCommodity CEnergyCommodity
foreign import ccall unsafe "ql.h &qlFreeEnergyCommodity" qlFreeEnergyCommodity :: FinalizerPtr CEnergyCommodity'
instance Finalizable CEnergyCommodity' where finalize :: FinalizerPtr CEnergyCommodity'
finalize = FinalizerPtr CEnergyCommodity'
qlFreeEnergyCommodity
foreign import ccall "ql.h qlEnergyCommodityAsCommodity" qlEnergyCommodityAsCommodity :: Ptr CEnergyCommodity' -> IO (Ptr CCommodity')
instance Upcastable CEnergyCommodity' where {type Base CEnergyCommodity' = CCommodity'; upcast :: Ptr CEnergyCommodity' -> IO (Ptr (Base CEnergyCommodity'))
upcast = Ptr CEnergyCommodity' -> IO (Ptr CCommodity')
Ptr CEnergyCommodity' -> IO (Ptr (Base CEnergyCommodity'))
qlEnergyCommodityAsCommodity}

-- |Generalizes 'Commodity's base-level getters (secondaryCostAmounts, pricingErrors,
-- addPricingError) across every leaf in the Commodity\/EnergyCommodity\/EnergySwap subtree -- the
-- same move as 'withFixedVsFloatingSwap' generalizing its own base-level getters. One peel:
-- Commodity is the (only, so far) 'AnyOf' layer directly under t'GenInstrument' here.
withCommodity :: GenCommodity c -> (Ptr CCommodity' -> IO b) -> IO b
withCommodity :: forall c b. GenCommodity c -> (Ptr CCommodity' -> IO b) -> IO b
withCommodity = GenForeignPtr c CCommodity' -> (Ptr CCommodity' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr c CCommodity' -> (Ptr CCommodity' -> IO b) -> IO b)
-> (GenCommodity c -> GenForeignPtr c CCommodity')
-> GenCommodity c
-> (Ptr CCommodity' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CCommodity' c) CInstrument'
-> GenForeignPtr c CCommodity'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CCommodity' c) CInstrument'
 -> GenForeignPtr c CCommodity')
-> (GenCommodity c
    -> GenForeignPtr (AnyOf CCommodity' c) CInstrument')
-> GenCommodity c
-> GenForeignPtr c CCommodity'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenCommodity c -> GenForeignPtr (AnyOf CCommodity' c) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

-- |'newGenEnergyCommodity' wraps the 2 'AnyOf' layers (Commodity, EnergyCommodity) shared by every
-- 'EnergyCommodity' leaf -- the same helper role 'newGenFixedVsFloatingSwap' plays for 'VanillaSwap'.
newGenEnergyCommodity :: GenForeignPtr e CEnergyCommodity' -> IO (GenEnergyCommodity e)
newGenEnergyCommodity :: forall e.
GenForeignPtr e CEnergyCommodity' -> IO (GenEnergyCommodity e)
newGenEnergyCommodity = GenEnergyCommodity e -> IO (GenEnergyCommodity e)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenEnergyCommodity e -> IO (GenEnergyCommodity e))
-> (GenForeignPtr e CEnergyCommodity' -> GenEnergyCommodity e)
-> GenForeignPtr e CEnergyCommodity'
-> IO (GenEnergyCommodity e)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CCommodity' (AnyOf CEnergyCommodity' e)) CInstrument'
-> GenEnergyCommodity e
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr
   (AnyOf CCommodity' (AnyOf CEnergyCommodity' e)) CInstrument'
 -> GenEnergyCommodity e)
-> (GenForeignPtr e CEnergyCommodity'
    -> GenForeignPtr
         (AnyOf CCommodity' (AnyOf CEnergyCommodity' e)) CInstrument')
-> GenForeignPtr e CEnergyCommodity'
-> GenEnergyCommodity e
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CEnergyCommodity' e) CCommodity'
-> GenForeignPtr
     (AnyOf CCommodity' (AnyOf CEnergyCommodity' e)) CInstrument'
GenForeignPtr (AnyOf CEnergyCommodity' e) CCommodity'
-> GenForeignPtr
     (AnyOf CCommodity' (AnyOf CEnergyCommodity' e)) (Base CCommodity')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CEnergyCommodity' e) CCommodity'
 -> GenForeignPtr
      (AnyOf CCommodity' (AnyOf CEnergyCommodity' e)) CInstrument')
-> (GenForeignPtr e CEnergyCommodity'
    -> GenForeignPtr (AnyOf CEnergyCommodity' e) CCommodity')
-> GenForeignPtr e CEnergyCommodity'
-> GenForeignPtr
     (AnyOf CCommodity' (AnyOf CEnergyCommodity' e)) CInstrument'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr e CEnergyCommodity'
-> GenForeignPtr (AnyOf CEnergyCommodity' e) CCommodity'
GenForeignPtr e CEnergyCommodity'
-> GenForeignPtr
     (AnyOf CEnergyCommodity' e) (Base CEnergyCommodity')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf

-- |Generalizes 'EnergyCommodity's one pure-virtual interface method, @quantity()@, across every
-- leaf (EnergyFuture, EnergyVanillaSwap, EnergyBasisSwap): one shim, dispatched virtually on the
-- C++ side, rather than a per-leaf binding -- EnergyFuture's own override is a plain echo of its
-- constructor argument, but EnergySwap's is a real computed sum over its pricing periods
-- (energyswap.cpp), so the binding as a whole is not a redundant echo even though one leaf's
-- override happens to be.
withEnergyCommodity :: GenEnergyCommodity e -> (Ptr CEnergyCommodity' -> IO b) -> IO b
withEnergyCommodity :: forall e b.
GenEnergyCommodity e -> (Ptr CEnergyCommodity' -> IO b) -> IO b
withEnergyCommodity = GenForeignPtr e CEnergyCommodity'
-> (Ptr CEnergyCommodity' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr e CEnergyCommodity'
 -> (Ptr CEnergyCommodity' -> IO b) -> IO b)
-> (GenEnergyCommodity e -> GenForeignPtr e CEnergyCommodity')
-> GenEnergyCommodity e
-> (Ptr CEnergyCommodity' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CEnergyCommodity' e) CCommodity'
-> GenForeignPtr e CEnergyCommodity'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CEnergyCommodity' e) CCommodity'
 -> GenForeignPtr e CEnergyCommodity')
-> (GenEnergyCommodity e
    -> GenForeignPtr (AnyOf CEnergyCommodity' e) CCommodity')
-> GenEnergyCommodity e
-> GenForeignPtr e CEnergyCommodity'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CCommodity' (AnyOf CEnergyCommodity' e)) CInstrument'
-> GenForeignPtr (AnyOf CEnergyCommodity' e) CCommodity'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CCommodity' (AnyOf CEnergyCommodity' e)) CInstrument'
 -> GenForeignPtr (AnyOf CEnergyCommodity' e) CCommodity')
-> (GenEnergyCommodity e
    -> GenForeignPtr
         (AnyOf CCommodity' (AnyOf CEnergyCommodity' e)) CInstrument')
-> GenEnergyCommodity e
-> GenForeignPtr (AnyOf CEnergyCommodity' e) CCommodity'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenEnergyCommodity e
-> GenForeignPtr
     (AnyOf CCommodity' (AnyOf CEnergyCommodity' e)) CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

-- |'EnergyFuture' is a leaf under 'EnergyCommodity'; two peels cross the Commodity and
-- EnergyCommodity layers to reach 'CEnergyFuture''.
data CEnergyFuture'
type CEnergyFuture = ForeignPtr CEnergyFuture'
-- |An 'EnergyCommodity'; see the hierarchy under t'GenInstrument'.
type EnergyFuture = GenEnergyCommodity CEnergyFuture
foreign import ccall unsafe "ql.h &qlFreeEnergyFuture" qlFreeEnergyFuture :: FinalizerPtr CEnergyFuture'
instance Finalizable CEnergyFuture' where finalize :: FinalizerPtr CEnergyFuture'
finalize = FinalizerPtr CEnergyFuture'
qlFreeEnergyFuture
foreign import ccall "ql.h qlEnergyFutureAsEnergyCommodity" qlEnergyFutureAsEnergyCommodity :: Ptr CEnergyFuture' -> IO (Ptr CEnergyCommodity')
instance Upcastable CEnergyFuture' where {type Base CEnergyFuture' = CEnergyCommodity'; upcast :: Ptr CEnergyFuture' -> IO (Ptr (Base CEnergyFuture'))
upcast = Ptr CEnergyFuture' -> IO (Ptr CEnergyCommodity')
Ptr CEnergyFuture' -> IO (Ptr (Base CEnergyFuture'))
qlEnergyFutureAsEnergyCommodity}
peekEnergyFuture :: Ptr CEnergyFuture' -> IO EnergyFuture
peekEnergyFuture :: Ptr CEnergyFuture' -> IO EnergyFuture
peekEnergyFuture = Ptr CEnergyFuture'
-> IO (GenForeignPtr (ForeignPtr CEnergyFuture') CEnergyCommodity')
Ptr CEnergyFuture'
-> IO
     (GenForeignPtr (ForeignPtr CEnergyFuture') (Base CEnergyFuture'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CEnergyFuture'
 -> IO
      (GenForeignPtr (ForeignPtr CEnergyFuture') CEnergyCommodity'))
-> (GenForeignPtr (ForeignPtr CEnergyFuture') CEnergyCommodity'
    -> IO EnergyFuture)
-> Ptr CEnergyFuture'
-> IO EnergyFuture
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CEnergyFuture') CEnergyCommodity'
-> IO EnergyFuture
forall e.
GenForeignPtr e CEnergyCommodity' -> IO (GenEnergyCommodity e)
newGenEnergyCommodity
withEnergyFuture :: EnergyFuture -> (Ptr CEnergyFuture' -> IO b) -> IO b
withEnergyFuture :: forall b. EnergyFuture -> (Ptr CEnergyFuture' -> IO b) -> IO b
withEnergyFuture = ForeignPtr CEnergyFuture' -> (Ptr CEnergyFuture' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CEnergyFuture' -> (Ptr CEnergyFuture' -> IO b) -> IO b)
-> (EnergyFuture -> ForeignPtr CEnergyFuture')
-> EnergyFuture
-> (Ptr CEnergyFuture' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CEnergyFuture') CEnergyCommodity'
-> ForeignPtr CEnergyFuture'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CEnergyFuture') CEnergyCommodity'
 -> ForeignPtr CEnergyFuture')
-> (EnergyFuture
    -> GenForeignPtr (ForeignPtr CEnergyFuture') CEnergyCommodity')
-> EnergyFuture
-> ForeignPtr CEnergyFuture'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CEnergyCommodity' (ForeignPtr CEnergyFuture')) CCommodity'
-> GenForeignPtr (ForeignPtr CEnergyFuture') CEnergyCommodity'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CEnergyCommodity' (ForeignPtr CEnergyFuture')) CCommodity'
 -> GenForeignPtr (ForeignPtr CEnergyFuture') CEnergyCommodity')
-> (EnergyFuture
    -> GenForeignPtr
         (AnyOf CEnergyCommodity' (ForeignPtr CEnergyFuture')) CCommodity')
-> EnergyFuture
-> GenForeignPtr (ForeignPtr CEnergyFuture') CEnergyCommodity'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCommodity' (AnyOf CEnergyCommodity' (ForeignPtr CEnergyFuture')))
  CInstrument'
-> GenForeignPtr
     (AnyOf CEnergyCommodity' (ForeignPtr CEnergyFuture')) CCommodity'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCommodity' (AnyOf CEnergyCommodity' (ForeignPtr CEnergyFuture')))
   CInstrument'
 -> GenForeignPtr
      (AnyOf CEnergyCommodity' (ForeignPtr CEnergyFuture')) CCommodity')
-> (EnergyFuture
    -> GenForeignPtr
         (AnyOf
            CCommodity' (AnyOf CEnergyCommodity' (ForeignPtr CEnergyFuture')))
         CInstrument')
-> EnergyFuture
-> GenForeignPtr
     (AnyOf CEnergyCommodity' (ForeignPtr CEnergyFuture')) CCommodity'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnergyFuture
-> GenForeignPtr
     (AnyOf
        CCommodity' (AnyOf CEnergyCommodity' (ForeignPtr CEnergyFuture')))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

-- |'EnergySwap' is abstract-here: it binds a public constructor upstream, but never overrides
-- 'performCalculations', so calling it directly falls through to 'Instrument's null-engine
-- @QL_REQUIRE@ and throws -- reachable only as an upcast target from 'EnergyVanillaSwap'\/
-- 'EnergyBasisSwap', exactly like 'FixedVsFloatingSwap'\/'VanillaSwap'. Its own accessors
-- (calendar, payCurrency, receiveCurrency, pricingPeriods, dailyPositions, paymentCashFlows,
-- commodityType, quantity) are bound generically over 'GenEnergySwap' in
-- 'QuantLib.Instrument.Energy' so both leaves inherit them for free, mirroring
-- 'GenFixedVsFloatingSwap's fairRate\/fixedLeg*\/floatingLeg* getters.
data CEnergySwap'
type GenEnergySwap s = GenEnergyCommodity (AnyOf CEnergySwap' s)
type CEnergySwap = ForeignPtr CEnergySwap'
-- |An 'EnergyCommodity'; see the hierarchy under t'GenInstrument'.
type EnergySwap = GenEnergySwap CEnergySwap
foreign import ccall unsafe "ql.h &qlFreeEnergySwap" qlFreeEnergySwap :: FinalizerPtr CEnergySwap'
instance Finalizable CEnergySwap' where finalize :: FinalizerPtr CEnergySwap'
finalize = FinalizerPtr CEnergySwap'
qlFreeEnergySwap
foreign import ccall "ql.h qlEnergySwapAsEnergyCommodity" qlEnergySwapAsEnergyCommodity :: Ptr CEnergySwap' -> IO (Ptr CEnergyCommodity')
instance Upcastable CEnergySwap' where {type Base CEnergySwap' = CEnergyCommodity'; upcast :: Ptr CEnergySwap' -> IO (Ptr (Base CEnergySwap'))
upcast = Ptr CEnergySwap' -> IO (Ptr CEnergyCommodity')
Ptr CEnergySwap' -> IO (Ptr (Base CEnergySwap'))
qlEnergySwapAsEnergyCommodity}
newGenEnergySwap :: GenForeignPtr s CEnergySwap' -> IO (GenEnergySwap s)
newGenEnergySwap :: forall s. GenForeignPtr s CEnergySwap' -> IO (GenEnergySwap s)
newGenEnergySwap = GenEnergySwap s -> IO (GenEnergySwap s)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GenEnergySwap s -> IO (GenEnergySwap s))
-> (GenForeignPtr s CEnergySwap' -> GenEnergySwap s)
-> GenForeignPtr s CEnergySwap'
-> IO (GenEnergySwap s)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCommodity' (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)))
  CInstrument'
-> GenEnergySwap s
forall i. GenForeignPtr i CInstrument' -> GenInstrument i
GenInstrument (GenForeignPtr
   (AnyOf
      CCommodity' (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)))
   CInstrument'
 -> GenEnergySwap s)
-> (GenForeignPtr s CEnergySwap'
    -> GenForeignPtr
         (AnyOf
            CCommodity' (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)))
         CInstrument')
-> GenForeignPtr s CEnergySwap'
-> GenEnergySwap s
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)) CCommodity'
-> GenForeignPtr
     (AnyOf
        CCommodity' (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)))
     CInstrument'
GenForeignPtr
  (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)) CCommodity'
-> GenForeignPtr
     (AnyOf
        CCommodity' (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)))
     (Base CCommodity')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr
   (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)) CCommodity'
 -> GenForeignPtr
      (AnyOf
         CCommodity' (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)))
      CInstrument')
-> (GenForeignPtr s CEnergySwap'
    -> GenForeignPtr
         (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)) CCommodity')
-> GenForeignPtr s CEnergySwap'
-> GenForeignPtr
     (AnyOf
        CCommodity' (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)))
     CInstrument'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CEnergySwap' s) CEnergyCommodity'
-> GenForeignPtr
     (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)) CCommodity'
GenForeignPtr (AnyOf CEnergySwap' s) CEnergyCommodity'
-> GenForeignPtr
     (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s))
     (Base CEnergyCommodity')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf (GenForeignPtr (AnyOf CEnergySwap' s) CEnergyCommodity'
 -> GenForeignPtr
      (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)) CCommodity')
-> (GenForeignPtr s CEnergySwap'
    -> GenForeignPtr (AnyOf CEnergySwap' s) CEnergyCommodity')
-> GenForeignPtr s CEnergySwap'
-> GenForeignPtr
     (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)) CCommodity'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr s CEnergySwap'
-> GenForeignPtr (AnyOf CEnergySwap' s) CEnergyCommodity'
GenForeignPtr s CEnergySwap'
-> GenForeignPtr (AnyOf CEnergySwap' s) (Base CEnergySwap')
forall b a.
(Upcastable b, Finalizable (Base b)) =>
GenForeignPtr a b -> GenForeignPtr (AnyOf b a) (Base b)
newAnyOf
withEnergySwap :: GenEnergySwap s -> (Ptr CEnergySwap' -> IO b) -> IO b
withEnergySwap :: forall s b. GenEnergySwap s -> (Ptr CEnergySwap' -> IO b) -> IO b
withEnergySwap = GenForeignPtr s CEnergySwap' -> (Ptr CEnergySwap' -> IO b) -> IO b
forall a b r. GenForeignPtr a b -> (Ptr b -> IO r) -> IO r
withGenForeignPtr (GenForeignPtr s CEnergySwap'
 -> (Ptr CEnergySwap' -> IO b) -> IO b)
-> (GenEnergySwap s -> GenForeignPtr s CEnergySwap')
-> GenEnergySwap s
-> (Ptr CEnergySwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (AnyOf CEnergySwap' s) CEnergyCommodity'
-> GenForeignPtr s CEnergySwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr (AnyOf CEnergySwap' s) CEnergyCommodity'
 -> GenForeignPtr s CEnergySwap')
-> (GenEnergySwap s
    -> GenForeignPtr (AnyOf CEnergySwap' s) CEnergyCommodity')
-> GenEnergySwap s
-> GenForeignPtr s CEnergySwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)) CCommodity'
-> GenForeignPtr (AnyOf CEnergySwap' s) CEnergyCommodity'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)) CCommodity'
 -> GenForeignPtr (AnyOf CEnergySwap' s) CEnergyCommodity')
-> (GenEnergySwap s
    -> GenForeignPtr
         (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)) CCommodity')
-> GenEnergySwap s
-> GenForeignPtr (AnyOf CEnergySwap' s) CEnergyCommodity'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCommodity' (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)))
  CInstrument'
-> GenForeignPtr
     (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)) CCommodity'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCommodity' (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)))
   CInstrument'
 -> GenForeignPtr
      (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)) CCommodity')
-> (GenEnergySwap s
    -> GenForeignPtr
         (AnyOf
            CCommodity' (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)))
         CInstrument')
-> GenEnergySwap s
-> GenForeignPtr
     (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)) CCommodity'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenEnergySwap s
-> GenForeignPtr
     (AnyOf
        CCommodity' (AnyOf CEnergyCommodity' (AnyOf CEnergySwap' s)))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CEnergyVanillaSwap'
type CEnergyVanillaSwap = ForeignPtr CEnergyVanillaSwap'
-- |An 'EnergySwap'; see the hierarchy under t'GenInstrument'.
type EnergyVanillaSwap = GenEnergySwap CEnergyVanillaSwap
foreign import ccall unsafe "ql.h &qlFreeEnergyVanillaSwap" qlFreeEnergyVanillaSwap :: FinalizerPtr CEnergyVanillaSwap'
instance Finalizable CEnergyVanillaSwap' where finalize :: FinalizerPtr CEnergyVanillaSwap'
finalize = FinalizerPtr CEnergyVanillaSwap'
qlFreeEnergyVanillaSwap
foreign import ccall "ql.h qlEnergyVanillaSwapAsEnergySwap" qlEnergyVanillaSwapAsEnergySwap :: Ptr CEnergyVanillaSwap' -> IO (Ptr CEnergySwap')
instance Upcastable CEnergyVanillaSwap' where {type Base CEnergyVanillaSwap' = CEnergySwap'; upcast :: Ptr CEnergyVanillaSwap' -> IO (Ptr (Base CEnergyVanillaSwap'))
upcast = Ptr CEnergyVanillaSwap' -> IO (Ptr CEnergySwap')
Ptr CEnergyVanillaSwap' -> IO (Ptr (Base CEnergyVanillaSwap'))
qlEnergyVanillaSwapAsEnergySwap}
peekEnergyVanillaSwap :: Ptr CEnergyVanillaSwap' -> IO EnergyVanillaSwap
peekEnergyVanillaSwap :: Ptr CEnergyVanillaSwap' -> IO EnergyVanillaSwap
peekEnergyVanillaSwap = Ptr CEnergyVanillaSwap'
-> IO (GenForeignPtr (ForeignPtr CEnergyVanillaSwap') CEnergySwap')
Ptr CEnergyVanillaSwap'
-> IO
     (GenForeignPtr
        (ForeignPtr CEnergyVanillaSwap') (Base CEnergyVanillaSwap'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CEnergyVanillaSwap'
 -> IO
      (GenForeignPtr (ForeignPtr CEnergyVanillaSwap') CEnergySwap'))
-> (GenForeignPtr (ForeignPtr CEnergyVanillaSwap') CEnergySwap'
    -> IO EnergyVanillaSwap)
-> Ptr CEnergyVanillaSwap'
-> IO EnergyVanillaSwap
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CEnergyVanillaSwap') CEnergySwap'
-> IO EnergyVanillaSwap
forall s. GenForeignPtr s CEnergySwap' -> IO (GenEnergySwap s)
newGenEnergySwap
withEnergyVanillaSwap :: EnergyVanillaSwap -> (Ptr CEnergyVanillaSwap' -> IO b) -> IO b
withEnergyVanillaSwap :: forall b.
EnergyVanillaSwap -> (Ptr CEnergyVanillaSwap' -> IO b) -> IO b
withEnergyVanillaSwap = ForeignPtr CEnergyVanillaSwap'
-> (Ptr CEnergyVanillaSwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CEnergyVanillaSwap'
 -> (Ptr CEnergyVanillaSwap' -> IO b) -> IO b)
-> (EnergyVanillaSwap -> ForeignPtr CEnergyVanillaSwap')
-> EnergyVanillaSwap
-> (Ptr CEnergyVanillaSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CEnergyVanillaSwap') CEnergySwap'
-> ForeignPtr CEnergyVanillaSwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CEnergyVanillaSwap') CEnergySwap'
 -> ForeignPtr CEnergyVanillaSwap')
-> (EnergyVanillaSwap
    -> GenForeignPtr (ForeignPtr CEnergyVanillaSwap') CEnergySwap')
-> EnergyVanillaSwap
-> ForeignPtr CEnergyVanillaSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap'))
  CEnergyCommodity'
-> GenForeignPtr (ForeignPtr CEnergyVanillaSwap') CEnergySwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap'))
   CEnergyCommodity'
 -> GenForeignPtr (ForeignPtr CEnergyVanillaSwap') CEnergySwap')
-> (EnergyVanillaSwap
    -> GenForeignPtr
         (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap'))
         CEnergyCommodity')
-> EnergyVanillaSwap
-> GenForeignPtr (ForeignPtr CEnergyVanillaSwap') CEnergySwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CEnergyCommodity'
     (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap')))
  CCommodity'
-> GenForeignPtr
     (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap'))
     CEnergyCommodity'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CEnergyCommodity'
      (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap')))
   CCommodity'
 -> GenForeignPtr
      (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap'))
      CEnergyCommodity')
-> (EnergyVanillaSwap
    -> GenForeignPtr
         (AnyOf
            CEnergyCommodity'
            (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap')))
         CCommodity')
-> EnergyVanillaSwap
-> GenForeignPtr
     (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap'))
     CEnergyCommodity'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCommodity'
     (AnyOf
        CEnergyCommodity'
        (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap'))))
  CInstrument'
-> GenForeignPtr
     (AnyOf
        CEnergyCommodity'
        (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap')))
     CCommodity'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCommodity'
      (AnyOf
         CEnergyCommodity'
         (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap'))))
   CInstrument'
 -> GenForeignPtr
      (AnyOf
         CEnergyCommodity'
         (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap')))
      CCommodity')
-> (EnergyVanillaSwap
    -> GenForeignPtr
         (AnyOf
            CCommodity'
            (AnyOf
               CEnergyCommodity'
               (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap'))))
         CInstrument')
-> EnergyVanillaSwap
-> GenForeignPtr
     (AnyOf
        CEnergyCommodity'
        (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap')))
     CCommodity'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnergyVanillaSwap
-> GenForeignPtr
     (AnyOf
        CCommodity'
        (AnyOf
           CEnergyCommodity'
           (AnyOf CEnergySwap' (ForeignPtr CEnergyVanillaSwap'))))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CEnergyBasisSwap'
type CEnergyBasisSwap = ForeignPtr CEnergyBasisSwap'
-- |An 'EnergySwap'; see the hierarchy under t'GenInstrument'.
type EnergyBasisSwap = GenEnergySwap CEnergyBasisSwap
foreign import ccall unsafe "ql.h &qlFreeEnergyBasisSwap" qlFreeEnergyBasisSwap :: FinalizerPtr CEnergyBasisSwap'
instance Finalizable CEnergyBasisSwap' where finalize :: FinalizerPtr CEnergyBasisSwap'
finalize = FinalizerPtr CEnergyBasisSwap'
qlFreeEnergyBasisSwap
foreign import ccall "ql.h qlEnergyBasisSwapAsEnergySwap" qlEnergyBasisSwapAsEnergySwap :: Ptr CEnergyBasisSwap' -> IO (Ptr CEnergySwap')
instance Upcastable CEnergyBasisSwap' where {type Base CEnergyBasisSwap' = CEnergySwap'; upcast :: Ptr CEnergyBasisSwap' -> IO (Ptr (Base CEnergyBasisSwap'))
upcast = Ptr CEnergyBasisSwap' -> IO (Ptr CEnergySwap')
Ptr CEnergyBasisSwap' -> IO (Ptr (Base CEnergyBasisSwap'))
qlEnergyBasisSwapAsEnergySwap}
peekEnergyBasisSwap :: Ptr CEnergyBasisSwap' -> IO EnergyBasisSwap
peekEnergyBasisSwap :: Ptr CEnergyBasisSwap' -> IO EnergyBasisSwap
peekEnergyBasisSwap = Ptr CEnergyBasisSwap'
-> IO (GenForeignPtr (ForeignPtr CEnergyBasisSwap') CEnergySwap')
Ptr CEnergyBasisSwap'
-> IO
     (GenForeignPtr
        (ForeignPtr CEnergyBasisSwap') (Base CEnergyBasisSwap'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr (Ptr CEnergyBasisSwap'
 -> IO (GenForeignPtr (ForeignPtr CEnergyBasisSwap') CEnergySwap'))
-> (GenForeignPtr (ForeignPtr CEnergyBasisSwap') CEnergySwap'
    -> IO EnergyBasisSwap)
-> Ptr CEnergyBasisSwap'
-> IO EnergyBasisSwap
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> GenForeignPtr (ForeignPtr CEnergyBasisSwap') CEnergySwap'
-> IO EnergyBasisSwap
forall s. GenForeignPtr s CEnergySwap' -> IO (GenEnergySwap s)
newGenEnergySwap
withEnergyBasisSwap :: EnergyBasisSwap -> (Ptr CEnergyBasisSwap' -> IO b) -> IO b
withEnergyBasisSwap :: forall b.
EnergyBasisSwap -> (Ptr CEnergyBasisSwap' -> IO b) -> IO b
withEnergyBasisSwap = ForeignPtr CEnergyBasisSwap'
-> (Ptr CEnergyBasisSwap' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ForeignPtr CEnergyBasisSwap'
 -> (Ptr CEnergyBasisSwap' -> IO b) -> IO b)
-> (EnergyBasisSwap -> ForeignPtr CEnergyBasisSwap')
-> EnergyBasisSwap
-> (Ptr CEnergyBasisSwap' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr (ForeignPtr CEnergyBasisSwap') CEnergySwap'
-> ForeignPtr CEnergyBasisSwap'
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr (ForeignPtr CEnergyBasisSwap') CEnergySwap'
 -> ForeignPtr CEnergyBasisSwap')
-> (EnergyBasisSwap
    -> GenForeignPtr (ForeignPtr CEnergyBasisSwap') CEnergySwap')
-> EnergyBasisSwap
-> ForeignPtr CEnergyBasisSwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap'))
  CEnergyCommodity'
-> GenForeignPtr (ForeignPtr CEnergyBasisSwap') CEnergySwap'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap'))
   CEnergyCommodity'
 -> GenForeignPtr (ForeignPtr CEnergyBasisSwap') CEnergySwap')
-> (EnergyBasisSwap
    -> GenForeignPtr
         (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap'))
         CEnergyCommodity')
-> EnergyBasisSwap
-> GenForeignPtr (ForeignPtr CEnergyBasisSwap') CEnergySwap'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CEnergyCommodity'
     (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap')))
  CCommodity'
-> GenForeignPtr
     (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap'))
     CEnergyCommodity'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CEnergyCommodity'
      (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap')))
   CCommodity'
 -> GenForeignPtr
      (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap'))
      CEnergyCommodity')
-> (EnergyBasisSwap
    -> GenForeignPtr
         (AnyOf
            CEnergyCommodity'
            (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap')))
         CCommodity')
-> EnergyBasisSwap
-> GenForeignPtr
     (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap'))
     CEnergyCommodity'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr
  (AnyOf
     CCommodity'
     (AnyOf
        CEnergyCommodity'
        (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap'))))
  CInstrument'
-> GenForeignPtr
     (AnyOf
        CEnergyCommodity'
        (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap')))
     CCommodity'
forall b a c. GenForeignPtr (AnyOf b a) c -> GenForeignPtr a b
peel (GenForeignPtr
   (AnyOf
      CCommodity'
      (AnyOf
         CEnergyCommodity'
         (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap'))))
   CInstrument'
 -> GenForeignPtr
      (AnyOf
         CEnergyCommodity'
         (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap')))
      CCommodity')
-> (EnergyBasisSwap
    -> GenForeignPtr
         (AnyOf
            CCommodity'
            (AnyOf
               CEnergyCommodity'
               (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap'))))
         CInstrument')
-> EnergyBasisSwap
-> GenForeignPtr
     (AnyOf
        CEnergyCommodity'
        (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap')))
     CCommodity'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnergyBasisSwap
-> GenForeignPtr
     (AnyOf
        CCommodity'
        (AnyOf
           CEnergyCommodity'
           (AnyOf CEnergySwap' (ForeignPtr CEnergyBasisSwap'))))
     CInstrument'
forall i. GenInstrument i -> GenForeignPtr i CInstrument'
getInstrument

data CCommodityCashFlow'
type CCommodityCashFlow = ForeignPtr CCommodityCashFlow'
-- |A 'CashFlow'; see the hierarchy under t'GenCashFlow'.
type CommodityCashFlow = GenCashFlow CCommodityCashFlow
foreign import ccall unsafe "ql.h &qlFreeCommodityCashFlow" qlFreeCommodityCashFlow :: FinalizerPtr CCommodityCashFlow'
instance Finalizable CCommodityCashFlow' where finalize :: FinalizerPtr CCommodityCashFlow'
finalize = FinalizerPtr CCommodityCashFlow'
qlFreeCommodityCashFlow
foreign import ccall "ql.h qlCommodityCashFlowAsCashFlow" qlCommodityCashFlowAsCashFlow :: Ptr CCommodityCashFlow' -> IO (Ptr CCashFlow')
instance Upcastable CCommodityCashFlow' where {type Base CCommodityCashFlow' = CCashFlow'; upcast :: Ptr CCommodityCashFlow' -> IO (Ptr (Base CCommodityCashFlow'))
upcast = Ptr CCommodityCashFlow' -> IO (Ptr CCashFlow')
Ptr CCommodityCashFlow' -> IO (Ptr (Base CCommodityCashFlow'))
qlCommodityCashFlowAsCashFlow}
peekCommodityCashFlow :: Ptr CCommodityCashFlow' -> IO CommodityCashFlow
peekCommodityCashFlow :: Ptr CCommodityCashFlow' -> IO CommodityCashFlow
peekCommodityCashFlow = GenForeignPtr CCommodityCashFlow CCashFlow' -> CommodityCashFlow
forall cf. GenForeignPtr cf CCashFlow' -> GenCashFlow cf
GenCashFlow (GenForeignPtr CCommodityCashFlow CCashFlow' -> CommodityCashFlow)
-> (Ptr CCommodityCashFlow'
    -> IO (GenForeignPtr CCommodityCashFlow CCashFlow'))
-> Ptr CCommodityCashFlow'
-> IO CommodityCashFlow
forall (f :: * -> *) b r a.
Functor f =>
(b -> r) -> (a -> f b) -> a -> f r
<.> Ptr CCommodityCashFlow'
-> IO (GenForeignPtr CCommodityCashFlow CCashFlow')
Ptr CCommodityCashFlow'
-> IO (GenForeignPtr CCommodityCashFlow (Base CCommodityCashFlow'))
forall a.
(Finalizable a, Upcastable a, Finalizable (Base a)) =>
Ptr a -> IO (GenForeignPtr (ForeignPtr a) (Base a))
newGenForeignPtr
withCommodityCashFlow :: CommodityCashFlow -> (Ptr CCommodityCashFlow' -> IO b) -> IO b
withCommodityCashFlow :: forall b.
CommodityCashFlow -> (Ptr CCommodityCashFlow' -> IO b) -> IO b
withCommodityCashFlow = CCommodityCashFlow -> (Ptr CCommodityCashFlow' -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (CCommodityCashFlow -> (Ptr CCommodityCashFlow' -> IO b) -> IO b)
-> (CommodityCashFlow -> CCommodityCashFlow)
-> CommodityCashFlow
-> (Ptr CCommodityCashFlow' -> IO b)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenForeignPtr CCommodityCashFlow CCashFlow' -> CCommodityCashFlow
forall a b. GenForeignPtr a b -> a
ptr (GenForeignPtr CCommodityCashFlow CCashFlow' -> CCommodityCashFlow)
-> (CommodityCashFlow
    -> GenForeignPtr CCommodityCashFlow CCashFlow')
-> CommodityCashFlow
-> CCommodityCashFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CommodityCashFlow -> GenForeignPtr CCommodityCashFlow CCashFlow'
forall cf. GenCashFlow cf -> GenForeignPtr cf CCashFlow'
getCashFlow
-- |An array of freshly-constructed 'CommodityCashFlow's -- 'EnergySwap.paymentCashFlows()''s
-- @map<Date, shared_ptr<CommodityCashFlow>>@, read as a plain list (each element's own
-- 'QuantLib.CashFlow.date' already carries the map key, so it isn't
-- duplicated as a separate tuple field).
peekCommodityCashFlowArray :: Ptr CUInt -> Ptr (Ptr (Ptr CCommodityCashFlow')) -> IO [CommodityCashFlow]
peekCommodityCashFlowArray :: Ptr CUInt
-> Ptr (Ptr (Ptr CCommodityCashFlow')) -> IO [CommodityCashFlow]
peekCommodityCashFlowArray = (Ptr CCommodityCashFlow' -> IO CommodityCashFlow)
-> Ptr CUInt
-> Ptr (Ptr (Ptr CCommodityCashFlow'))
-> IO [CommodityCashFlow]
forall a b.
(Ptr a -> IO b) -> Ptr CUInt -> Ptr (Ptr (Ptr a)) -> IO [b]
peekPtrArray Ptr CCommodityCashFlow' -> IO CommodityCashFlow
peekCommodityCashFlow

withInstrumentArray :: [GenInstrument i] -> ((CUInt, Ptr (Ptr CInstrument')) -> IO b) -> IO b
withInstrumentArray :: forall i b.
[GenInstrument i]
-> ((CUInt, Ptr (Ptr CInstrument')) -> IO b) -> IO b
withInstrumentArray = (GenInstrument i -> (Ptr CInstrument' -> IO b) -> IO b)
-> [GenInstrument i]
-> ((CUInt, Ptr (Ptr CInstrument')) -> IO b)
-> IO b
forall a c r.
(a -> (Ptr c -> IO r) -> IO r)
-> [a] -> ((CUInt, Ptr (Ptr c)) -> IO r) -> IO r
withGenArray GenInstrument i -> (Ptr CInstrument' -> IO b) -> IO b
forall i b. GenInstrument i -> (Ptr CInstrument' -> IO b) -> IO b
withInstrument

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