penny-lib-0.12.0.0: Extensible double-entry accounting system - library

Safe HaskellNone

Penny.Lincoln.Bits.Price

Synopsis

Documentation

newtype From Source

Constructors

From 

Fields

unFrom :: Commodity
 

Instances

newtype To Source

Constructors

To 

Fields

unTo :: Commodity
 

Instances

data Price Source

Instances

convert :: Price -> Amount -> Maybe AmountSource

Convert an amount from the From price to the To price. Fails if the From commodity in the Price is not the same as the commodity in the Amount.

newPrice :: From -> To -> CountPerUnit -> Maybe PriceSource

Succeeds only if From and To are different commodities.