import {ReturnsAs} from './helpers.js' import {ResolutionError, match} from '#core/helpers.js' import {Returns} from '#core/Type.js' import {Passthru} from "#core/TypePatterns.js" export const isZero = match(Passthru, (math, [T]) => { if (!T) { // called with no arguments throw new ResolutionError('isZero() requires one argument') } const z = math.zero(T) const eq = math.equal.resolve([T, T]) return ReturnsAs(eq, x => eq(z, x)) })