import type { FnAny } from "@thi.ng/api" ; import type { Reducer , ReductionFn } from "../api.js" ; import { $$reduce , reducer } from "../reduce.js" ; param rfn param fn param initDefault param args internal export const __mathop = ( rfn , fn , initDefault , args ) => { const res = $$reduce ( rfn , args ) ; if ( res !== undefined ) { return res ; } const init = args [ 0 ] || initDefault ; return reducer ( ( ) => init , fn ) ; } ;