Last active
August 19, 2017 18:02
-
-
Save deque-blog/3ab28028c16895eba4536a188d70b1e6 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
data SameCurrency : (m1, m2: Money) -> Type where | |
MkSameCurrency : (currency m1 = currency m2) -> SameCurrency m1 m2 | |
sameCurrency : (lhs, rhs : Money) -> Dec (SameCurrency lhs rhs) | |
sameCurrency lhs rhs = | |
case decEq (currency lhs) (currency rhs) of | |
Yes prf => Yes (MkSameCurrency prf) | |
No contra => No $ \(MkSameCurrency sameCurr) => contra sameCurr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment