This is an experimental Haskell library that explores creating a safe type for representing monetary amounts.
I set up the following requirements:
- The type should allow declaring the number of fractional digits.
- The type should allow declaring the amount's currency and prevent operations on monetary amounts of differring currencies.
- Currency should only allow valid currencies.
-- Can I do not forgetful currency to witness cast?
currencyToWitness :: (c :: Currency) -> CurrencyWitness c
-- The above doesn't work, because (c :: Currency) says that currencyToWitness
-- accepts a paramater of type c, which is a value (of type Currency), so it
-- doesn't work.