currency-codes: ISO-4217 Currency Codes

[ data, library, mit ] [ Propose Tags ]
Versions,,,,,, (info)
Change log
Dependencies aeson (>=, base (==4.*), bson (>=0.2.0), deepseq, random (>=, safe (>=0.2), text (>= [details]
License MIT
Copyright (c) 2017-2018 Chordify
Author Chordify
Maintainer Matthias Benkort <>
Category Data
Home page
Bug tracker
Uploaded by KtorZ at Mon Mar 19 17:22:58 UTC 2018
Distributions NixOS:
Downloads 1248 total (57 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-03-19 [all 1 reports]
Hackage Matrix CI

ISO-4217 Currency Codes

[Skip to Readme]




Maintainer's Corner

For package maintainers and hackage trustees

Readme for currency-codes-

[back to package description]

Currency Codes (ISO-4217)


This package mainly provides 2 data types to represent and manipulate currencies according to the ISO 4217 standard.

It also provides a handful of instances for common typeclasses (Show, Read, Random, ToJSON, FromJSON, Val, Data, Typeable, Generic, NFData).


import           Data.Aeson     (ToJSON(..))
import           Data.Currency  (Currency, Alpha(..))
import           GHC.Generics   (Generic)
import qualified Safe
import qualified Data.Aeson     as Aeson
import qualified Data.Currency  as Currency

myCurrencies :: [Currency]
myCurrencies =
  [ Currency.fromAlpha EUR
  , Currency.fromAlpha USD

data Transaction = Transaction
  { amount   :: Integer
  , currency :: Currency
  } deriving (Eq, Show, Generic)

instance ToJSON Transaction where
  toJSON = 
    Aeson.genericToJSON Aeson.defaultOptions


MIT © 2017-2018 Chordify