File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1040,10 +1040,6 @@ isList
10401040 :: forall e t f m . MonadNix e t f m => NValue t f m -> m (NValue t f m )
10411041isList = hasKind @ [NValue t f m ]
10421042
1043- isString
1044- :: forall e t f m . MonadNix e t f m => NValue t f m -> m (NValue t f m )
1045- isString = hasKind @ NixString
1046-
10471043isInt
10481044 :: forall e t f m . MonadNix e t f m => NValue t f m -> m (NValue t f m )
10491045isInt = hasKind @ Int
@@ -1060,6 +1056,12 @@ isNull
10601056 :: forall e t f m . MonadNix e t f m => NValue t f m -> m (NValue t f m )
10611057isNull = hasKind @ ()
10621058
1059+ -- isString cannot use `hasKind` because it coerces derivations to strings.
1060+ isString :: MonadNix e t f m => NValue t f m -> m (NValue t f m )
1061+ isString v = demand v $ \ case
1062+ NVStr {} -> toValue True
1063+ _ -> toValue False
1064+
10631065isFunction :: MonadNix e t f m => NValue t f m -> m (NValue t f m )
10641066isFunction func = demand func $ \ case
10651067 NVClosure {} -> toValue True
You can’t perform that action at this time.
0 commit comments