-
New syntax:
```
f(__) =
[] | 0;
"" | 0;
0 | 0;
[ _ ] | __:0;
[ _ , _ ] | __:0 + __:1;
1
```
Old syntax:
```
f(__) =
0 @ __ ?= [];
0 @ __ ?= "";
0 @ __ ?= 0;
__:0 @ __ ?= [ _ ];
__:0 + __…
evhub updated
10 years ago
-
I think this should pass compilation:
```scala
def foo(x: String, y: String): Bool = match (x, y) {
case ("hello", "goodbye") => true
case (_anyString, _anyString) => false
}
```
But …
-
-
I would like to be able to do somehting like this
``` ruby
Maybe(nil).match do
Some(s) { |v| s }
None(n) { |v| SomeObject.new }
end #=> SomeObject.new
```
Is this possible/is there a better patt…
ianks updated
9 years ago
-
I'm not really sure if I'm missing something, but why are you using `case` to pattern match on a boolean in the _Haskell_ source, when all of those
```
case isVisited of
True -> ...
False -> ...
…
-
```
Matching on cases, performing pattern bindings, and matching whole trees of
patterns needs to be implemented. Some syntax is needed for matching on cases
while binding the whole variant object …
-
I just read this article : http://kerflyn.wordpress.com/2012/05/09/towards-pattern-matching-in-java/
Looks like there's something for FunkyJFunction here :) .
Improvisation based on one of the examp…
-
The following code errors in code production when I try to produce a pattern match against the constructor "_plus" corresponding to the built-in interpretation of "A + B".
```
w: world.
term: string…
-
```
Matching on cases, performing pattern bindings, and matching whole trees of
patterns needs to be implemented. Some syntax is needed for matching on cases
while binding the whole variant object …
-
JIT generates a suboptimal assembly code when I replace plain if statements with pattern-matching. Now I do understand it generates a slightly different IL code, however, when running with optimizatio…