query
On this page

genList

lib.strings.genList

Primop
Docs pulled from | This Revision | 22 minutes ago

Takes 2 arguments

generator, length


Generate list of size length, with each element i equal to the value returned by generator i. For example,

builtins.genList (x: x * x) 5

returns the list [ 0 1 4 9 16 ].


Noogle also knows

Aliases
Detected Type
genList :: (Int -> a) -> Int -> [a]