import { curry } from '@typed/lambda' ; export const take = curry ( __take ) as { < A > ( amount , iterable ) : Iterable < A > ; ( amount ) : < A > ( iterable : Iterable < A > ) => Iterable < A > ; } ; function * __take < A > ( amount , iterable ) { for ( const x of iterable ) { if ( amount -- > 0 ) { yield x ; } } }