@@ -15,8 +15,6 @@ import qualified Data.ByteString.Char8 as BC
15
15
import qualified Data.Foldable as F
16
16
import qualified Data.IntMap as IntMap
17
17
import Data.List.Extra ( groupSortOn )
18
- import Data.List.NonEmpty ( nonEmpty )
19
- import qualified Data.List.NonEmpty as NonEmpty
20
18
import Data.List.NonEmpty.Extra ( minimumBy1 )
21
19
import qualified Data.Map.Strict as Map
22
20
import qualified Data.Set as Set
@@ -37,6 +35,8 @@ import Path.IO
37
35
)
38
36
import qualified RIO.FilePath as FP
39
37
import RIO.List ( (\\) , intercalate , isSuffixOf , isPrefixOf )
38
+ import RIO.NonEmpty ( nonEmpty )
39
+ import qualified RIO.NonEmpty as NE
40
40
import Stack.BuildPlan
41
41
( BuildPlanCheck (.. ), checkSnapBuildPlan , deNeededBy
42
42
, removeSrcPkgDefaultFlags , selectBestSnapshot
@@ -138,7 +138,7 @@ instance Pretty InitPrettyException where
138
138
<> flow " None of the following snapshots provides a compiler matching \
139
139
\your package(s):"
140
140
<> line
141
- <> bulletedList (map (fromString . show ) (NonEmpty . toList names))
141
+ <> bulletedList (map (fromString . show ) (NE . toList names))
142
142
<> blankLine
143
143
<> resolveOptions
144
144
pretty (ResolverMismatch resolver errDesc) =
@@ -624,7 +624,7 @@ checkBundleResolver initOpts snapshotLoc snapCandidate pkgDirs = do
624
624
getRecommendedSnapshots :: Snapshots -> NonEmpty SnapName
625
625
getRecommendedSnapshots snapshots =
626
626
-- in order - Latest LTS, Latest Nightly, all LTS most recent first
627
- case NonEmpty. nonEmpty supportedLtss of
627
+ case nonEmpty supportedLtss of
628
628
Just (mostRecent :| older) -> mostRecent :| (nightly : older)
629
629
Nothing -> nightly :| []
630
630
where
@@ -704,7 +704,7 @@ cabalPackagesCheck cabaldirs = do
704
704
when (nameMismatchPkgs /= [] ) $
705
705
prettyThrowIO $ PackageNameInvalid nameMismatchPkgs
706
706
let dupGroups = mapMaybe nonEmpty . groupSortOn (gpdPackageName . snd )
707
- dupAll = concatMap NonEmpty . toList $ dupGroups packages
707
+ dupAll = concatMap NE . toList $ dupGroups packages
708
708
-- Among duplicates prefer to include the ones in upper level dirs
709
709
pathlen = length . FP. splitPath . toFilePath . fst
710
710
getmin = minimumBy1 (compare `on` pathlen)
@@ -717,7 +717,7 @@ cabalPackagesCheck cabaldirs = do
717
717
flow " The following packages have duplicate package names:"
718
718
<> line
719
719
<> foldMap
720
- ( \ dup -> bulletedList (map fromString (NonEmpty . toList dup))
720
+ ( \ dup -> bulletedList (map fromString (NE . toList dup))
721
721
<> line
722
722
)
723
723
dups
0 commit comments