
5 Mar
2016
5 Mar
'16
8:26 a.m.
I prefer the Decimal library for currency.
here is another option to consider: data Cur = Eur | ... data Money = Mint Cur Int | Mtup Cur (Int,Int) precision::Cur -> Int precision Eur = 2 precision _ = 2 € 10.02 would be: Mint Eur 1002 Mtup Eur (10,2) This adds overhead to computations. However precision and correct currency is guaranteed.