@@ -55,11 +55,7 @@ public <J> Result<J, A> mapRest(final F<I, J> f) {
5555 * @return A first-class function mapping across the remainder of the parse input.
5656 */
5757 public <J > F <F <I , J >, Result <J , A >> mapRest () {
58- return new F <F <I , J >, Result <J , A >>() {
59- public Result <J , A > f (final F <I , J > f ) {
60- return mapRest (f );
61- }
62- };
58+ return f -> mapRest (f );
6359 }
6460
6561 /**
@@ -78,11 +74,7 @@ public <B> Result<I, B> mapValue(final F<A, B> f) {
7874 * @return A first-class function mapping across the parse value.
7975 */
8076 public <B > F <F <A , B >, Result <I , B >> mapValue () {
81- return new F <F <A , B >, Result <I , B >>() {
82- public Result <I , B > f (final F <A , B > f ) {
83- return mapValue (f );
84- }
85- };
77+ return f -> mapValue (f );
8678 }
8779
8880 /**
@@ -102,11 +94,7 @@ public <B, J> Result<J, B> bimap(final F<I, J> f, final F<A, B> g) {
10294 * @return A first-class bifunctor map.
10395 */
10496 public <B , J > F <F <I , J >, F <F <A , B >, Result <J , B >>> bimap () {
105- return curry (new F2 <F <I , J >, F <A , B >, Result <J , B >>() {
106- public Result <J , B > f (final F <I , J > f , final F <A , B > g ) {
107- return bimap (f , g );
108- }
109- });
97+ return curry ((f , g ) -> bimap (f , g ));
11098 }
11199
112100 /**
@@ -154,10 +142,7 @@ public static <A, I> Result<I, A> result(final I i, final A a) {
154142 * @return A first-class function for construction of a result.
155143 */
156144 public static <A , I > F <I , F <A , Result <I , A >>> result () {
157- return curry (new F2 <I , A , Result <I , A >>() {
158- public Result <I , A > f (final I i , final A a ) {
159- return result (i , a );
160- }
161- });
145+ return curry ((i , a ) -> result (i , a ));
162146 }
147+
163148}
0 commit comments