Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides internal definitions for modeling and working with FX rates.
Synopsis
- data FXQuote (s :: Nat) = MkFXQuote {
- fxQuoteDate :: !Date
- fxQuotePair :: !CurrencyPair
- fxQuoteRate :: !(Refined Positive (Quantity s))
- fxquote :: (KnownNat s, MonadError String m) => Date -> Currency -> Currency -> Scientific -> m (FXQuote s)
- fxquoteFail :: (KnownNat s, MonadFail m) => Date -> Currency -> Currency -> Scientific -> m (FXQuote s)
- fxquoteUnsafe :: KnownNat s => Date -> Currency -> Currency -> Scientific -> FXQuote s
FX Rate Data Definition
data FXQuote (s :: Nat) Source #
Type encoding for FX rates.
MkFXQuote | |
|
Instances
Eq (FXQuote s) Source # | |
Ord (FXQuote s) Source # | |
Defined in Haspara.Internal.FXQuote | |
KnownNat s => Show (FXQuote s) Source # | |
KnownNat s => ToJSON (FXQuote s) Source # |
|
Defined in Haspara.Internal.FXQuote | |
KnownNat s => FromJSON (FXQuote s) Source # |
|
Constructors
:: (KnownNat s, MonadError String m) | |
=> Date | Date of the FX rate. |
-> Currency | First currency (from) of the FX rate. |
-> Currency | Second currency (to) of the FX rate. |
-> Scientific | FX rate value. |
-> m (FXQuote s) |
Smart constructor for FXQuote
values within MonadError
context.