Created
September 3, 2024 09:34
-
-
Save nagat01/1e58b6a33aed15de82840c36149d4c12 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
class Nat | |
case class Add(val l: Nat, val r: Nat) | |
extension (a: Add) | |
def comm = Add(a.r, a.l) | |
@main def main = | |
val n = Nat() | |
val m = Nat() | |
val el = Add(n, m) | |
val er = Add(m, n) | |
println(el.comm == er) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment