import { List } from '../types' ; import { curry2 } from '@typed/functions' ; import { length } from '../length' ; name export const prepend = curry2 ( __prepend ) ; function __prepend < A > ( value , list ) { const itemCount = length ( list ) + 1 ; const newList = Array ( itemCount ) ; newList [ 0 ] = value ; for ( let i = 1 ; i < itemCount ; ++ i ) newList [ i ] = list [ i - 1 ] ; return newList ; }