compose
import { compose } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/fn_either.ts";Compose two FnEithers, passing the right value of the first into the second.
@example
import * as FE from "./fn_either.ts";
import { pipe } from "./fn.ts";
const isPositive = (n: number) => n > 0;
const isInteger = (n: number) => Number.isInteger(n);
const isPositiveInteger = pipe(
FE.fromPredicate(isPositive),
FE.compose(FE.fromPredicate(isInteger)),
);
const result1 = isPositiveInteger(0); // Left(0)
const result2 = isPositiveInteger(1); // Right(1)
const result3 = isPositiveInteger(1.1); // Left(1.1)