Skip to content

Commit dcd684d

Browse files
committed
Nix/String: erradicating hacky*
1 parent 8a6ff07 commit dcd684d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Nix/String.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ principledStringMappend :: NixString -> NixString -> NixString
132132
principledStringMappend (NixString s1 t1) (NixString s2 t2) =
133133
NixString (s1 <> s2) (t1 <> t2)
134134

135+
-- 2021-01-02: NOTE: This function is ERRADICATED from the source code.
136+
-- ERRADICATE it from the API.
135137
-- | Combine two NixStrings using mappend
136138
hackyStringMappend :: NixString -> NixString -> NixString
137139
hackyStringMappend (NixString s1 t1) (NixString s2 t2) =
@@ -146,9 +148,11 @@ principledIntercalateNixString sep nss = NixString contents ctx
146148
contents = Text.intercalate (nsContents sep) (map nsContents nss)
147149
ctx = S.unions (nsContext sep : map nsContext nss)
148150

151+
-- 2021-01-02: NOTE: This function is ERRADICATED from the source code.
152+
-- ERRADICATE it from the API.
149153
-- | Combine NixStrings using mconcat
150154
hackyStringMConcat :: [NixString] -> NixString
151-
hackyStringMConcat = foldr hackyStringMappend (NixString mempty mempty)
155+
hackyStringMConcat = foldr principledStringMappend (NixString mempty mempty)
152156

153157
-- | Empty string with empty context.
154158
principledStringMempty :: NixString

0 commit comments

Comments
 (0)