This PR adds syntactic sugar to match. In particular:
you can use curly braces around the cases, instead of round ones, so match { ... } is equivalent to match ( ... )
instead of writing the match cases as comma-separated arguments, you can write each case enclosed in curly braces. e.g. match( { A -> B } { C -> D } ) is the same as match( A -> B, C -> D ).
So the following are equivalent:
match ( A -> B, C -> D )
match { A -> B, C -> D }
match ( { A -> B } { C -> D } )
match { { A -> B } { C -> D } }
In addition the new cases syntax carries over to definitions, so for example you can write,
This PR adds syntactic sugar to match. In particular:
you can use curly braces around the cases, instead of round ones, so
match { ... }
is equivalent tomatch ( ... )
instead of writing the match cases as comma-separated arguments, you can write each case enclosed in curly braces. e.g.
match( { A -> B } { C -> D } )
is the same asmatch( A -> B, C -> D )
.So the following are equivalent:
In addition the new cases syntax carries over to definitions, so for example you can write,