Skip to content

Commit cebe523

Browse files
committed
String: m refactor
1 parent c5d04c3 commit cebe523

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/Nix/String.hs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,24 @@ module Nix.String
3030
)
3131
where
3232

33-
import Control.Monad.Writer
34-
import Data.Functor.Identity
33+
34+
35+
36+
import Control.Monad.Writer ( WriterT(..), MonadWriter(tell), MonadTrans, (<=<))
37+
import Data.Functor.Identity ( Identity(runIdentity) )
3538
import qualified Data.HashMap.Lazy as M
3639
import qualified Data.HashSet as S
37-
import Data.Hashable
40+
import Data.Hashable ( Hashable )
3841
import Data.Text ( Text )
3942
import qualified Data.Text as Text
40-
import GHC.Generics
43+
import GHC.Generics ( Generic )
4144

4245

4346
-- * Types
4447

4548
-- ** Context
4649

47-
-- | A 'StringContext' ...
50+
-- | A Nix 'StringContext' ...
4851
data StringContext =
4952
StringContext { scPath :: !Text
5053
, scFlavor :: !ContextFlavor
@@ -139,7 +142,7 @@ getContext = nsContext
139142

140143
fromNixLikeContext :: NixLikeContext -> S.HashSet StringContext
141144
fromNixLikeContext =
142-
S.fromList . join . fmap toStringContexts . M.toList . getNixLikeContext
145+
S.fromList . (toStringContexts <=< (M.toList . getNixLikeContext))
143146

144147
-- | Extract the string contents from a NixString that has no context
145148
getStringNoContext :: NixString -> Maybe Text

0 commit comments

Comments
 (0)