import { reduce as _reduce } from '@collectable/map' ; import { HashSetStructure } from '../internals' ; export type ReducePredicate < K , R > = ( accum : R , value : K , index : number ) => R ; export function reduce < K , R > ( f , seed , set ) { return _reduce ( reduceMap ( f ) , seed , set . _map ) ; } function reduceMap < R , K > ( pred ) { return function ( accum , value , key , index ) { return pred ( accum , key , index ) ; } ; }