import * as E from "../Either"; import { fail, succeed } from "./constructors"; import { fold_, foldM_ } from "./fold"; import type { Async } from "./model"; export const absolve = (async: Async>): Async => foldM_(async, fail, E.fold(fail, succeed)); export const recover = (async: Async): Async> => fold_(async, E.left, E.right);