Last active
November 12, 2018 17:37
-
-
Save obfusk/47ce27af27f26a5a56b81bfd2fb067ab to your computer and use it in GitHub Desktop.
nix repl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with builtins; | |
compareVersions "3.7.1-rc2" "3.7.1" | |
# => 1 | |
baseNameOf "foo//" | |
# => "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with builtins; | |
let words = s: filter (x: isString x && x != "") (split "[[:space:]]+" s); | |
in words " foo bar baz " | |
# => [ "foo" "bar" "baz" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment