safe-money-xmlbf-0.1.2: Instances from the xmlbf library for the safe-money library.

Safe HaskellNone
LanguageHaskell2010

Money.Xmlbf

Contents

Description

This module only exports orphan FromXml and ToXml instances. Import as:

import Money.Xmlbf ()

Orphan instances

FromXml SomeDense Source #

Compatible with Dense.

Instance details

FromXml SomeDiscrete Source #

Compatible with Discrete'

Instance details

FromXml SomeExchangeRate Source #

Compatible with ExchangeRate

Instance details

ToXml SomeDense Source #

Compatible with Dense

Instance details

Methods

toXml :: SomeDense -> [Node] #

ToXml SomeDiscrete Source #

Compatible with Discrete'

Instance details

Methods

toXml :: SomeDiscrete -> [Node] #

ToXml SomeExchangeRate Source #

Compatible with ExchangeRate

Instance details

Methods

toXml :: SomeExchangeRate -> [Node] #

KnownSymbol currency => FromXml (Dense currency) Source #

Compatible with SomeDense

Instance details

Methods

fromXml :: Parser (Dense currency) #

KnownSymbol currency => ToXml (Dense currency) Source #

Compatible with SomeDense

Example rendering dense (2 % 3) :: Dense "BTC":

<money-dense c="BTC" n="2" d="3"/>
Instance details

Methods

toXml :: Dense currency -> [Node] #

(KnownSymbol currency, GoodScale scale) => FromXml (Discrete' currency scale) Source #

Compatible with SomeDiscrete

Instance details

Methods

fromXml :: Parser (Discrete' currency scale) #

(KnownSymbol src, KnownSymbol dst) => FromXml (ExchangeRate src dst) Source #

Compatible with SomeExchangeRate

Instance details

Methods

fromXml :: Parser (ExchangeRate src dst) #

(KnownSymbol currency, GoodScale scale) => ToXml (Discrete' currency scale) Source #

Compatible with SomeDiscrete

Example rendering discrete 43 :: Discrete "BTC" "satoshi":

<money-discrete c="BTC" n="100000000" d="1" a="43"/>
Instance details

Methods

toXml :: Discrete' currency scale -> [Node] #

(KnownSymbol src, KnownSymbol dst) => ToXml (ExchangeRate src dst) Source #

Compatible with 'Money..SomeExchangeRate'

Example rendering an ExchangeRate constructed with exchangeRate (5 % 7) :: ExchangeRate "USD" "JPY"

<exchange-rate src="USD" dst="JPY" n="5" d="7"/>
Instance details

Methods

toXml :: ExchangeRate src dst -> [Node] #