Skip to content

Commit 9023dba

Browse files
committed
Simplify deriving of instances
1 parent 0b1c82d commit 9023dba

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/Stack/Types/AllowNewerDeps.hs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,14 @@ module Stack.Types.AllowNewerDeps
1010
) where
1111

1212
import Data.Aeson.Types ( FromJSON (..) )
13-
import qualified Distribution.PackageDescription as C
14-
import Generics.Deriving.Monoid ( mappenddefault, memptydefault )
13+
import Distribution.PackageDescription ( mkPackageName )
1514
import Stack.Prelude
1615

16+
-- | A type representing lists of packages for which Stack should ignore lower
17+
-- and upper version bounds in its Cabal file.
1718
newtype AllowNewerDeps
1819
= AllowNewerDeps [PackageName]
19-
deriving (Eq, Generic, Ord, Read, Show)
20-
21-
instance Semigroup AllowNewerDeps where
22-
(<>) = mappenddefault
23-
24-
instance Monoid AllowNewerDeps where
25-
mappend = (<>)
26-
mempty = memptydefault
20+
deriving (Eq, Generic, Monoid, Ord, Read, Semigroup, Show)
2721

2822
instance FromJSON AllowNewerDeps where
29-
parseJSON = fmap (AllowNewerDeps . fmap C.mkPackageName) . parseJSON
23+
parseJSON = fmap (AllowNewerDeps . fmap mkPackageName) . parseJSON

0 commit comments

Comments
 (0)