by klauserc · 2y ago · 0 comments
if foo(args)
== 0 then "null"
|> abs
> 100 then "large"
< 10 then "small"
else "medium"
That last syntax took me a while to parse in the paper, but I can imagine numerous places in our everyday code where such syntax would more concisely capture intent. if e is
...
Lit(value)
and Map.find_opt(value) is Some(result)
then Some(result)
...
where the `...` may include many cases and may contain other Lit cases.Or this variation:
...
Lit(value)
and Map.find_opt(value) is Some(result)
and computation(result) is
Left(a) then ...
Right(b) then ...
...