import {Complex} from './type.js' import {Signature, Dependency, ImpType} from '../core/Dispatcher.js' declare module "./type" { interface ComplexReturn { isReal: Signature], boolean> isSquare: Signature], boolean> } } export const isReal = (dep: Dependency<'equal', [T,T]> & Dependency<'add', [T,T]> & Dependency<'isReal', [T]> ): ImpType<'isReal', [Complex]> => z => dep.isReal(z.re) && dep.equal(z.re, dep.add(z.re, z.im)) export const isSquare: ImpType<'isSquare', [Complex]> = z => true // FIXME: not correct for Complex once we get there