import { tuple } from "../../Function"; import { mapBothCause_ } from "./apply"; import * as C from "./Cause"; import { succeed } from "./constructors"; import type { Exit } from "./model"; /* * ------------------------------------------- * Applicative Exit * ------------------------------------------- */ export const both_ = (fa: Exit, fb: Exit): Exit => mapBothCause_(fa, fb, tuple, C.then); export const both = (fb: Exit) => (fa: Exit): Exit => both_(fa, fb); export const pure: (a: A) => Exit = succeed; export const bothPar_ = (fa: Exit, fb: Exit): Exit => mapBothCause_(fa, fb, tuple, C.both); export const bothPar = (fb: Exit) => (fa: Exit): Exit => bothPar_(fa, fb);