@@ -6,6 +6,7 @@ import Control.Lens
66import Data.Bifunctor
77import Data.ByteString as BS
88import Data.Coerce
9+import Data.Foldable as F
910import Data.List.NonEmpty as NE
1011import Data.Maybe
1112import Data.Semigroup
@@ -79,10 +80,11 @@ fromYamlConfig :: Yaml.Config -> StackConfig
7980fromYamlConfig c = StackConfig{..}
8081 where
8182 _scResolver = coerce $ c ^. cResolver
82− _scPackages = NE.nub
83− $ fromMaybe (pure defaultPackage)
83+ -- 'NE.nub' replicates Stack behavior of having a Set of packages rather than list
84+ _scPackages = NE.nub $ F.foldl' (<>) nePackages yamlExtraDeps
85+ nePackages = fromMaybe (pure defaultPackage)
8486 $ fmap sconcat
85− $ NE.nonEmpty (yamlPackages <> yamlExtraDeps)
87+ $ NE.nonEmpty yamlPackages
8688 yamlPackages = fromYamlPackage packagesSimplePath False
8789 <$> fromMaybe mempty (c ^. cPackages)
8890 yamlExtraDeps = fromYamlPackage extraDepsSimplePath True