penny- Extensible double-entry accounting system

Safe HaskellSafe-Inferred




class Equivalent a whereSource

Comparisons for equivalency. Two items are equivalent if they have the same semantic meaning, even if the data in the two items is different.


equivalent :: a -> a -> BoolSource

compareEv :: a -> a -> OrderingSource

Compares based on equivalency.


Equivalent SpaceBetween 
Equivalent Side 
Equivalent Tags

Tags are equivalent if they have the same tags (even if in a different order).

Equivalent DateTime 
Equivalent Qty 
Equivalent QtyRep 
Equivalent Price

Two Price are equivalent if the From and To are equal and the CountPerUnit is equivalent.

Equivalent CountPerUnit 
Equivalent PostingCore

Two PostingCore are equivalent if the Tags are equivalent and the other data is equal, exlucing the Side and the SpaceBetween, which are not considered at all.

Equivalent TopLineCore

TopLineCore are equivalent if their dates are equivalent and if everything else is equal.

Equivalent PricePoint

PricePoint are equivalent if the dateTime and the Price are equivalent. Other elements of the PricePoint are ignored.

Equivalent a => Equivalent (Maybe a) 
Equivalent q => Equivalent (Entry q) 
Equivalent q => Equivalent (Amount q) 
Equivalent m => Equivalent (Ents m)

Ents are equivalent if the content Ents of each are equivalent. The order of the ents is insignificant.

Equivalent m => Equivalent (Ent m)

Two Ents are equivalent if the entries are equivalent and the metadata is equivalent (whether the Ent is inferred or not is ignored.)

(Equivalent a, Equivalent b) => Equivalent (Either a b) 
(Equivalent a, Equivalent b) => Equivalent (a, b) 
(Equivalent a, Equivalent b, Equivalent c) => Equivalent (a, b, c) 

(==~) :: Equivalent a => a -> a -> BoolSource