UNPKG

effect-ts-laws

Version:
14 lines 468 B
import { Contravariant as CN } from '@effect/typeclass'; import { dual, pipe } from 'effect/Function'; /** * Map over the argument of a unary function converting a function of * type `(a: A) ⇒ E` to `(b: B) ⇒ E`. * @category combinators */ export const mapInput = dual(2, (self, f) => b => pipe(b, f, self)); /** @category instances */ export const Contravariant = { imap: CN.imap(mapInput), contramap: mapInput, }; //# sourceMappingURL=Function.js.map