Skip to content

Commit d7ea7f5

Browse files
committed
update documentation
1 parent 04297ad commit d7ea7f5

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
[![either](https://maven-badges.herokuapp.com/maven-central/io.github.jbock-java/either/badge.svg?subject=either)](https://maven-badges.herokuapp.com/maven-central/io.github.jbock-java/either)
22

3-
### jbock.util::either
3+
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.
46

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`.
1310

0 commit comments

Comments
 (0)