Skip to content

Right

Defined in: src/util/Either.ts:81

The Right branch — by convention the primary value.

R

new Right<R>(value): Right<R>

Defined in: src/util/Either.ts:83

R

Right<R>

readonly _tag: "Right"

Defined in: src/util/Either.ts:82


readonly value: R

Defined in: src/util/Either.ts:83

bimap<U, V>(_onLeft, onRight): Either<U, V>

Defined in: src/util/Either.ts:98

Map BOTH sides.

U

V

(l) => U

(r) => V

Either<U, V>


flatMap<L2, R2>(f): Either<L2, R2>

Defined in: src/util/Either.ts:92

Right-biased flatMap.

L2

R2

(r) => Either<L2, R2>

Either<L2, R2>


fold<T>(_onLeft, onRight): T

Defined in: src/util/Either.ts:103

Collapse to a single value.

T

(l) => T

(r) => T

T


forEach(f): void

Defined in: src/util/Either.ts:115

Side-effect on the Right value.

(r) => void

void


getOrElse<U>(_fallback): R

Defined in: src/util/Either.ts:109

Right → the value; fallback ignored.

U

U | ((l) => U)

R


isLeft(): this is Left<never>

Defined in: src/util/Either.ts:85

this is Left<never>


isRight(): this is Right<R>

Defined in: src/util/Either.ts:86

this is Right<R>


map<U>(f): Either<never, U>

Defined in: src/util/Either.ts:89

Right-biased map — transform the inner value.

U

(r) => U

Either<never, U>


mapLeft<U>(_f): Either<U, R>

Defined in: src/util/Either.ts:95

Right passes through mapLeft untouched.

U

(l) => U

Either<U, R>


orElse<R2>(_alt): Either<never, R>

Defined in: src/util/Either.ts:112

Right → self; alternative ignored.

R2

Either<never, R2> | (() => Either<never, R2>)

Either<never, R>


swap(): Either<R, never>

Defined in: src/util/Either.ts:106

Swap the sides.

Either<R, never>


toNullable(): R

Defined in: src/util/Either.ts:118

Optional conversion — Right → the value.

R