UNPKG

fp-ts-std

Version:

The missing pseudo-standard library for fp-ts.

8 lines (7 loc) 295 B
import { flow, identity } from "fp-ts/function"; import { invert } from "./Boolean"; export function toMonoid(F) { return G => x => F.foldMap(G)(x, identity); } export const memptyWhen = (M) => (x) => (y) => x ? M.empty : y(); export const memptyUnless = (M) => flow(invert, memptyWhen(M));