safe-money-aeson-0.1.1: Instances from the aeson library for the safe-money library.

Safe HaskellNone
LanguageHaskell2010

Money.Aeson

Contents

Description

This module only exports orphan FromJSON and ToJSON instances. Import as:

import Money.Aeson ()

Orphan instances

ToJSON SomeDense Source #

Compatible with Dense

Note: The JSON serialization changed in safe-money version 0.4 (the leading Dense string was dropped from the rendered Value).

Instance details

ToJSON SomeDiscrete Source #

Compatible with Discrete'

Note: The JSON serialization changed in version 0.4 (the leading Discrete string was dropped from the rendered Value).

Instance details

ToJSON SomeExchangeRate Source #

Compatible with ExchangeRate

Note: The JSON serialization changed in safe-money version 0.4 (the leading ExchangeRate string was dropped from the rendered Value).

Instance details

FromJSON SomeDense Source #

Compatible with Dense.

Note: The JSON serialization changed in safe-money version 0.4. However, this instance is still able to cope with the previous format.

Instance details

FromJSON SomeDiscrete Source #

Compatible with Discrete'

Note: The JSON serialization changed in version 0.4. However, this instance is still able to cope with the previous format.

Instance details

FromJSON SomeExchangeRate Source #

Compatible with ExchangeRate

Note: The JSON serialization changed in safe-money version 0.4. However, this instance is still able to cope with the previous format.

Instance details

KnownSymbol currency => ToJSON (Dense currency) Source #

Compatible with SomeDense

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

["BTC", 2, 3]

Note: The JSON serialization changed in version 0.4 (the leading Dense string was dropped from the rendered Value).

Instance details

Methods

toJSON :: Dense currency -> Value #

toEncoding :: Dense currency -> Encoding #

toJSONList :: [Dense currency] -> Value #

toEncodingList :: [Dense currency] -> Encoding #

KnownSymbol currency => FromJSON (Dense currency) Source #

Compatible with SomeDense

Note: The JSON serialization changed in safe-money version 0.4. However, this instance is still able to cope with the previous format.

Instance details

Methods

parseJSON :: Value -> Parser (Dense currency) #

parseJSONList :: Value -> Parser [Dense currency] #

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

Compatible with SomeDiscrete

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

["BTC", 100000000, 1, 43]

Note: The JSON serialization changed in safe-money version 0.4 (the leading Discrete string was dropped from the rendered Value).

Instance details

Methods

toJSON :: Discrete' currency scale -> Value #

toEncoding :: Discrete' currency scale -> Encoding #

toJSONList :: [Discrete' currency scale] -> Value #

toEncodingList :: [Discrete' currency scale] -> Encoding #

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

Compatible with SomeExchangeRate

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

["USD", "JPY", 5, 7]

Note: The JSON serialization changed in version 0.4 (the leading ExchangeRate string was dropped from the rendered Value).

Instance details

Methods

toJSON :: ExchangeRate src dst -> Value #

toEncoding :: ExchangeRate src dst -> Encoding #

toJSONList :: [ExchangeRate src dst] -> Value #

toEncodingList :: [ExchangeRate src dst] -> Encoding #

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

Compatible with SomeDiscrete

Note: The JSON serialization changed in safe-money version 0.4. However, this instance is still able to cope with the previous format.

Instance details

Methods

parseJSON :: Value -> Parser (Discrete' currency scale) #

parseJSONList :: Value -> Parser [Discrete' currency scale] #

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

Compatible with SomeExchangeRate

Note: The JSON serialization changed in version 0.4. However, this instance is still able to cope with the previous format.

Instance details

Methods

parseJSON :: Value -> Parser (ExchangeRate src dst) #

parseJSONList :: Value -> Parser [ExchangeRate src dst] #