Skip to content

Commit 7f1a9fe

Browse files
authored
doc: #17 add either doc (#22)
1 parent 15e1ff3 commit 7f1a9fe

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Fp-go is a collection of Functional Programming helpers powered by Golang [1.18]
3737
- [Curry](#curry)
3838
- [Structs](#structs)
3939
- [Option](#option)
40+
- [Either](#either)
4041

4142
## Install
4243

@@ -244,6 +245,12 @@ curryedSum(1)(2)
244245
#### Option
245246

246247
Option represents encapsulation of an optional value, it might be used as the return type of functions which may or may not return a meaningful value when they are applied.
247-
You could instanciate an `opt.Option[T]` with a value with `opt.Some(val)`. If the value is missing you can use `opt.None[T]()`.
248248

249-
Option exports `Some`, `None`, `IsSome`, `IsNone`, `GetOrElse`, `Match`, `Map`, `Chain`.
249+
Option exports `Some`, `None`, `IsSome`, `IsNone`, `Chain`, `Exists`, `Flatten`, `FromError`, `FromErrorFn`, `FromPredicate`, `GetOrElse`, `Map`, `Match`.
250+
251+
#### Either
252+
253+
Either represent a value that can have two possible types. It is common to see Either used to represent a success value `Right` or a failure value `Left`, although that doesn't have to be the case.
254+
An instance of `Either` is either an instance of `Left` or `Right`.
255+
256+
Either exports `Left`, `Right`, `IsLeft`, `IsRight`, `Exists`, `Flatten`, `FromError`, `FromErrorFn`, `FromOption`, `FromPredicate`, `GetOrElse`, `Map`, `MapLeft`, `Match`,

0 commit comments

Comments
 (0)