getInitializableEither
import { getInitializableEither } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/either.ts";Create an Initializable instance for Either given Initializable instances for both Left and Right types. The init value is a Right containing the initial value of the Right type.
@example
import * as E from "./either.ts";
import * as S from "./string.ts";
import * as N from "./number.ts";
const initializableEither = E.getInitializableEither(N.InitializableNumberSum, S.InitializableString);
const result = initializableEither.init();
// Right(0) (assuming number init is 0)
function getInitializableEither<A, B>(CA: Initializable<A>, CB: Initializable<B>): Initializable<Either<B, A>>;
§
getInitializableEither<A, B>(CA: Initializable<A>, CB: Initializable<B>): Initializable<Either<B, A>>
[src]§Return Type
§
Initializable<Either<B, A>>
[src]