Created
February 12, 2021 06:00
-
-
Save mgryszko/57b56fc75b5b3a5d15a46ca29ce6e183 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val (x, y, z) = (1.eur, 2.eur, 3.eur) | |
test("associativity") { | |
assert(((x |+| y) |+| z) == (x |+| (y |+| z))) | |
} | |
test("left identity") { | |
assert((Monoid.empty |+| x) == x) | |
} | |
test("right identity") { | |
assert((x |+| Monoid.empty) == x) | |
} | |
implicit class IntToFastMoneyConversions(amount: Int) { | |
val eur: FastMoney = FastMoney.of(amount, "EUR") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment