/** * These is an extension of fp-ts/These * @since 0.12.1 */ import * as EI from 'fp-ts/Either' import { pipe } from 'fp-ts/function' import * as TH from 'fp-ts/These' /** * Convert These into an Either. If the These is a Both * a Right will be returned * @category Combinator * @since 0.12.1 */ export const absolve = (these: TH.These): EI.Either => pipe( these, TH.matchW(EI.left, EI.right, (_, x) => EI.right(x)), ) /** * Convert These into an Either. If the These is a Both * a Lef will be returned * @category Combinator * @since 0.12.1 */ export const condemn = (these: TH.These): EI.Either => pipe(these, TH.matchW(EI.left, EI.right, EI.left)) export * from 'fp-ts/These'