import { map_ } from "./functor"; import type { XPure } from "./model"; import { chain_ } from "./monad"; /* * ------------------------------------------- * Apply XPure * ------------------------------------------- */ export const mapBoth_ = ( fa: XPure, fb: XPure, f: (a: A, b: B) => C ): XPure => chain_(fa, (a) => map_(fb, (b) => f(a, b))); export const mapBoth = (fb: XPure, f: (a: A, b: B) => C) => ( fa: XPure ): XPure => mapBoth_(fa, fb, f);