-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Types representing standard and non-standard currencies
--   
--   This package provides two types for representing currencies, one that
--   can only represent ISO4217 currencies, and one that can also represent
--   nonstandard currencies.
--   
--   An IsString instance is provided for convenience on the general type.
--   
--   Instances of Eq, Ord, and, Hashable are provided for use as keys.
--   
--   The Enum instance provides a mapping to/from ISO4217 numeric codes for
--   currencies that have such a code.
@package currency
@version 0.2.0.0


-- | A representation of both ISO4217 and nonstandard currencies
module Currency

-- | Either an <a>ISO4217Currency</a> or a nonstandard currency
data Currency
ISO4217Currency :: ISO4217Currency -> Currency
NonStandardCurrency :: String -> Currency

-- | ISO4217 currency, either national or non-national
data ISO4217Currency
NationalCurrency :: CountryCode -> Char -> ISO4217Currency
NonNationalCurrency :: Char -> Char -> ISO4217Currency

-- | The number of fractional decimal places in an amount of a
--   <a>Currency</a> or <a>ISO4217Currency</a>
minorUnits :: MinorUnits a => a -> Maybe Int
instance GHC.Classes.Ord Currency.Currency
instance GHC.Classes.Eq Currency.Currency
instance GHC.Classes.Ord Currency.ISO4217Currency
instance GHC.Classes.Eq Currency.ISO4217Currency
instance Currency.MinorUnits Currency.Currency
instance Currency.MinorUnits Currency.ISO4217Currency
instance GHC.Show.Show Currency.Currency
instance GHC.Read.Read Currency.Currency
instance Data.String.IsString Currency.Currency
instance Data.Hashable.Class.Hashable Currency.Currency
instance GHC.Enum.Enum Currency.Currency
instance GHC.Show.Show Currency.ISO4217Currency
instance GHC.Read.Read Currency.ISO4217Currency
instance Data.Hashable.Class.Hashable Currency.ISO4217Currency
instance GHC.Enum.Enum Currency.ISO4217Currency

module Currency.Rates

-- | A map from currency to exchange rate against some reference currency
data Rates a b
Rates :: a -> Map a b -> Rates a b
[reference] :: Rates a b -> a
[rates] :: Rates a b -> Map a b

-- | Change the reference currency to a different one found in the
--   <a>Map</a>
rebase :: (Ord a, Fractional b) => a -> Rates a b -> Rates a b

-- | Convenience function for getting a single exchange rate
--   
--   If you're doing a lot of conversions, use <a>rebase</a> and
--   <a>lookup</a>
exchangeRate :: (Ord a, Fractional b) => Rates a b -> a -> a -> Maybe b
instance (GHC.Classes.Eq a, GHC.Classes.Eq b) => GHC.Classes.Eq (Currency.Rates.Rates a b)
instance (GHC.Classes.Ord a, GHC.Read.Read a, GHC.Read.Read b) => GHC.Read.Read (Currency.Rates.Rates a b)
instance (GHC.Show.Show a, GHC.Show.Show b) => GHC.Show.Show (Currency.Rates.Rates a b)
