The currency-convert package

[Tags:bsd3, library]

A typesafe currency conversion system with a various exchange rate sources for over 30 currencies.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.1.0, 0.2.1.0
Dependencies aeson (==0.9.*), base (==4.8.*), http-conduit (==2.2.*), text (==1.2.*), unordered-containers (==0.2.*) [details]
License BSD3
Author Tuomas Laakkonen
Maintainer pigworts2@gmail.com
Category Data
Home page http://tuomas56.github.io/currency-convert
Uploaded Tue Aug 16 13:48:04 UTC 2016 by pigworts2
Distributions NixOS:0.2.1.0
Downloads 96 total (15 in the last 30 days)
Votes
1 []
Status Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for currency-convert

Readme for currency-convert-0.2.1.0

currency-convert

Property | Value ------------|---------------------- Module | Data.Currency.Convert Description | Typesafe currency coversion using exchange rates from various sources. Copyright | © Tuomas Laakkonen 2016 License | BSD3 Maintainer | pigworts2@gmail.com Stability | Experimental Portability | Non-portable (GHC extensions)

This module allows values of currency to be converted from one currency to another using exchange rates from various sources.

The basic operation for this module is as follows:

First, get a conversion function (with getDefaultConverter or getConverter):

    >>> Converter convert <- getDefaultConverter

Then, construct some value of currency using the convenience functions, and convert it using the convert function you just got:

    >>> convert (usd 100) :: EUR
    90.0 eur

The result type of convert defines what currency the value will be converted into.

Currency implements Num, Fractional and Real so the usual arithmetic operations are defined, and its value can be extracted with toRational.