<commit_before># General list operations.

{ lib }:
with lib.trivial;
let
  inherit (lib.strings) toInt;
in
rec {

  inherit (builtins) head tail length isList elemAt concatLists filter elem genList;

  /*  Create a list consisting of a single element.  `singleton x` is
      sometimes more convenient with respect to indentation than `[x]`
      when x spans multiple lines.

      Type: singleton :: a -> [a]

      Example:
        singleton "foo"
        => [ "foo" ]
  */
  singleton = x: [x];

  /* “right fold” a binary function `op` between successive elements of
     `list` with `nul' as the starting value, i.e.,
     `foldr op nul [x_1 x_2 ... x_n] == op x_1 (op x_2 ... (op x_n nul))`.

     Type: foldr :: (a -> b -> b) -> b -> [a] -> b<commit_msg>lib: lists: Alias builtins.map<commit_after># General list operations.

{ lib }:
with lib.trivial;
let
  inherit (lib.strings) toInt;
in
rec {

  inherit (builtins) head tail length isList elemAt concatLists filter elem genList map;

  /*  Create a list consisting of a single element.  `singleton x` is
      sometimes more convenient with respect to indentation than `[x]`
      when x spans multiple lines.

      Type: singleton :: a -> [a]

      Example:
        singleton "foo"
        => [ "foo" ]
  */
  singleton = x: [x];

  /* “right fold” a binary function `op` between successive elements of
     `list` with `nul' as the starting value, i.e.,
     `foldr op nul [x_1 x_2 ... x_n] == op x_1 (op x_2 ... (op x_n nul))`.

     Type: foldr :: (a -> b -> b) -> b -> [a] -> b
{'fraction_non_alphanumeric': 0.129928894634777, 'fraction_numerical': 0.005171299288946348, 'mean_word_length': 2.502262443438914, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1299178', 'n_tokens_mistral': 533, 'n_tokens_neox': 510, 'n_words': 201}