Wrapper types
There are many different way a failure is represented using a wrapper type.
Arrow strives to provide a uniform approach by using different builder functions
(such as the either build for the Either wrapper type).
In this section you can find a reference of the different wrapper types supported by Arrow and sister libraries. Also, you can find more information about particular wrapper types, and how to choose between them.
| Type | Failure | Additional states? | Lives in |
|---|---|---|---|
A? | null | No | |
Option<A> | None | No | |
Result<A> | Failure contains a Throwable, inspection possible at runtime | No | |
Either<E, A> | Left contains value of type E | No | |
Ior<E, A> | Left contains value of type E | Simultaneous success and failure using Both | |
Result<A, E> | Failure contains value of type E | No | Result4k |
Outcome<E, A> | Failure contains value of type E | Absent value | Quiver |
Progressive Outcome<E, A> | Failure contains value of type E | Incomplete value | Pedestal State |
Why nullable types & Option?
Difference between nullable types and Option, and when to use each.
Either & Ior (& Result)
Use cases for Either and Ior.
Outcomes and in-progress
Describing more than success and failure.
Your own error wrappers
Writing your own DSLs with Raise.