query
On this page

genList

builtins.genList

Primop
Docs pulled from | This Revision | 16 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 ].

This function is not defined in a .nix file. It is likely a builtins function or an alias of a builtins function. builtins functions are predefined functions provided by Nix.

Noogle also knows

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