import { List } from '../types' ; import { ReduceArity3 } from './types' ; import { curry3 } from '@typed/functions' ; name export const reduce = curry3 ( function reduce < A , B > ( f , seed , list ) { const length = list . length ; let acc = seed ; for ( let i = 0 ; i < length ; ++ i ) acc = f ( acc , list [ i ] , i ) ; return acc ; } ) ;