Skip to content

Commit 4f94e33

Browse files
soulomoonAnton-Latukha
authored andcommitted
add builtins.isPath
1 parent a9436eb commit 4f94e33

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Nix/Builtins.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,10 @@ pathExistsNix nvpath =
11561156
NVStr ns -> doesPathExist $ coerce $ toString $ ignoreContext ns
11571157
_v -> throwError $ ErrorCall $ "builtins.pathExists: expected path, got " <> show _v
11581158

1159+
isPathNix
1160+
:: forall e t f m . MonadNix e t f m => NValue t f m -> m (NValue t f m)
1161+
isPathNix = hasKind @Path
1162+
11591163
isAttrsNix
11601164
:: forall e t f m . MonadNix e t f m => NValue t f m -> m (NValue t f m)
11611165
isAttrsNix = hasKind @(AttrSet (NValue t f m))
@@ -1858,6 +1862,7 @@ builtinsList =
18581862
, add Normal "isInt" isIntNix
18591863
, add Normal "isList" isListNix
18601864
, add Normal "isString" isStringNix
1865+
, add Normal "isPath" isPathNix
18611866
, add Normal "length" lengthNix
18621867
, add2 Normal "lessThan" lessThanNix
18631868
, add Normal "listToAttrs" listToAttrsNix

tests/NixLanguageTests.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ newFailingTests = Set.fromList
5959
[ "eval-okay-hash"
6060
, "eval-okay-hashfile"
6161
, "eval-okay-path" -- #128
62-
, "eval-okay-types"
6362
, "eval-okay-fromTOML"
6463
, "eval-okay-ind-string" -- #1000 #610
6564
]

0 commit comments

Comments
 (0)