Match.jl
Match.jl copied to clipboard
Advanced Pattern Matching for Julia
As suggested in https://github.com/JuliaServices/Match.jl/issues/96#issuecomment-1767516997, support some syntax like `@ismatch (vars=A,B,C) [10,9,8] ( ...` to list the variables to be assigned at the start of the block e.g. such that unmatched...
I didn't see this in the docs so I assume it's not possible. It would be really nice to be able to match NamedTuples, e.g. ```julia @match (;a=1, b=2) begin...
This is supported: ``` xs = [1,2,3] @match xs begin [x,y,z] => ... ... end ``` but not this: ``` xs = [1,2,3] @match xs begin Int[x,y,z] => ... ......
See the documentation about "active patterns" in [MLStyle](https://thautwarm.github.io/MLStyle.jl/latest/syntax/pattern.html#active-patterns) and [F#](https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/active-patterns). We should consider supporting those.
in [MLStyle](https://thautwarm.github.io/MLStyle.jl/latest/), a guard is written ```julia @match e begin pattern && if condition end => value end ``` We should support that as well.
The following example in the documentation fails to compile. The error message is `The type `Person` has 3 fields but the pattern expects 1 fields.` ``` personinfo(person) = @match person...
I am thinking since a while, that it would be nice and very julian to match general functional expressions if the inverse of the function is provided, for example ```...
The 2.0 update broke patterns that look like `a.b`. Having these patterns is useful for working with `EnumX` enums because they have to be accessed through their generated module. With...
See this part of an automaton: ``` Node 33 5: («input_value» isa Tuple && «length(input_value)» := length(«input_value») && «length(input_value)» >= 2 && «input_value[-1]» := «input_value»[-1] && «where_0» := e.q1 &&...