Skip to content

Commit 60d5647

Browse files
committed
String.Coerce: m clean-up
1 parent eb96c20 commit 60d5647

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Nix/String/Coerce.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ coerceStringlikeToNixString ctsm =
126126
-- | Convert @Path@ into @NixString@.
127127
-- With an additional option to store the resolved path into Nix Store.
128128
coercePathToNixString :: (MonadStore m, Framed e m) => CopyToStoreMode -> Path -> m NixString
129-
coercePathToNixString ctsm =
129+
coercePathToNixString =
130130
bool
131131
(pure . mkNixStringWithoutContext . fromString . coerce)
132-
(fmap storePathToNixString . addPath)
133-
(ctsm == CopyToStore)
132+
((storePathToNixString <$>) . addPath)
133+
. (CopyToStore ==)
134134
where
135135
storePathToNixString :: StorePath -> NixString
136-
storePathToNixString (fromString . coerce -> sp) =
137-
join (flip mkNixStringWithSingletonContext . (`StringContext` DirectPath)) sp
136+
storePathToNixString =
137+
(mkNixStringWithSingletonContext <*> (`StringContext` DirectPath)) . fromString . coerce

0 commit comments

Comments
 (0)