import { succeed } from "./constructors"; import type { XPure } from "./model"; import { ChainInstruction } from "./model"; /** * @internal */ const chain_ = ( ma: XPure, f: (a: A) => XPure ): XPure => new ChainInstruction(ma, f); /* * ------------------------------------------- * Functor XPure * ------------------------------------------- */ export const map_ = (fa: XPure, f: (a: A) => B): XPure => chain_(fa, (a) => succeed(f(a))); export const map = (f: (a: A) => B) => (fa: XPure): XPure => map_(fa, f);