import { Arity2 , curry } from '@typed/lambda' ; export const reduce = curry ( __reduce ) ; async function __reduce < A , B > ( reducer , seed , asyncIterable ) { let accumulator = seed ; for await ( const x of asyncIterable ) { accumulator = reducer ( accumulator , x ) ; } return accumulator ; }