GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — optimize Optional · functionaljava/functionaljava@ba6ad5f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • core/src/main/java/fj/data/optic
    • Optional.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: core/src/main/java/fj/data/optic/Optional.java
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,7 @@ public <L> F<S, Either<L, S>> modifyEitherF(final F<A, Either<L, A>> f) {
206206

207207
@Override
208208
public F<S, IO<S>> modifyIOF(final F<A, IO<A>> f) {
209-
return s -> getOrModify(s).either(
210-
IOFunctions::unit,
211-
t -> IOFunctions.<A, S> map(f.f(t), b -> set.f(b).f(s))
212-
);
209+
return s -> getOption.f(s).option(IOFunctions.unit(s), a -> IOFunctions.<A, S> map(f.f(a), b -> set.f(b).f(s)));
213210
}
214211

215212
@Override
@@ -278,7 +275,7 @@ public F<S, V2<S>> modifyV2F(final F<A, V2<A>> f) {
278275

279276
@Override
280277
public F<S, S> modify(final F<A, A> f) {
281-
return s -> getOrModify(s).either(Function.identity(), a -> set.f(f.f(a)).f(s));
278+
return s -> getOption.f(s).option(s, a -> set.f(f.f(a)).f(s));
282279
}
283280

284281
});

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.