query
On this page

genList

lib.strings.genList

Primop
Docs pulled from | This Revision | about 2 hours 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 detected

Aliases

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

Implementation

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