diff options
author | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-04-05 20:27:46 +0200 |
---|---|---|
committer | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-04-05 20:27:46 +0200 |
commit | 866f75e5b9579a4c4f6391b68c2a31633ab13e30 (patch) | |
tree | 699131ddb9a93aead9753e86ea13036a1fe52468 /lib/path/default.nix | |
parent | b505951d8a88e2be76bcf14a7daa87fe21523d6c (diff) |
lib.path.append: Add a law
With removePrefix introduced in a future commit this law can then be used to derive removePrefix p (append p s) == subpath.normalise s => (wrap with append) append p (removePrefix p (append p s)) == append p (subpath.normalise s) => (append is not influenced by subpath normalisation) append p (removePrefix p (append p s)) == append p s => (substitute q = append p s) append p (removePrefix p q) == q Not included in the docs because it's not that important, just shows that the first statement is more general than the second one (because this derivation doesn't work the other way)
Diffstat (limited to 'lib/path/default.nix')
-rw-r--r-- | lib/path/default.nix | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/path/default.nix b/lib/path/default.nix index a4a08668ae62e..442060c186432 100644 --- a/lib/path/default.nix +++ b/lib/path/default.nix @@ -108,6 +108,12 @@ in /* No rec! Add dependencies on this file at the top. */ { More specifically, it checks that the first argument is a [path value type](https://nixos.org/manual/nix/stable/language/values.html#type-path"), and that the second argument is a valid subpath string (see `lib.path.subpath.isValid`). + Laws: + + - Not influenced by subpath normalisation + + append p s == append p (subpath.normalise s) + Type: append :: Path -> String -> Path |