You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `Either` type is closely related to `Optional`, but can have different "failure" states, other than only *empty*.
4
+
An `Either` can be used to properly return error messages from stream operations,
5
+
or as a lightweight alternative to exceptions.
4
6
5
-
`Either` is a close relative of `Optional`, but can have different "failure" states, other than only *empty*.
6
-
This has many useful applications. For example, an `Either` can be used to report error conditions from stream operations.
7
-
8
-
There are various good alternatives,
9
-
like [vavr](https://github.com/vavr-io/vavr), [fugue](https://bitbucket.org/atlassian/fugue/src/master/), and [lambda](https://github.com/palatable/lambda).
10
-
This particular project emphasizes interoperability with `Optional`.
11
-
Since `java.util.Optional` can't be extended, `jbock.util::either` comes with its own copy named `io.jbock.util.Optional`,
12
-
with two additional methods `orElseLeft()` and `flatMapLeft()`.
7
+
There are several popular libraries that offer an `Either` type,
8
+
including [vavr](https://github.com/vavr-io/vavr), [fugue](https://bitbucket.org/atlassian/fugue/src/master/), and [lambda](https://github.com/palatable/lambda).
9
+
This particular `Either` might be easier to work with, especially if you're already familiar with `Optional`.
0 commit comments