Last active
August 14, 2017 16:34
-
-
Save deque-blog/20fb768e6778cc7dabbfaffcfa4695a2 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
record Money where -- Definition of Money | |
constructor MkMoney -- * With a constructor named MkMoney | |
currency : Currency -- * Containing a currency | |
amount : Amount -- * And an amount of money | |
-- Definition of `add` which takes 2 Money instances and returns a new one | |
add : (m1, m2 : Money) -> Money | |
add m1 m2 = MkMoney (currency m1) (amount m1 + amount m2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment