typocomath/src/experiment/arithmeticInfer4.ts

9 lines
226 B
TypeScript

import { typed } from '../generic/infer'
export const square = typed('__infer__', <T>(dep: {
multiply: (a: T, b: T) => T,
unaryMinus: (x: T) => T, // just for the experiment
}): (a: T) => T =>
z => dep.multiply(z, z)
)