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