<p dir="ltr">> I prefer the Decimal library for currency.</p>
<p dir="ltr">here is another option to consider:</p>
<p dir="ltr">data Cur = Eur | ...<br>
data Money = Mint Cur Int | Mtup Cur (Int,Int)</p>
<p dir="ltr">precision::Cur -> Int<br>
precision Eur = 2<br>
precision _ = 2</p>
<p dir="ltr">€ 10.02 would be:<br>
Mint Eur 1002<br>
Mtup Eur (10,2)</p>
<p dir="ltr">This adds overhead to computations. However precision and correct currency is guaranteed.<br>
</p>