scala-tron icon indicating copy to clipboard operation
scala-tron copied to clipboard

DSL

Open Rovak opened this issue 7 years ago • 0 comments

Make a DSL similar to https://github.com/typelevel/squants

Prototype: https://scalafiddle.io/sf/wU5kTG8/3

Example

val bitcoins: Bitcoin = Satoshi(500000)
val satoshis: Satoshi = Bitcoin(2)

Bitcoin(2) == Satoshi(200000000)

val sum= Bitcoin(1) + Bitcoin(3)

val wallet = Wallet("0xjk234jlk234ljk234")
wallet send 1.bitcoin to "0xjkl345h43hjk2436kl"

Rovak avatar Jan 29 '18 13:01 Rovak