Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
class Either
implements AEither<T0, T1>
import { Either } from "https://deno.land/x/careful@v0.0.3-alpha/src/Either.ts";

Constructors

new
Either(values: TLeftOrRight<T0, T1>, traceId?: string)

Properties

_left: NullOr<T0>
_maybeLeft: Maybe<T0>
_maybeRight: Maybe<T1>
_right: NullOr<T1>
_traceId: string
readonly
left: Maybe<T0>
readonly
right: Maybe<T1>

Static Methods

awrap<T0, T1>(cb: TWarpAsyncCallback<T0, T1>): Promise<Maybe<AEither<T0, T1>>>
is<T0, T1>(values: TLeftOrRight<T0, T1>)
isLeft<T>(value: NonNullable<T>): AEither<T, null>
isRight<T>(value: NonNullable<T>): AEither<null, T>
wrap<T0, T1>(cb: TWarpCallback<T0, T1>): Maybe<AEither<T0, T1>>