@@ -459,9 +459,12 @@ data GlobalOptsMonoid = GlobalOptsMonoid
459459 , globalMonoidStackYaml :: ! (First FilePath ) -- ^ Override project stack.yaml
460460 } deriving (Show , Generic )
461461
462+ instance Semigroup GlobalOptsMonoid where
463+ (<>) = mappenddefault
464+
462465instance Monoid GlobalOptsMonoid where
463466 mempty = memptydefault
464- mappend = mappenddefault
467+ mappend = (<>)
465468
466469-- | Default logging level should be something useful but not crazy.
467470defaultLogLevel :: LogLevel
@@ -771,9 +774,12 @@ data ConfigMonoid =
771774 }
772775 deriving (Show , Generic )
773776
777+ instance Semigroup ConfigMonoid where
778+ (<>) = mappenddefault
779+
774780instance Monoid ConfigMonoid where
775781 mempty = memptydefault
776- mappend = mappenddefault
782+ mappend = (<>)
777783
778784parseConfigMonoid :: Path Abs Dir -> Value -> Yaml. Parser (WithJSONWarnings ConfigMonoid )
779785parseConfigMonoid = withObjectWarnings " ConfigMonoid" . parseConfigMonoidObject
@@ -1676,6 +1682,16 @@ instance FromJSON (WithJSONWarnings SetupInfo) where
16761682
16771683-- | For @siGHCs@ and @siGHCJSs@ fields maps are deeply merged.
16781684-- For all fields the values from the last @SetupInfo@ win.
1685+ instance Semigroup SetupInfo where
1686+ l <> r =
1687+ SetupInfo
1688+ { siSevenzExe = siSevenzExe r <|> siSevenzExe l
1689+ , siSevenzDll = siSevenzDll r <|> siSevenzDll l
1690+ , siMsys2 = siMsys2 r <> siMsys2 l
1691+ , siGHCs = Map. unionWith (<>) (siGHCs r) (siGHCs l)
1692+ , siGHCJSs = Map. unionWith (<>) (siGHCJSs r) (siGHCJSs l)
1693+ , siStack = Map. unionWith (<>) (siStack l) (siStack r) }
1694+
16791695instance Monoid SetupInfo where
16801696 mempty =
16811697 SetupInfo
@@ -1686,14 +1702,7 @@ instance Monoid SetupInfo where
16861702 , siGHCJSs = Map. empty
16871703 , siStack = Map. empty
16881704 }
1689- mappend l r =
1690- SetupInfo
1691- { siSevenzExe = siSevenzExe r <|> siSevenzExe l
1692- , siSevenzDll = siSevenzDll r <|> siSevenzDll l
1693- , siMsys2 = siMsys2 r <> siMsys2 l
1694- , siGHCs = Map. unionWith (<>) (siGHCs r) (siGHCs l)
1695- , siGHCJSs = Map. unionWith (<>) (siGHCJSs r) (siGHCJSs l)
1696- , siStack = Map. unionWith (<>) (siStack l) (siStack r) }
1705+ mappend = (<>)
16971706
16981707-- | Remote or inline 'SetupInfo'
16991708data SetupInfoLocation
0 commit comments