Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active February 3, 2026 20:19
Show Gist options
  • Select an option

  • Save dacr/ecaff8e993ba6dadfc28eb0aec7ddd39 to your computer and use it in GitHub Desktop.

Select an option

Save dacr/ecaff8e993ba6dadfc28eb0aec7ddd39 to your computer and use it in GitHub Desktop.
nix list / published by https://github.com/dacr/code-examples-manager #729edcf0-c5d4-41cd-a977-541f4399952f/1505529e62b5cc6c292bedf9a27e9f2f486fa998
## summary : nix list
## keywords : nix, list
## publish : gist
## authors : David Crosson
## license : Apache License Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
## id : 729edcf0-c5d4-41cd-a977-541f4399952f
## created-on : 2025-02-07T17:36:39+01:00
## managed-by : https://github.com/dacr/code-examples-manager
## run-with : nix eval --file $file
#### run-with : nix-instantiate --eval $file
let
list1 = [1 [42 3] 4];
in with builtins; {
look_for_42_1 = (head (tail list1)) ;
look_for_42_2 = (elemAt (elemAt list1 1) 0) ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment