import { List } from '../types' ; import { arrayFrom } from '../arrayFrom' ; import { curry2 } from '@typed/functions' ; name export const forEach = curry2 ( __forEach ) ; export type ForEach = { < A > ( f , list ) : Array < A > ; < A > ( f ) : ( list : List < A > ) => Array < A > ; } ; function __forEach < A > ( f , list ) { for ( let i = 0 ; i < list . length ; ++ i ) f ( list [ i ] , i ) ; return arrayFrom ( list ) ; }