commodities-0.2.0: Library for working with commoditized amounts and price histories

Safe HaskellNone

Ledger.Balance

Synopsis

Documentation

data Balance a Source

A value representing either zero (all zeroes are equivalent), a commoditized value, or a vector space of values indexed by commodity.

Constructors

Zero 
Plain a

An uncommoditized integer

Amount Commodity a

A single commoditized amount

Balance (IntMap a)

A vector-space over commodities

insert :: Int -> a -> Balance a -> Balance aSource

balanceStore :: Indexable f => Key f -> f a -> Store (Key f) aSource