query
On this page

length

builtins.length

Primop
Docs pulled from | This Revision | about 4 hours ago


Nix manual

Takes 1 arguments

e

Return the length of the list e.

Noogle detected

Aliases

Detected Type
length :: [a] -> Int

Implementation

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

src/libexpr/primops.cc:3980

static void prim_length(EvalState & state, CallSite callSite, Value * const * args, Value & v)
{
    state.forceList(*args[0], noPos, "while evaluating the first argument passed to builtins.length");
    v.mkInt(args[0]->listSize());
}