Functions
Lean 4 | Scala 3 | |
---|---|---|
def isZero (n: Nat) := n == 0 |
def isZero (n: Int) = n == 0 |
|
Parameter ommited | def isZero₁ n := n == 0 | |
Anonymous function | fun n => n == 0 | (n: Int) => n == 0 |
Shord hand | (· == 0) | (_ == 0) |
Using pattern matching | def isZero₄ n := |
def isZero4 (n: Int) = |
Short hand for pattern matching | def isZero₅: Nat -> Bool |
def isZero5: Int => Boolean = |