forked from orion/obsidian
425 B
425 B
lambda functions are anonymous functions (as opposed to Functions) that can be written anywhere:
\ <params> -> <body>
prependHello a = "hello, " <> a
appendName = \a -> a <> "henry!"
str = appendName $ prependHello ""
-- hello, henry!
their parameters can destructure their arguments:
let
getFoo = \{foo} -> foo
in
getFoo {foo: "hello"}
-- "hello"