top | item 39547015

(no title)

AEVL | 2 years ago

> First, you can have a type-checker check the currency; that doesn't have to be a runtime error: > Money<Usd> m = …; > There will, of course, be instances where you must handle currency dynamically.

With dependent types, checking for currency validity may be handled at compile-time. (This is touched upon in the post linked in the comment you replied to.)

For the case of conversion between currencies of monetary amounts:

https://github.com/anderslundstedt/type-experiments#type-saf...

discuss

order

No comments yet.