Skip to content

Commit a21d64f

Browse files
committed
__
1 parent e0cc5cd commit a21d64f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/java/com/jnape/palatable/lambda/Spike.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import static com.jnape.palatable.lambda.structural.Case.of;
2323
import static com.jnape.palatable.lambda.structural.Cases.cases;
2424
import static com.jnape.palatable.lambda.structural.Matcher.$;
25+
import static com.jnape.palatable.lambda.structural.Matcher.__;
2526
import static com.jnape.palatable.lambda.structural.Matchers.$just;
2627
import static com.jnape.palatable.lambda.structural.Matchers.$right;
2728
import static com.jnape.palatable.lambda.structural.Struct.struct;
@@ -126,7 +127,7 @@ public Maybe<Integer> getBaz() {
126127
Foo foo = new Foo();
127128

128129
String match1 = struct(() -> Either.<String, Integer>right(2), () -> "foo")
129-
.match(cases(of($right(1), $(), (x, y) -> x + y),
130+
.match(cases(of($right(1), __(), (x, y) -> x + y),
130131
of($(), $(), (x, y) -> x + y)));
131132

132133
System.out.println(match1);

src/main/java/com/jnape/palatable/lambda/structural/Matcher.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ public interface Matcher<A, B> {
2121
return Any.INSTANCE;
2222
}
2323

24+
static <A> Any<A> __() {
25+
return $();
26+
}
27+
2428
static <A> Matcher<A, A> $(A a) {
2529
return $(eq(a));
2630
}

0 commit comments

Comments
 (0)