The Haskell `safe-money` library offers type-safe and lossless encoding and operations for monetary values in all world currencies, including fiat currencies, precious metals and crypto-currencies. You can enter a development shell with `nix-shell`, or build with `nix build -f release.nix ghc822.safe-money` (or similar, check `release.nix`).