typocomath/src/experiment/arithmeticInfer.ts

9 lines
222 B
TypeScript
Raw Normal View History

import { $reflect } from '../core/$reflect.js'
2023-09-01 15:52:44 +00:00
2023-09-08 12:25:14 +00:00
export const square = $reflect(<T>(dep: {
2023-09-01 15:52:44 +00:00
multiply: (a: T, b: T) => T,
unaryMinus: (x: T) => T, // just for the experiment
}): (a: T) => T =>
z => dep.multiply(z, z)
)