Skip to content

Commit c09a928

Browse files
authored
Update README.md
1 parent 0fac073 commit c09a928

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ Repeating the result type in the `map` operation is necessary, due to a limitati
3030

3131
### Working with Either
3232

33-
An Either has the familiar methods `map`, `flatMap` and `filter`.
34-
All of these work on *Right* Eithers, and leave a *Left* unchanged.
35-
This is intuitive, because the corresponding methods in `Optional` leave *empty* unchanged.
36-
Symmetrically there are `mapLeft`, `flatMapLeft` and `filterLeft`, which leave a *Right* unchanged instead.
33+
`Either` has the familiar methods from `Optional`: `map`, `flatMap` and `filter`.
34+
These will always return *Left* value unchanged,
35+
just like the corresponding methods in `Optional` which return an *empty* value unchanged.
36+
37+
Symmetrically there are `mapLeft`, `flatMapLeft` and `filterLeft`, which return a *Right* value unchanged.
3738

3839
Finally there is ~~ifPresentOrElse~~ `ifLeftOrElse` (1.3) and the all-powerful `fold` method,
3940
as well as `getRight` and `getLeft` to convert back to `Optional`.

0 commit comments

Comments
 (0)