import type { IO } from "../IO"; import { foldM_ } from "./combinators"; import { succeed } from "./constructors"; import type { EIO } from "./model"; /* * ------------------------------------------- * EIO Destructors * ------------------------------------------- */ export const getOrElse_ = (ma: EIO, onLeft: (e: E) => IO): IO => foldM_(ma, onLeft, succeed); export const getOrElse = (onLeft: (e: E) => IO) => (ma: EIO): IO => getOrElse_(ma, onLeft);