Closed j14159 closed 7 years ago
Just a thought, we might want to make |
optional for the first clause rather than requiring its absence, e.g.
fn
x -> ...
| y -> ...
and
fn
| x -> ...
| y -> ...
should maybe both just work with the same changes applied for pattern matches, etc.
The first |
is optional in OCaml for comparison, in match
as well.
Yeah, I think it might make sense to do the same in Alpaca - a little simpler to line things up.
Per discussion on PR #135 I think we should probably add simple multi-head lambdas in the vein of OCaml for single-argument lambdas. Example of the potential syntax based on the discussion so far:
We'll likely want to make guards available here as well. This should be pretty easy to parse, likely requires minimal changes to AST generation, and requires no changes for the typer and code generation.
Additional feedback, comments, and suggestions all welcome.