import { List } from '../types' ; import { Maybe } from '@typed/maybe' ; import { curry2 } from '@typed/functions' ; import { slice } from '../slice' ; name export const take = curry2 ( < A > ( n , list ) => slice ( 0 , Maybe . of ( n < 0 ? Infinity : n ) , list ) ) ; export type Take = { < A > ( n , list ) : Array < A > ; < A > ( n ) : ( list : List < A > ) => Array < A > ; } ;