@@ -11,11 +11,12 @@ module Distribution.Nixpkgs.Haskell.BuildInfo
1111
1212import Control.DeepSeq
1313import Control.Lens
14+import Data.Semigroup
1415import Data.Set ( Set )
1516import Data.Set.Lens
1617import GHC.Generics ( Generic )
1718import Language.Nix
18−import Language.Nix.PrettyPrinting
19+import Language.Nix.PrettyPrinting hiding ( (<>) )
1920
2021data BuildInfo = BuildInfo
2122 { _haskell :: Set Binding
@@ -30,9 +31,13 @@ makeLenses ''BuildInfo
3031instance Each BuildInfo BuildInfo (Set Binding) (Set Binding) where
3132 each f (BuildInfo a b c d) = BuildInfo <$> f a <*> f b <*> f c <*> f d
3233
34+instance Semigroup BuildInfo where
35+ BuildInfo w1 x1 y1 z1 <> BuildInfo w2 x2 y2 z2 =
36+ BuildInfo (w1 <> w2) (x1 <> x2) (y1 <> y2) (z1 <> z2)
37+
3338instance Monoid BuildInfo where
3439 mempty = BuildInfo mempty mempty mempty mempty
35− BuildInfo w1 x1 y1 z1 `mappend` BuildInfo w2 x2 y2 z2 = BuildInfo (w1 `mappend` w2) (x1 `mappend` x2) (y1 `mappend` y2) (z1 `mappend` z2)
40+ mappend = (<>)
3641
3742instance NFData BuildInfo
3843