A porting of safe-money (Haskell)
Blog post: https://ren.zone/articles/safe-money
Features
Newtypes
Via newtype-ts
BigInteger
ExchangeRate
Integer
Natural
NonZeroInteger
Type aliases
NonZeroRational
PositiveRational
Rational
Discrete
declare declare // z: Discrete<"EUR", "cent">console.logz// => EUR cent 5
Dense
console.logd// => EUR 5 / 100
Runtime types for IO validation
Via io-ts
BigInteger
Dense
Discrete
ExchangeRate
Integer
Natural
NonZeroInteger
NonZeroRational
PositiveRational
Rational