@@ -48,8 +48,8 @@ import Nix.Expr.Types ( VarName(..)
4848-- | A Nix 'StringContext' ...
4949data StringContext =
5050 StringContext
51- { scFlavor :: ! ContextFlavor
52- , scPath :: ! VarName
51+ { getStringContextFlavor :: ! ContextFlavor
52+ , getStringContextPath :: ! VarName
5353 }
5454 deriving (Eq , Ord , Show , Generic )
5555
@@ -192,13 +192,13 @@ toStringContexts path = go
192192 mkLstCtxFor t c = one (mkCtxFor t) <> go c
193193
194194
195- toNixLikeContextValue :: StringContext -> (VarName , NixLikeContextValue )
195+ toNixLikeContextValue :: StringContext -> (NixLikeContextValue , VarName )
196196toNixLikeContextValue sc =
197- ( scPath sc
198- , case scFlavor sc of
197+ ( case getStringContextFlavor sc of
199198 DirectPath -> NixLikeContextValue True False mempty
200199 AllOutputs -> NixLikeContextValue False True mempty
201200 DerivationOutput t -> NixLikeContextValue False False $ one t
201+ , getStringContextPath sc
202202 )
203203
204204toNixLikeContext :: S. HashSet StringContext -> NixLikeContext
@@ -211,8 +211,7 @@ toNixLikeContext stringContext =
211211 where
212212 fun :: (StringContext -> AttrSet NixLikeContextValue -> AttrSet NixLikeContextValue )
213213 fun sc hm =
214- let (t, nlcv) = toNixLikeContextValue sc in
215- M. insertWith (<>) t nlcv hm
214+ uncurry (M. insertWith (<>) ) (swap $ toNixLikeContextValue sc) hm
216215
217216-- | Add 'StringContext's into the resulting set.
218217addStringContext
0 commit comments