eurofxref-0.1.0: Free foreign exchange/currency feed from the European Central Bank

Financial.EuroFXRef

Contents

Description

Example using ghci, where we read the currency rates relative to Euros, and re-base them to hard currency.

 > :m Financial.EuroFXRef Data.Map
 > fmap (assocs . raRates . rebase (Currency "NZD")) fetch :: IO [(Currency, Double)]
 [(Currency "AUD",0.7696441703909034),(Currency "BGN",1.1064094586185438),...

Each number is one unit of the reference currency in that currency, e.g. in this example NZD 1 == AUD 0.77.

Synopsis

Simple

fetch :: (Failure EuropeanCentralBankException m, Failure HttpException m, MonadIO m, Read a) => m (Rates a)Source

Fetch daily currency rates from European Central Bank server.

IO works for m and Double for a.

Lower-level

europeanCentralBankDaily :: Failure HttpException m => m (Request m)Source

The URL for the European Central Bank's free daily reference rates.

fetchFrom :: (Failure EuropeanCentralBankException m, Failure HttpException m, MonadIO m, Read a) => Request m -> m (Rates a)Source

Fetch from a specified URL.

parseEuropeanCentralBank :: Read a => UNode String -> Either String (Rates a)Source

Parse the European Central Bank's XML format.