Transforming `FooValue | BarError` into `Either<FooValue, BarError>`

Is there a way to transform something of type FooValue | BarError into Either<FooValue, BarError>?
Was this page helpful?