mirror of
https://github.com/haskell-nix/hnix.git
synced 2024-10-26 08:32:17 +03:00
parent
3acc67ba66
commit
cacbfdbd6d
@ -175,6 +175,7 @@ builtinsList = sequence
|
||||
, add2 Normal "catAttrs" catAttrs
|
||||
, add2 Normal "compareVersions" compareVersions_
|
||||
, add Normal "concatLists" concatLists
|
||||
, add2 Normal "concatMap" concatMap_
|
||||
, add' Normal "concatStringsSep" (arity2 principledIntercalateNixString)
|
||||
, add0 Normal "currentSystem" currentSystem
|
||||
, add0 Normal "currentTime" currentTime_
|
||||
@ -1162,6 +1163,20 @@ concatLists =
|
||||
>=> toValue
|
||||
. concat
|
||||
|
||||
concatMap_
|
||||
:: forall e t f m
|
||||
. MonadNix e t f m
|
||||
=> NValue t f m
|
||||
-> NValue t f m
|
||||
-> m (NValue t f m)
|
||||
concatMap_ f =
|
||||
fromValue @[NValue t f m]
|
||||
>=> traverse applyFunc
|
||||
>=> toValue . concat
|
||||
where
|
||||
applyFunc :: NValue t f m -> m [NValue t f m]
|
||||
applyFunc = (f `callFunc`) >=> fromValue
|
||||
|
||||
listToAttrs
|
||||
:: forall e t f m . MonadNix e t f m => NValue t f m -> m (NValue t f m)
|
||||
listToAttrs = fromValue @[NValue t f m] >=> \l ->
|
||||
|
@ -70,7 +70,6 @@ newFailingTests = Set.fromList
|
||||
[ "eval-okay-path"
|
||||
, "eval-okay-fromTOML"
|
||||
, "eval-okay-context-introspection"
|
||||
, "eval-okay-concatmap"
|
||||
]
|
||||
|
||||
genTests :: IO TestTree
|
||||
|
Loading…
Reference in New Issue
Block a user