import { pipe } from "../../Function"; import * as T from "../Task/_core"; import { bimapM } from "./bifunctor"; import type { XRefM } from "./model"; /** * Transforms the `get` value of the `XRefM` with the specified effectual * function. */ export const mapM_ = ( self: XRefM, f: (b: B) => T.Task ) => pipe(self, bimapM(T.pure, f)); /** * Transforms the `get` value of the `XRefM` with the specified effectual * function. */ export const mapM = (f: (b: B) => T.Task) => ( self: XRefM ) => mapM_(self, f); /** * Transforms the `get` value of the `XRefM` with the specified function. */ export const map_ = (self: XRefM, f: (b: B) => C) => mapM_(self, (b) => T.pure(f(b))); /** * Transforms the `get` value of the `XRefM` with the specified function. */ export const map = (f: (b: B) => C) => (self: XRefM) => map_(self, f);