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


{-# LINE 1 "./QuantLib/Instrument/Forward.chs" #-}
module QuantLib.Instrument.Forward
  (
    -- * Types
    GenForward
  , Forward
  , ForwardRateAgreement
  , BondForward
  , FxForward

    -- * Constructors
  , asForward
  , forwardRateAgreement
  , bondForward
  , fxForward
  , fxForwardFromRate

    -- * Inspectors
  , cleanForwardPrice
  , forwardPrice
  , forwardValue
  , impliedYield
  , settlementDate
  , spotIncome
  , spotValue
  , amount
  , forwardRate
  , fxForwardRate
  , fairForwardRate
  , npvSourceCurrency
  , npvTargetCurrency
  ) where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.ForeignPtr as C2HSImp
import qualified Foreign.Marshal.Utils as C2HSImp
import qualified Foreign.Ptr as C2HSImp


import QuantLib.Internal
import QuantLib.Internal.Common
import QuantLib.Internal.Type
import QuantLib.InterestRate
{-# LINE 35 "./QuantLib/Instrument/Forward.chs" #-}









{-# LINE 43 "./QuantLib/Instrument/Forward.chs" #-}


{-# LINE 44 "./QuantLib/Instrument/Forward.chs" #-}


{-# LINE 45 "./QuantLib/Instrument/Forward.chs" #-}


{-# LINE 46 "./QuantLib/Instrument/Forward.chs" #-}


{-# LINE 47 "./QuantLib/Instrument/Forward.chs" #-}


{-# LINE 48 "./QuantLib/Instrument/Forward.chs" #-}


{-# LINE 49 "./QuantLib/Instrument/Forward.chs" #-}


{-# LINE 50 "./QuantLib/Instrument/Forward.chs" #-}


{-# LINE 51 "./QuantLib/Instrument/Forward.chs" #-}


-- |FRA with a par-rate approximation: the forward rate is forecast from valueDate to maturityDate by the index's forecast curve (useIndexedCoupon=false).
forwardRateAgreement :: (GenIborIndex ibor) -> (Day) -- ^valueDate
 -> (Day) -- ^maturityDate
 -> (PositionType) -> (Double) -- ^strikeForwardRate
 -> (Double) -- ^notionalAmount
 -> (Maybe (GenYieldTermStructure y)) -- ^discountCurve
 -> IO ((ForwardRateAgreement))
forwardRateAgreement :: forall ibor y.
GenIborIndex ibor
-> Day
-> Day
-> PositionType
-> Double
-> Double
-> Maybe (GenYieldTermStructure y)
-> IO ForwardRateAgreement
forwardRateAgreement GenIborIndex ibor
a1 Day
a2 Day
a3 PositionType
a4 Double
a5 Double
a6 Maybe (GenYieldTermStructure y)
a7 =
  GenIborIndex ibor
-> (Ptr CIborIndex' -> IO ForwardRateAgreement)
-> IO ForwardRateAgreement
forall ibor b.
GenIborIndex ibor -> (Ptr CIborIndex' -> IO b) -> IO b
withIborIndex GenIborIndex ibor
a1 ((Ptr CIborIndex' -> IO ForwardRateAgreement)
 -> IO ForwardRateAgreement)
-> (Ptr CIborIndex' -> IO ForwardRateAgreement)
-> IO ForwardRateAgreement
forall a b. (a -> b) -> a -> b
$ \Ptr CIborIndex'
a1' -> 
  Day -> (CInt -> IO ForwardRateAgreement) -> IO ForwardRateAgreement
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a2 ((CInt -> IO ForwardRateAgreement) -> IO ForwardRateAgreement)
-> (CInt -> IO ForwardRateAgreement) -> IO ForwardRateAgreement
forall a b. (a -> b) -> a -> b
$ \CInt
a2' -> 
  Day -> (CInt -> IO ForwardRateAgreement) -> IO ForwardRateAgreement
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a3 ((CInt -> IO ForwardRateAgreement) -> IO ForwardRateAgreement)
-> (CInt -> IO ForwardRateAgreement) -> IO ForwardRateAgreement
forall a b. (a -> b) -> a -> b
$ \CInt
a3' -> 
  let {a4' :: CInt
a4' = PositionType -> CInt
forall a b. (Enum a, Integral b) => a -> b
fromEnumC PositionType
a4} in 
  let {a5' :: CDouble
a5' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a5} in 
  let {a6' :: CDouble
a6' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a6} in 
  Maybe (GenYieldTermStructure y)
-> (Ptr CYieldTermStructure' -> IO ForwardRateAgreement)
-> IO ForwardRateAgreement
forall y b.
Maybe (GenYieldTermStructure y)
-> (Ptr CYieldTermStructure' -> IO b) -> IO b
withMaybeYieldTermStructure Maybe (GenYieldTermStructure y)
a7 ((Ptr CYieldTermStructure' -> IO ForwardRateAgreement)
 -> IO ForwardRateAgreement)
-> (Ptr CYieldTermStructure' -> IO ForwardRateAgreement)
-> IO ForwardRateAgreement
forall a b. (a -> b) -> a -> b
$ \Ptr CYieldTermStructure'
a7' -> 
  (Ptr (Ptr ()) -> IO ForwardRateAgreement)
-> IO ForwardRateAgreement
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO ForwardRateAgreement)
 -> IO ForwardRateAgreement)
-> (Ptr (Ptr ()) -> IO ForwardRateAgreement)
-> IO ForwardRateAgreement
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a8' -> 
  Ptr CIborIndex'
-> CInt
-> CInt
-> CInt
-> CDouble
-> CDouble
-> Ptr CYieldTermStructure'
-> Ptr (Ptr ())
-> IO (Ptr CForwardRateAgreement')
forwardRateAgreement'_ Ptr CIborIndex'
a1' CInt
a2' CInt
a3' CInt
a4' CDouble
a5' CDouble
a6' Ptr CYieldTermStructure'
a7' Ptr (Ptr ())
a8' IO (Ptr CForwardRateAgreement')
-> (Ptr CForwardRateAgreement' -> IO ForwardRateAgreement)
-> IO ForwardRateAgreement
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CForwardRateAgreement'
res ->
  Ptr CForwardRateAgreement' -> IO ForwardRateAgreement
peekForwardRateAgreement Ptr CForwardRateAgreement'
res IO ForwardRateAgreement
-> (ForwardRateAgreement -> IO ForwardRateAgreement)
-> IO ForwardRateAgreement
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \ForwardRateAgreement
res' ->
  Ptr (Ptr ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck  Ptr (Ptr ())
a8'IO () -> IO ForwardRateAgreement -> IO ForwardRateAgreement
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  ForwardRateAgreement -> IO ForwardRateAgreement
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (ForwardRateAgreement
res')

{-# LINE 60 "./QuantLib/Instrument/Forward.chs" #-}


-- |If strike is given in the constructor, can calculate the NPV of the contract via NPV().If strike/forward price is desired, it can be obtained via forwardPrice(). In this case, the strike variable in the constructor is irrelevant and will be ignored.
bondForward :: (Day) -- ^valueDate
 -> (Day) -- ^maturityDate
 -> (PositionType) -> (Double) -- ^strike
 -> (Word) -- ^settlementDays
 -> (DayCounter) -> (Calendar) -> (BusinessDayConvention) -> (GenBond b) -> (Maybe (GenYieldTermStructure y1)) -- ^discountCurve
 -> (Maybe (GenYieldTermStructure y2)) -- ^incomeDiscountCurve
 -> IO ((BondForward))
bondForward a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 =
  withDay a1 $ \a1' -> 
  withDay a2 $ \a2' -> 
  let {a3' = fromEnumC a3} in 
  let {a4' = realToFrac a4} in 
  let {a5' = fromIntegral a5} in 
  withDayCounter a6 $ \a6' -> 
  withCalendar a7 $ \a7' -> 
  let {a8' = fromEnumC a8} in 
  withBond a9 $ \a9' -> 
  withMaybeYieldTermStructure a10 $ \a10' -> 
  withMaybeYieldTermStructure a11 $ \a11' -> 
  preErrorCheck $ \a12' -> 
  bondForward'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' a10' a11' a12' >>= \res ->
  peekBondForward res >>= \res' ->
  errorCheck  a12'>>
  return (res')

{-# LINE 69 "./QuantLib/Instrument/Forward.chs" #-}


-- |(dirty) forward bond price minus accrued on bond at delivery
cleanForwardPrice :: (BondForward) -> IO ((Double))
cleanForwardPrice a1 =
  withBondForward a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  cleanForwardPrice'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 72 "./QuantLib/Instrument/Forward.chs" #-}


-- |(dirty) forward bond price
forwardPrice :: (BondForward) -> IO ((Double))
forwardPrice a1 =
  withBondForward a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  forwardPrice'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 75 "./QuantLib/Instrument/Forward.chs" #-}


-- |forward value/price of underlying, discounting income/dividends
-- if this is a bond forward price, is must be a dirty forward price.
forwardValue :: (GenForward f) -> IO ((Double))
forwardValue a1 =
  withForward a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  forwardValue'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 79 "./QuantLib/Instrument/Forward.chs" #-}


-- |Simple yield calculation based on underlying spot and forward values, taking into account underlying income. When $ t>0 $, call with: underlyingSpotValue=spotValue(t), forwardValue=strikePrice, to get current yield. For a repo, if $ t=0 $, impliedYield should reproduce the spot repo rate. For FRA's, this should reproduce the relevant zero rate at the FRA's maturityDate_;
impliedYield :: (GenForward f) -> (Double) -- ^underlyingSpotValue
 -> (Double) -- ^forwarValue
 -> (Day) -- ^settlementDate
 -> (Compounding) -> (DayCounter) -> IO ((InterestRate))
impliedYield a1 a2 a3 a4 a5 a6 =
  withForward a1 $ \a1' -> 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  withDay a4 $ \a4' -> 
  let {a5' = (fromIntegral . fromEnum) a5} in 
  withDayCounter a6 $ \a6' -> 
  preErrorCheck $ \a7' -> 
  impliedYield'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  peekInterestRate res >>= \res' ->
  errorCheck  a7'>>
  return (res')

{-# LINE 85 "./QuantLib/Instrument/Forward.chs" #-}


-- |Date on which the forward contract settles.
settlementDate :: (GenForward f) -> IO ((Day))
settlementDate a1 =
  withForward a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  settlementDate'_ a1' a2' >>= \res ->
  let {res' = toDay res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 88 "./QuantLib/Instrument/Forward.chs" #-}


-- |NPV of income/dividends/storage-costs etc. of underlying instrument.
spotIncome :: (GenForward f) -> (GenYieldTermStructure y) -> IO ((Double))
spotIncome a1 a2 =
  withForward a1 $ \a1' -> 
  withYieldTermStructure a2 $ \a2' -> 
  preErrorCheck $ \a3' -> 
  spotIncome'_ a1' a2' a3' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a3'>>
  return (res')

{-# LINE 91 "./QuantLib/Instrument/Forward.chs" #-}


-- |returns spot value/price of an underlying financial instrument
spotValue :: (GenForward f) -> IO ((Double))
spotValue a1 =
  withForward a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  spotValue'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 94 "./QuantLib/Instrument/Forward.chs" #-}


-- |Returns the relevant forward rate associated with the FRA term.
forwardRate :: (ForwardRateAgreement) -> IO ((InterestRate))
forwardRate a1 =
  withGenInstrument a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  forwardRate'_ a1' a2' >>= \res ->
  peekInterestRate res >>= \res' ->
  errorCheck  a2'>>
  return (res')

{-# LINE 97 "./QuantLib/Instrument/Forward.chs" #-}


-- |The payoff on the value date: the discounted difference between the FRA's forward rate and
-- its strike (contract) rate, scaled by the notional and accrual, negated for a short position.
amount :: (ForwardRateAgreement) -> IO ((Double))
amount a1 =
  withGenInstrument a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  amount'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 101 "./QuantLib/Instrument/Forward.chs" #-}


-- |FX forward using nominal amounts in both currencies.
fxForward :: (Double) -- ^sourceNominal
 -> (Currency) -- ^sourceCurrency
 -> (Double) -- ^targetNominal
 -> (Currency) -- ^targetCurrency
 -> (Day) -- ^maturityDate
 -> (Bool) -- ^paySourceCurrency
 -> (Word) -- ^settlementDays
 -> (Calendar) -- ^paymentCalendar
 -> IO ((FxForward))
fxForward :: Double
-> Currency
-> Double
-> Currency
-> Day
-> Bool
-> Word
-> Calendar
-> IO FxForward
fxForward Double
a1 Currency
a2 Double
a3 Currency
a4 Day
a5 Bool
a6 Word
a7 Calendar
a8 =
  let {a1' :: CDouble
a1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a1} in 
  Currency -> (Ptr CCurrency -> IO FxForward) -> IO FxForward
forall b. Currency -> (Ptr CCurrency -> IO b) -> IO b
withCurrency Currency
a2 ((Ptr CCurrency -> IO FxForward) -> IO FxForward)
-> (Ptr CCurrency -> IO FxForward) -> IO FxForward
forall a b. (a -> b) -> a -> b
$ \Ptr CCurrency
a2' -> 
  let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in 
  Currency -> (Ptr CCurrency -> IO FxForward) -> IO FxForward
forall b. Currency -> (Ptr CCurrency -> IO b) -> IO b
withCurrency Currency
a4 ((Ptr CCurrency -> IO FxForward) -> IO FxForward)
-> (Ptr CCurrency -> IO FxForward) -> IO FxForward
forall a b. (a -> b) -> a -> b
$ \Ptr CCurrency
a4' -> 
  Day -> (CInt -> IO FxForward) -> IO FxForward
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a5 ((CInt -> IO FxForward) -> IO FxForward)
-> (CInt -> IO FxForward) -> IO FxForward
forall a b. (a -> b) -> a -> b
$ \CInt
a5' -> 
  let {a6' :: CInt
a6' = Bool -> CInt
forall a. Num a => Bool -> a
C2HSImp.fromBool Bool
a6} in 
  let {a7' :: CUInt
a7' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a7} in 
  Calendar -> (Ptr CCalendar -> IO FxForward) -> IO FxForward
forall b. Calendar -> (Ptr CCalendar -> IO b) -> IO b
withCalendar Calendar
a8 ((Ptr CCalendar -> IO FxForward) -> IO FxForward)
-> (Ptr CCalendar -> IO FxForward) -> IO FxForward
forall a b. (a -> b) -> a -> b
$ \Ptr CCalendar
a8' -> 
  (Ptr (Ptr ()) -> IO FxForward) -> IO FxForward
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr ()) -> IO FxForward) -> IO FxForward)
-> (Ptr (Ptr ()) -> IO FxForward) -> IO FxForward
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
a9' -> 
  CDouble
-> Ptr CCurrency
-> CDouble
-> Ptr CCurrency
-> CInt
-> CInt
-> CUInt
-> Ptr CCalendar
-> Ptr (Ptr ())
-> IO (Ptr CFxForward')
fxForward'_ CDouble
a1' Ptr CCurrency
a2' CDouble
a3' Ptr CCurrency
a4' CInt
a5' CInt
a6' CUInt
a7' Ptr CCalendar
a8' Ptr (Ptr ())
a9' IO (Ptr CFxForward')
-> (Ptr CFxForward' -> IO FxForward) -> IO FxForward
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CFxForward'
res ->
  Ptr CFxForward' -> IO FxForward
peekFxForward Ptr CFxForward'
res IO FxForward -> (FxForward -> IO FxForward) -> IO FxForward
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \FxForward
res' ->
  Ptr (Ptr ()) -> IO ()
forall a. Ptr (Ptr a) -> IO ()
errorCheck  Ptr (Ptr ())
a9'IO () -> IO FxForward -> IO FxForward
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
  FxForward -> IO FxForward
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (FxForward
res')

{-# LINE 112 "./QuantLib/Instrument/Forward.chs" #-}


-- |FX forward using a source nominal amount and a contracted forward rate (target/source).
fxForwardFromRate :: (Double) -- ^sourceNominal
 -> (Currency) -- ^sourceCurrency
 -> (Currency) -- ^targetCurrency
 -> (Double) -- ^forwardRate
 -> (Day) -- ^maturityDate
 -> (Bool) -- ^paySourceCurrency
 -> (Word) -- ^settlementDays
 -> (Calendar) -- ^paymentCalendar
 -> IO ((FxForward))
fxForwardFromRate a1 a2 a3 a4 a5 a6 a7 a8 =
  let {a1' = realToFrac a1} in 
  withCurrency a2 $ \a2' -> 
  withCurrency a3 $ \a3' -> 
  let {a4' = realToFrac a4} in 
  withDay a5 $ \a5' -> 
  let {a6' = C2HSImp.fromBool a6} in 
  let {a7' = fromIntegral a7} in 
  withCalendar a8 $ \a8' -> 
  preErrorCheck $ \a9' -> 
  fxForwardFromRate'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
  peekFxForward res >>= \res' ->
  errorCheck  a9'>>
  return (res')

{-# LINE 123 "./QuantLib/Instrument/Forward.chs" #-}


-- |The contracted forward exchange rate (target\/source), computed as @targetNominal \/
-- sourceNominal@ -- distinct from 'fairForwardRate', the market-implied rate.
fxForwardRate :: (FxForward) -> IO ((Double))
fxForwardRate a1 =
  withGenInstrument a1 $ \a1' -> 
  fxForwardRate'_ a1' >>= \res ->
  let {res' = realToFrac res} in
  return (res')

{-# LINE 127 "./QuantLib/Instrument/Forward.chs" #-}


-- |The market-implied fair forward rate, computed by the pricing engine.
fairForwardRate :: (FxForward) -> IO ((Double))
fairForwardRate a1 =
  withGenInstrument a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  fairForwardRate'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 130 "./QuantLib/Instrument/Forward.chs" #-}


-- |NPV in source currency terms.
npvSourceCurrency :: (FxForward) -> IO ((Double))
npvSourceCurrency a1 =
  withGenInstrument a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  npvSourceCurrency'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 133 "./QuantLib/Instrument/Forward.chs" #-}


-- |NPV in target currency terms.
npvTargetCurrency :: (FxForward) -> IO ((Double))
npvTargetCurrency a1 =
  withGenInstrument a1 $ \a1' -> 
  preErrorCheck $ \a2' -> 
  npvTargetCurrency'_ a1' a2' >>= \res ->
  let {res' = realToFrac res} in
  errorCheck  a2'>>
  return (res')

{-# LINE 136 "./QuantLib/Instrument/Forward.chs" #-}


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

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlForwardRateAgreement"
  forwardRateAgreement'_ :: ((C2HSImp.Ptr (CIborIndex')) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CForwardRateAgreement')))))))))))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlBondForward"
  bondForward'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CDayCounter)) -> ((C2HSImp.Ptr (CCalendar)) -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CBond')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CBondForward')))))))))))))))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlBondForwardCleanForwardPrice"
  cleanForwardPrice'_ :: ((C2HSImp.Ptr (CBondForward')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlBondForwardForwardPrice"
  forwardPrice'_ :: ((C2HSImp.Ptr (CBondForward')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlForwardForwardValue"
  forwardValue'_ :: ((C2HSImp.Ptr (CForward')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlForwardImpliedYield"
  impliedYield'_ :: ((C2HSImp.Ptr (CForward')) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr (CDayCounter)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CInterestRate))))))))))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlForwardSettlementDate"
  settlementDate'_ :: ((C2HSImp.Ptr (CForward')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CInt)))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlForwardSpotIncome"
  spotIncome'_ :: ((C2HSImp.Ptr (CForward')) -> ((C2HSImp.Ptr (CYieldTermStructure')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble))))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlForwardSpotValue"
  spotValue'_ :: ((C2HSImp.Ptr (CForward')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlForwardRateAgreementForwardRate"
  forwardRate'_ :: ((C2HSImp.Ptr (CForwardRateAgreement')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CInterestRate)))))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlForwardRateAgreementAmount"
  amount'_ :: ((C2HSImp.Ptr (CForwardRateAgreement')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlFxForward"
  fxForward'_ :: (C2HSImp.CDouble -> ((C2HSImp.Ptr (CCurrency)) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CCurrency)) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CCalendar)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CFxForward'))))))))))))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlFxForward1"
  fxForwardFromRate'_ :: (C2HSImp.CDouble -> ((C2HSImp.Ptr (CCurrency)) -> ((C2HSImp.Ptr (CCurrency)) -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (CCalendar)) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO (C2HSImp.Ptr (CFxForward'))))))))))))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlFxForwardForwardRate"
  fxForwardRate'_ :: ((C2HSImp.Ptr (CFxForward')) -> (IO C2HSImp.CDouble))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlFxForwardFairForwardRate"
  fairForwardRate'_ :: ((C2HSImp.Ptr (CFxForward')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlFxForwardNpvSourceCurrency"
  npvSourceCurrency'_ :: ((C2HSImp.Ptr (CFxForward')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))

foreign import ccall safe "QuantLib/Instrument/Forward.chs.h qlFxForwardNpvTargetCurrency"
  npvTargetCurrency'_ :: ((C2HSImp.Ptr (CFxForward')) -> ((C2HSImp.Ptr (C2HSImp.Ptr ())) -> (IO C2HSImp.CDouble)))