Skip to main content
Module

x/fun/fn.ts>over

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function over
import { over } from "https://deno.land/x/fun@v2.0.0-alpha.10/fn.ts";

A common pattern in optics is to apply an input value to a function at the beginning and the end of a computation. This can (and has) been achieved by the composition of Pair using flow(P.dup, P.map(fn), P.merge). But for performance reasons it's nice to have a straighforward function that achieves the same result.

Parameters

faai: (a: A) => (a: A) => I

Returns

(a: A) => I