typocomath/src/experiment/arithmeticInfer4.ts

9 lines
226 B
TypeScript
Raw Normal View History

2023-09-01 15:52:44 +00:00
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)
)