range
lib.lists.range
Docs pulled from | This Revision | about 1 hour ago
Return a list of integers from first
up to and including last
.
Inputs
first
-
First integer in the range
last
-
Last integer in the range
Type
range :: int -> int -> [int]
Examples
lib.lists.range
usage example
range 2 4
=> [ 2 3 4 ]
range 3 2
=> [ ]
Noogle detected
Implementation
The following is the current implementation of this function.
range =
first:
last:
if first > last then
[]
else
genList (n: first + n) (last - first + 1);