File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ module Nix.String
3232 , addStringContext
3333 , addSingletonStringContext
3434 , runWithStringContextT
35+ , runWithStringContextT'
3536 , runWithStringContext
37+ , runWithStringContext'
3638 )
3739where
3840
@@ -231,6 +233,16 @@ runWithStringContextT :: Monad m => WithStringContextT m Text -> m NixString
231233runWithStringContextT (WithStringContextT m) =
232234 uncurry NixString <$> runWriterT m
233235
236+ -- | Run an action that manipulates nix strings, and collect the contexts encountered.
237+ -- Warning: this may be unsafe, depending on how you handle the resulting context list.
238+ runWithStringContextT' :: Monad m => WithStringContextT m a -> m (a , S. HashSet StringContext )
239+ runWithStringContextT' (WithStringContextT m) = runWriterT m
240+
234241-- | Run an action producing a string with a context and put those into a 'NixString'.
235242runWithStringContext :: WithStringContextT Identity Text -> NixString
236243runWithStringContext = runIdentity . runWithStringContextT
244+
245+ -- | Run an action that manipulates nix strings, and collect the contexts encountered.
246+ -- Warning: this may be unsafe, depending on how you handle the resulting context list.
247+ runWithStringContext' :: WithStringContextT Identity a -> (a , S. HashSet StringContext )
248+ runWithStringContext' = runIdentity . runWithStringContextT'
You can’t perform that action at this time.
0 commit comments