Lambdas
Lambdas, in the reference of the Soma programming language (soma 3.2.4). A block marked ✓ is a whole program that soma check accepts; the others are excerpts.
let doubled = list(1, 2, 3) |> map(x => x * 2)
let evens = data |> filter(x => x % 2 == 0)
let found = data |> find(x => x.id == target)
let has = data |> any(x => x.active)
let ok = data |> all(x => x.valid)
let n = data |> count(x => x.score > 80)
// Block lambda
let enriched = data |> map(s => {
let score = s.x * 2 + s.y
s |> with("score", score)
})
// Reduce
let sum = list(1, 2, 3) |> reduce(0, p => p.acc + p.val)