Skip to content

Instantly share code, notes, and snippets.

@exarkun
Created July 10, 2019 00:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exarkun/61c3972dae7871a4c65054757efdcd37 to your computer and use it in GitHub Desktop.
Save exarkun/61c3972dae7871a4c65054757efdcd37 to your computer and use it in GitHub Desktop.
nix-repl> with import <nixpkgs> { }; let range' = start: end: if start == end then [ ] else lib.range start (end - 1); in range' 0 0
[ ]
nix-repl> with import <nixpkgs> { }; let range' = start: end: if start == end then [ ] else lib.range start (end - 1); in range' 0 1
[ 0 ]
nix-repl> with import <nixpkgs> { }; let range' = start: end: if start == end then [ ] else lib.range start (end - 1); in range' 0 10
[ 0 1 2 3 4 5 6 7 8 9 ]
nix-repl> with import <nixpkgs> { }; let range' = start: end: if start == end then [ ] else lib.range start (end - 1); in range' 5 10
[ 5 6 7 8 9 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment