currency-convert: Typesafe currency conversion

[ bsd3, data, library ] [ Propose Tags ] [ Report a vulnerability ]

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


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.1.0, 0.2.1.0
Dependencies aeson (>=0.9 && <0.10), base (>=4.8 && <4.9), http-conduit (>=2.2 && <2.3), text (>=1.2 && <1.3), unordered-containers (>=0.2 && <0.3) [details]
License BSD-3-Clause
Author Tuomas Laakkonen
Maintainer pigworts2@gmail.com
Category Data
Home page http://tuomas56.github.io/currency-convert
Uploaded by pigworts2 at 2016-08-16T13:48:04Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2165 total (3 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for currency-convert-0.2.1.0

[back to package description]

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.