Scala DSL for currency-related operations

A simple internal DSL in Scala for money-related operations Source code: Scala DSL for money-related operations This Domain-Specific Language (DSL) lets you perform operations among different currencies, by transparently doing all internal conversions. The conversion map is injected implicitly by the client code. Usage Example Here’s a simple usage example: importcom.lambdista.money._importcom.lambdista.money.Currency._objectMain{defmain(args:Array[String]):Unit={valconversion:Conversion=Map((GBP,EUR)->1.270,(EUR,USD)->1.268,(GBP,USD)->1.611)implicitvalconverter=Converter(conversion)valsumAndConversion1=100.001(USD)+200(EUR)toGBPprintln(s"sumAndConversion1: $sumAndConversion1")valsumAndConversion2:Money=100(USD)+210.4(EUR)toEURprintln(s"sumAndConversion2: $sumAndConversion2")valsum=100.001(USD)+200(EUR)valsimpleConversion=sum(GBP)println(s"simpleConversion: $simpleConversion")valsumWithSimpleNumber=100(USD)+23.560println(s"sumWithSimpleNumber: $sumWithSimpleNumber")valmultiplicationWithSimpleNumber=100(USD)*23println(s"multiplicationWithSimpleNumber: $multiplicationWithSimpleNumber")valusd=Currency("USD")valmultiplication=100(usd)*23(EUR)println(s"multiplication: $multiplication")valdivisionWithSimpleNumber=100(USD)/23println(s"divisionWithSimpleNumber: $divisionWithSimpleNumber")valcomparison=100(USD)>90(EUR)println(s"100 USD > 90 EUR? $comparison")}} As you can see the client code just needs two simple imports and an implicit value of type Converter in order to use the DSL.