Skip to content

Commit e6eed3a

Browse files
committed
treewide: m clean-up
1 parent c183989 commit e6eed3a

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

src/Nix/Builtins.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ findFileNix nvaset nvfilepath =
14071407
case (aset, filePath) of
14081408
(NVList x, NVStr ns) ->
14091409
do
1410-
mres <- findPath @t @f @m x (toString (stringIgnoreContext ns))
1410+
mres <- findPath @t @f @m x $ toString $ stringIgnoreContext ns
14111411

14121412
pure $ nvPath mres
14131413

src/Nix/Fresh.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Control.Monad.Ref ( MonadAtomicRef(..)
2020

2121
import Nix.Thunk
2222

23-
23+
-- 2021-06-02: NOTE: Remove singleton newtype accessor in favour of free coerce
2424
newtype FreshIdT i m a = FreshIdT { unFreshIdT :: ReaderT (Ref m i) m a }
2525
deriving
2626
( Functor

src/Nix/Fresh/Basic.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ instance (MonadEffects t f m, MonadDataContext f m)
3333
findEnvPath = lift . findEnvPath @t @f @m
3434
findPath vs path = do
3535
i <- FreshIdT ask
36-
let vs' = fmap (unliftNValue (runFreshIdT i)) vs
36+
let vs' = unliftNValue (runFreshIdT i) <$> vs
3737
lift $ findPath @t @f @m vs' path
3838
importPath path = do
3939
i <- FreshIdT ask

src/Nix/Reduce.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,14 @@ reduce (NLet_ ann binds body) =
283283

284284
-- let names = gatherNames body'
285285
-- binds' <- traverse sequence binds <&> \b -> flip filter b $ \case
286-
-- NamedVar (StaticKey name _ :| mempty) _ ->
286+
-- NamedVar (StaticKey name _ :| []) _ ->
287287
-- name `S.member` names
288288
-- _ -> True
289289
pure $ Fix $ NLet_ ann binds' body'
290290
-- where
291291
-- go m [] = pure m
292292
-- go m (x:xs) = case x of
293-
-- NamedVar (StaticKey name _ :| mempty) def -> do
293+
-- NamedVar (StaticKey name _ :| []) def -> do
294294
-- v <- pushScope m def
295295
-- go (M.insert name v m) xs
296296
-- _ -> go m xs

src/Nix/String/Coerce.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,13 @@ coerceToString call ctsm clevel = go
110110
err v = throwError $ ErrorCall $ "Expected a string, but saw: " <> show v
111111
castToNixString = pure . makeNixStringWithoutContext
112112

113-
nixStringUnwords = intercalateNixString (makeNixStringWithoutContext " ")
113+
nixStringUnwords = intercalateNixString $ makeNixStringWithoutContext " "
114114

115115
storePathToNixString :: StorePath -> NixString
116-
storePathToNixString sp = makeNixStringWithSingletonContext
117-
t
118-
(StringContext t DirectPath)
116+
storePathToNixString sp =
117+
makeNixStringWithSingletonContext
118+
t
119+
(StringContext t DirectPath)
119120
where
120121
t = toText $ unStorePath sp
121122

src/Nix/TH.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ freeVars e = case unFix e of
6565
(Set.unions $ freeVars <$> mapMaybe snd set)
6666
(Set.difference
6767
(maybe mempty one varname)
68-
(Set.fromList $ fmap fst set)
68+
(Set.fromList $ fst <$> set)
6969
)
7070
(NLet bindings expr ) ->
7171
freeVars expr <>

0 commit comments

Comments
 (0)