// ets_tracing: off import * as A from "../Associative/common.js" import type { Identity } from "./definition.js" import { makeIdentity } from "./makeIdentity.js" /** * Derive `Identity` from `Associative` and `identity` */ export function fromAssociative(A: A.Associative) { return (identity: A) => makeIdentity(identity, A.combine) } /** * Boolean `Identity` under conjunction */ export const all: Identity = makeIdentity(true, A.all.combine) /** * Boolean `Identity` under disjunction */ export const any: Identity = fromAssociative(A.any)(false) /** * Number `Identity` under multiplication */ export const product: Identity = fromAssociative(A.product)(1) /** * String `Identity` under concatenation */ export const string: Identity = fromAssociative(A.string)("") /** * Number `Identity` under addition */ export const sum: Identity = fromAssociative(A.sum)(0) /** * Void `Identity` */ const void_: Identity = fromAssociative(A.void)(undefined) export { void_ as void }