@@ -47,8 +47,6 @@ import Data.Text ( Text )
4747import qualified Data.Text as Text
4848import GHC.Generics
4949
50- -- {-# WARNING hackyGetStringNoContext, hackyStringIgnoreContext, hackyMakeNixStringWithoutContext "This NixString function needs to be replaced" #-}
51-
5250-- | A 'ContextFlavor' describes the sum of possible derivations for string contexts
5351data ContextFlavor =
5452 DirectPath
@@ -132,13 +130,6 @@ principledStringMappend :: NixString -> NixString -> NixString
132130principledStringMappend (NixString s1 t1) (NixString s2 t2) =
133131 NixString (s1 <> s2) (t1 <> t2)
134132
135- -- 2021-01-02: NOTE: This function is ERRADICATED from the source code.
136- -- ERRADICATE it from the API.
137- -- | Combine two NixStrings using mappend
138- hackyStringMappend :: NixString -> NixString -> NixString
139- hackyStringMappend (NixString s1 t1) (NixString s2 t2) =
140- NixString (s1 <> s2) (t1 <> t2)
141-
142133-- | Combine NixStrings with a separator
143134principledIntercalateNixString :: NixString -> [NixString ] -> NixString
144135principledIntercalateNixString _ [] = principledMempty
@@ -148,12 +139,6 @@ principledIntercalateNixString sep nss = NixString contents ctx
148139 contents = Text. intercalate (nsContents sep) (map nsContents nss)
149140 ctx = S. unions (nsContext sep : map nsContext nss)
150141
151- -- 2021-01-02: NOTE: This function is ERRADICATED from the source code.
152- -- ERRADICATE it from the API.
153- -- | Combine NixStrings using mconcat
154- hackyStringMConcat :: [NixString ] -> NixString
155- hackyStringMConcat = foldr principledStringMappend (NixString mempty mempty )
156-
157142-- | Empty string with empty context.
158143principledStringMempty :: NixString
159144principledStringMempty = NixString mempty mempty
@@ -250,3 +235,20 @@ runWithStringContext = runIdentity . runWithStringContextT
250235-- Warning: this may be unsafe, depending on how you handle the resulting context list.
251236runWithStringContext' :: WithStringContextT Identity a -> (a , S. HashSet StringContext )
252237runWithStringContext' = runIdentity . runWithStringContextT'
238+
239+ -- * Deprecated API
240+
241+ -- {-# WARNING hackyGetStringNoContext, hackyStringIgnoreContext, hackyMakeNixStringWithoutContext "This NixString function needs to be replaced" #-}
242+
243+ -- NOTE: These functions are ERRADICATED from the source code.
244+ -- ERRADICATE them from the API.
245+
246+ -- | Combine two NixStrings using mappend
247+ hackyStringMappend :: NixString -> NixString -> NixString
248+ hackyStringMappend (NixString s1 t1) (NixString s2 t2) =
249+ NixString (s1 <> s2) (t1 <> t2)
250+
251+ -- | Combine NixStrings using mconcat
252+ hackyStringMConcat :: [NixString ] -> NixString
253+ hackyStringMConcat = foldr principledStringMappend (NixString mempty mempty )
254+
0 commit comments