tvl-depot/users/sterni
sterni ad9b08e43d feat(sterni/nix/lists): implement transpose
This function is inspired by BQN's [⍉] though it is much less elegant
since Nix lacks multi-dimensional arrays. I thought this would be useful
to to avoid multiple `map`s over a single list if we want to return
multiple, separate values from it:

  transpose (builtins.map (x: [ (calcA x) (calcB x) ]) myList)

  # => [ [ (calcA a) … ] [ (calcB a) … ] ]

While this is quite elegant, it turns out that it is faster to write out
multiple maps:

  [ (builtins.map calcA myList) (builtins.map calcB myList) ]

[⍉]: https://mlochbaum.github.io/BQN/doc/transpose.html

Change-Id: Ic333c33af38ab03573b215c9696d75caf2ee18e7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11113
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
2024-03-10 18:05:32 +00:00
..
clhs-lookup style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
dot-time-man-pages chore(gerrit): migrate OWNERS files to code-owners style 2022-09-19 11:13:28 +00:00
emacs chore(users/sterni/emacs): use Emacs 29 instead of unstable 2023-08-09 12:03:40 +00:00
exercises/aoc feat(sterni/aoc/2022): day16 part 1 k solution 2023-01-22 14:36:01 +00:00
external chore(sterni/external/likely-music): update to 2023-02-07 2023-03-01 13:40:55 +00:00
htmlman style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
lv/gopher feat(sterni/lv): interim gopher page 2022-11-26 15:38:28 +00:00
machines fix: explicit dependencies on network-online.target 2024-02-26 11:48:32 +00:00
mblog refactor(sterni/mblog): move REDIRECT-STREAM into mime4cl 2023-05-18 16:16:39 +00:00
modules chore(sterni/minecraft-fabric): 0.11.2 -> 1.0.0 2024-02-15 13:31:46 +00:00
nix feat(sterni/nix/lists): implement transpose 2024-03-10 18:05:32 +00:00
nixpkgs-crate-holes chore(3p/sources): Bump channels & overlays 2022-09-28 08:02:31 +00:00
secrets chore(users/sterni/secrets): remove key of killed machine 2024-01-16 15:52:14 +00:00
keys.nix chore(sterni/keys): add ludwig ssh key 2022-10-07 16:17:15 +00:00
OWNERS chore(gerrit): migrate OWNERS files to code-owners style 2022-09-19 11:13:28 +00:00