premap
import { premap } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/fn.ts";Map over the input of a function, turning D => A and L => D into L => A.
@example
import { premap, pipe } from "./fn.ts";
const equalsZero = (n: number): boolean => n === 0;
const strLength = (s: string): number => s.length;
const isEmpty = pipe(
equalsZero,
premap(strLength),
);
const result1 = isEmpty(""); // true
const result2 = isEmpty("Hello"); // false