Skip to content

Commit 644f43c

Browse files
committed
treewide: Haskmap.map is <$>
1 parent 4550d55 commit 644f43c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Nix/Builtins.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1635,7 +1635,7 @@ getContextNix v =
16351635
case v' of
16361636
(NVStr ns) -> do
16371637
let context = getNixLikeContext $ toNixLikeContext $ getContext ns
1638-
valued :: M.HashMap Text (NValue t f m) <- sequenceA $ M.map toValue context
1638+
valued :: AttrSet (NValue t f m) <- sequenceA $ toValue <$> context
16391639
pure $ nvSet mempty valued
16401640
x -> throwError $ ErrorCall $ "Invalid type for builtins.getContext: " <> show x
16411641

src/Nix/Effects/Derivation.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ defaultDerivationStrict val = do
271271

272272
let outputsWithContext = Map.mapWithKey (\out path -> makeNixStringWithSingletonContext path (StringContext drvPath $ DerivationOutput out)) (outputs drv')
273273
drvPathWithContext = makeNixStringWithSingletonContext drvPath (StringContext drvPath AllOutputs)
274-
attrSet = M.map nvStr $ M.fromList $ ("drvPath", drvPathWithContext): Map.toList outputsWithContext
274+
attrSet = nvStr <$> M.fromList (("drvPath", drvPathWithContext) : Map.toList outputsWithContext)
275275
-- TODO: Add location information for all the entries.
276276
-- here --v
277277
pure $ nvSet mempty attrSet

src/Nix/Type/Infer.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ normalizeScheme (Forall _ body) = Forall (snd <$> ord) (normtype body)
9292

9393
normtype (a :~> b ) = normtype a :~> normtype b
9494
normtype (TCon a ) = TCon a
95-
normtype (TSet b a) = TSet b $ normtype `M.map` a
95+
normtype (TSet b a) = TSet b $ normtype <$> a
9696
normtype (TList a ) = TList $ normtype <$> a
9797
normtype (TMany ts) = TMany $ normtype <$> ts
9898
normtype (TVar a ) =
@@ -220,7 +220,7 @@ instance Substitutable TVar where
220220

221221
instance Substitutable Type where
222222
apply _ ( TCon a ) = TCon a
223-
apply s ( TSet b a ) = TSet b $ apply s `M.map` a
223+
apply s ( TSet b a ) = TSet b $ apply s <$> a
224224
apply s ( TList a ) = TList $ apply s <$> a
225225
apply (Subst s) t@(TVar a ) = Map.findWithDefault t a s
226226
apply s ( t1 :~> t2) = apply s t1 :~> apply s t2

0 commit comments

Comments
 (0)