lang_2023/tests/lambdas.lang

16 lines
350 B
Text
Raw Normal View History

2023-03-31 12:10:12 +03:00
decl test_lambdas : Unit -> Unit
def test_lambdas = {
const lambda1 = \x -> x * x
// const lambda2 = \(x : #Hash) -> x.hash // ??
const lambda3 = \x y -> x + y
// TODO: type LambdaType = Int -> Int // ?? type keyword ??
// const typed_lambda = \x -> x + 1
const lambda4 = \x -> {
; IO.print x
const y = x + x
return y
}
}