Skip to content

Commit 9333f45

Browse files
committed
Help type inference for old Javac compilers
1 parent ab5acf2 commit 9333f45

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

core/src/main/java/fj/data/optic/Optional.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,15 @@ public Option<A> getOption(final S s) {
191191

192192
@Override
193193
public <C> F<S, F<C, S>> modifyFunctionF(final F<A, F<C, A>> f) {
194-
return s -> getOption.f(s).option(
194+
return s -> getOption.f(s).<F<C, S>> option(
195195
(C __) -> s,
196196
a -> Function.compose(b -> set.f(b).f(s), f.f(a))
197197
);
198198
}
199199

200200
@Override
201201
public <L> F<S, Either<L, S>> modifyEitherF(final F<A, Either<L, A>> f) {
202-
return s -> getOption.f(s).option(
202+
return s -> getOption.f(s).<Either<L, S>> option(
203203
Either.right(s),
204204
t -> f.f(t).right().map(b -> set.f(b).f(s))
205205
);
@@ -231,7 +231,7 @@ public F<S, Promise<S>> modifyPromiseF(final F<A, Promise<A>> f) {
231231

232232
@Override
233233
public F<S, List<S>> modifyListF(final F<A, List<A>> f) {
234-
return s -> getOption.f(s).option(
234+
return s -> getOption.f(s).<List<S>> option(
235235
() -> List.single(s),
236236
t -> f.f(t).map(b -> set.f(b).f(s))
237237
);
@@ -247,7 +247,7 @@ public F<S, Option<S>> modifyOptionF(final F<A, Option<A>> f) {
247247

248248
@Override
249249
public F<S, Stream<S>> modifyStreamF(final F<A, Stream<A>> f) {
250-
return s -> getOption.f(s).option(
250+
return s -> getOption.f(s).<Stream<S>> option(
251251
() -> Stream.single(s),
252252
t -> f.f(t).map(b -> set.f(b).f(s))
253253
);
@@ -263,15 +263,15 @@ public F<S, P1<S>> modifyP1F(final F<A, P1<A>> f) {
263263

264264
@Override
265265
public <E> F<S, Validation<E, S>> modifyValidationF(final F<A, Validation<E, A>> f) {
266-
return s -> getOption.f(s).option(
266+
return s -> getOption.f(s).<Validation<E, S>> option(
267267
() -> Validation.<E, S> success(s),
268268
t -> f.f(t).map(b -> set.f(b).f(s))
269269
);
270270
}
271271

272272
@Override
273273
public F<S, V2<S>> modifyV2F(final F<A, V2<A>> f) {
274-
return s -> getOption.f(s).option(
274+
return s -> getOption.f(s).<V2<S>> option(
275275
() -> V.v(s, s),
276276
t -> f.f(t).map(b -> set.f(b).f(s))
277277
);

0 commit comments

Comments
 (0)