query
On this page

genList

builtins.genList

Primop
Docs pulled from | This Revision | 21 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 detected

Aliases

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

Implementation

This function is implemented in c++ and is part of the native nix runtime.