import { List } from '../types' ; import { curry2 } from '@typed/functions' ; name example export const range = curry2 ( __range ) ; export type Range = { ( from , to ) : Array < number > ; ( from ) : ( to : number ) => List < number > ; } ; function __range ( from , to ) { const length = to - from ; const list = Array ( length ) ; for ( let i = 0 ; i < length ; ++ i ) list [ i ] = i + from ; return list ; }