typocomath/src/generic/arithmetic.ts

6 lines
111 B
TypeScript

export const square =
<T>(dep: {
multiply: (x: T, y: T) => T
}) =>
(z: T): T => dep.multiply(z, z)