Use sugar
The use
expression is syntactic sugar for a regular function call
and an anonymous function.
This code:
use a, b <- my_function next(a) next(b)
Expands into this code:
my_function(fn(a, b) { next(a) next(b) })
To ensure that your use
code works and is as understandable as
possible, the right-hand-side ideally should be a function call rather than a
pipeline or other expression, which is typically more difficult to read.
use
is an expression like everything else in Gleam, so it can be
placed within blocks.