I built Bankster, a Clojure library for working with money and currencies, with explicit behavior contracts.
It’s "money as data": Money = (Currency, BigDecimal amount), and currencies are managed via a registry (global / dynamically scoped / local) that can represent ISO 4217, crypto, and custom currencies – including deterministic conflict resolution for currency codes.
Highlights:
* BigDecimal everywhere; scale/rounding under control (including non-terminating divisions via rescaling/rounding policies)
* ISO 4217 + crypto + custom currencies (namespaced IDs like crypto/ETH)
* Sum-preserving allocation/distribution ("no lost pennies")
* EDN-friendly: tagged literals #money, #currency, data readers; JSON/EDN serialization
* Operator layer: money.ops and money.inter-ops
I’d love feedback on the contracts, API ergonomics, and the registry approach.
siefca•1h ago
Docs:
README: https://cljdoc.org/d/io.randomseed/bankster/2.1.1/doc/readme
Contracts: https://cljdoc.org/d/io.randomseed/bankster/2.1.1/doc/bankst...