Skip to content

Commit 6d2653f

Browse files
authored
Merge of #11814
2 parents eec643a + ae60693 commit 6d2653f

26 files changed

Lines changed: 39 additions & 47 deletions

File tree

Cabal-syntax/src/Distribution/Compat/Semigroup.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ gmempty = to gmempty'
4747
class GSemigroup f => GMonoid f where
4848
gmempty' :: f p
4949

50-
instance (Semigroup a, Monoid a) => GMonoid (K1 i a) where
50+
instance Monoid a => GMonoid (K1 i a) where
5151
gmempty' = K1 mempty
5252

5353
instance GMonoid f => GMonoid (M1 i c f) where

Cabal-syntax/src/Distribution/Compiler.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ instance Semigroup a => Semigroup (PerCompilerFlavor a) where
162162
(a <> a')
163163
(b <> b')
164164

165-
instance (Semigroup a, Monoid a) => Monoid (PerCompilerFlavor a) where
165+
instance Monoid a => Monoid (PerCompilerFlavor a) where
166166
mempty = PerCompilerFlavor mempty mempty
167167
mappend = (<>)
168168

Cabal-syntax/src/Distribution/FieldGrammar/Class.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ optionalField fn l = optionalFieldAla fn Identity l
209209

210210
-- | Optional field with default value.
211211
optionalFieldDef
212-
:: (FieldGrammar c g, Functor (g s), c (Identity a), Eq a)
212+
:: (FieldGrammar c g, c (Identity a), Eq a)
213213
=> FieldName
214214
-- ^ field name
215215
-> ALens' s a

Cabal-syntax/src/Distribution/PackageDescription/FieldGrammar.hs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,8 @@ libraryFieldGrammar
177177
, c (List CommaVCat (Identity ModuleReexport) ModuleReexport)
178178
, c (List FSep (MQuoted Extension) Extension)
179179
, c (List FSep (MQuoted Language) Language)
180-
, c (List FSep Token String)
181180
, c (List NoCommaFSep Token' String)
182181
, c (List VCat (MQuoted ModuleName) ModuleName)
183-
, c (List VCat (RelativePathNT Pkg File) (RelativePath Pkg File))
184182
, c (List FSep (SymbolicPathNT Pkg (Dir Framework)) (SymbolicPath Pkg (Dir Framework)))
185183
, c (List FSep (SymbolicPathNT Pkg (Dir Lib)) (SymbolicPath Pkg (Dir Lib)))
186184
, c (List FSep (SymbolicPathNT Pkg (Dir Source)) (SymbolicPath Pkg (Dir Source)))
@@ -233,7 +231,6 @@ foreignLibFieldGrammar
233231
, c (List FSep (Identity ForeignLibOption) ForeignLibOption)
234232
, c (List FSep (MQuoted Extension) Extension)
235233
, c (List FSep (MQuoted Language) Language)
236-
, c (List FSep Token String)
237234
, c (List FSep (SymbolicPathNT Pkg (Dir Framework)) (SymbolicPath Pkg (Dir Framework)))
238235
, c (List FSep (SymbolicPathNT Pkg (Dir Lib)) (SymbolicPath Pkg (Dir Lib)))
239236
, c (List FSep (SymbolicPathNT Pkg (Dir Source)) (SymbolicPath Pkg (Dir Source)))
@@ -277,7 +274,6 @@ executableFieldGrammar
277274
, c (List CommaVCat (Identity Mixin) Mixin)
278275
, c (List FSep (MQuoted Extension) Extension)
279276
, c (List FSep (MQuoted Language) Language)
280-
, c (List FSep Token String)
281277
, c (List FSep (SymbolicPathNT Pkg (Dir Framework)) (SymbolicPath Pkg (Dir Framework)))
282278
, c (List FSep (SymbolicPathNT Pkg (Dir Lib)) (SymbolicPath Pkg (Dir Lib)))
283279
, c (List FSep (SymbolicPathNT Pkg (Dir Source)) (SymbolicPath Pkg (Dir Source)))
@@ -355,7 +351,6 @@ testSuiteFieldGrammar
355351
, c (List CommaVCat (Identity Mixin) Mixin)
356352
, c (List FSep (MQuoted Extension) Extension)
357353
, c (List FSep (MQuoted Language) Language)
358-
, c (List FSep Token String)
359354
, c (List NoCommaFSep Token' String)
360355
, c (List VCat (MQuoted ModuleName) ModuleName)
361356
, c (List FSep (SymbolicPathNT Pkg (Dir Framework)) (SymbolicPath Pkg (Dir Framework)))
@@ -504,7 +499,6 @@ benchmarkFieldGrammar
504499
, c (List CommaVCat (Identity Mixin) Mixin)
505500
, c (List FSep (MQuoted Extension) Extension)
506501
, c (List FSep (MQuoted Language) Language)
507-
, c (List FSep Token String)
508502
, c (List NoCommaFSep Token' String)
509503
, c (List VCat (MQuoted ModuleName) ModuleName)
510504
, c (List FSep (SymbolicPathNT Pkg (Dir Framework)) (SymbolicPath Pkg (Dir Framework)))
@@ -611,7 +605,6 @@ buildInfoFieldGrammar
611605
, c (List CommaVCat (Identity Mixin) Mixin)
612606
, c (List FSep (MQuoted Extension) Extension)
613607
, c (List FSep (MQuoted Language) Language)
614-
, c (List FSep Token String)
615608
, c (List NoCommaFSep Token' String)
616609
, c (List VCat (MQuoted ModuleName) ModuleName)
617610
, c (List FSep (SymbolicPathNT Pkg (Dir Framework)) (SymbolicPath Pkg (Dir Framework)))
@@ -812,7 +805,7 @@ flagFieldGrammar name =
812805
-------------------------------------------------------------------------------
813806

814807
sourceRepoFieldGrammar
815-
:: (FieldGrammar c g, Applicative (g SourceRepo), c (Identity RepoType), c Token, c FilePathNT)
808+
:: (FieldGrammar c g, Applicative (g SourceRepo), c (Identity RepoType))
816809
=> RepoKind
817810
-> g SourceRepo SourceRepo
818811
sourceRepoFieldGrammar kind =

Cabal-syntax/src/Distribution/Types/CondTree.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ instance (NFData v, NFData a) => NFData (CondTree v a) where rnf = genericRnf
6666
instance Semigroup a => Semigroup (CondTree v a) where
6767
(CondNode a bs) <> (CondNode a' bs') = CondNode (a <> a') (bs <> bs')
6868

69-
instance (Semigroup a, Monoid a) => Monoid (CondTree v a) where
69+
instance Monoid a => Monoid (CondTree v a) where
7070
mappend = (<>)
7171
mempty = CondNode mempty mempty
7272

Cabal-syntax/src/Distribution/Types/VersionRange/Internal.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ versionRangeParser digitParser csv = expr
503503
, prettyShow (foldr1 unionVersionRanges (fmap op vs))
504504
]
505505

506-
verSet :: CabalParsing m => m (NonEmpty Version)
506+
verSet :: m (NonEmpty Version)
507507
verSet = do
508508
_ <- P.char '{'
509509
P.spaces
@@ -512,22 +512,22 @@ versionRangeParser digitParser csv = expr
512512
pure vs
513513

514514
-- a plain version without tags or wildcards
515-
verPlain :: CabalParsing m => m Version
515+
verPlain :: m Version
516516
verPlain = mkVersion . toList <$> P.sepByNonEmpty digitParser (P.char '.')
517517

518518
-- either wildcard or normal version
519-
verOrWild :: CabalParsing m => m (Bool, Version)
519+
verOrWild :: m (Bool, Version)
520520
verOrWild = do
521521
x <- digitParser
522522
verLoop (DList.singleton x)
523523

524524
-- trailing: wildcard (.y.*) or normal version (optional tags) (.y.z-tag)
525-
verLoop :: CabalParsing m => DList.DList Int -> m (Bool, Version)
525+
verLoop :: DList.DList Int -> m (Bool, Version)
526526
verLoop acc =
527527
verLoop' acc
528528
<|> (tags *> pure (False, mkVersion (DList.toList acc)))
529529

530-
verLoop' :: CabalParsing m => DList.DList Int -> m (Bool, Version)
530+
verLoop' :: DList.DList Int -> m (Bool, Version)
531531
verLoop' acc = do
532532
_ <- P.char '.'
533533
let digit = digitParser >>= verLoop . DList.snoc acc
@@ -542,7 +542,7 @@ versionRangeParser digitParser csv = expr
542542
P.spaces
543543
return a
544544

545-
tags :: CabalParsing m => m ()
545+
tags :: m ()
546546
tags = do
547547
ts <- many $ P.char '-' *> some (P.satisfy isAlphaNum)
548548
case ts of

Cabal-syntax/src/Distribution/Utils/Structured.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ structureBuilder s0 = State.evalState (go s0) Map.empty
227227
-- @since 3.2.0.0
228228
class Typeable a => Structured a where
229229
structure :: Proxy a -> Structure
230-
default structure :: (Generic a, GStructured (Rep a)) => Proxy a -> Structure
230+
default structure :: GStructured (Rep a) => Proxy a -> Structure
231231
structure = genericStructure
232232

233233
-- This member is hidden. It's there to precalc
@@ -332,7 +332,7 @@ containerStructure _ =
332332
-------------------------------------------------------------------------------
333333

334334
-- | Derive 'structure' generically.
335-
genericStructure :: forall a. (Typeable a, Generic a, GStructured (Rep a)) => Proxy a -> Structure
335+
genericStructure :: forall a. (Typeable a, GStructured (Rep a)) => Proxy a -> Structure
336336
genericStructure _ = gstructured (typeRep (Proxy :: Proxy a)) (Proxy :: Proxy (Rep a)) 0
337337

338338
-- | Used to implement 'genericStructure'.

Cabal-tests/tests/HackageTests.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ fieldLinesToString fieldLines =
469469
-- | We assume that monoid is commutative.
470470
--
471471
-- First we chunk input (as single cabal file is little work)
472-
foldIO :: forall a m. (Monoid m, NFData m) => (a -> IO m) -> [a] -> IO m
472+
foldIO :: forall a m. (Monoid m) => (a -> IO m) -> [a] -> IO m
473473
foldIO f = go mempty where
474474
go !acc [] = acc
475475
go !acc (x:xs) = go (mappend acc (f x)) xs

Cabal-tree-diff/src/Data/TreeDiff/Instances/Cabal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import qualified Distribution.Compat.NonEmptySet as NES
4040
-- instances
4141
-------------------------------------------------------------------------------
4242

43-
instance (Eq a, Show a) => ToExpr (Condition a) where toExpr = defaultExprViaShow
43+
instance (Show a) => ToExpr (Condition a) where toExpr = defaultExprViaShow
4444
instance (Show a, ToExpr c, Show c, Eq a, Eq c) => ToExpr (CondTree a c)
4545
instance (Show a, ToExpr c, Show c, Eq a, Eq c) => ToExpr (CondBranch a c)
4646
instance (ToExpr a) => ToExpr (NubList a)

Cabal/src/Distribution/PackageDescription/Check/Monad.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ data CheckCtx m = CheckCtx
136136
-- | Creates a pristing 'CheckCtx'. With pristine we mean everything that
137137
-- can be deduced by GPD but *not* user flags information.
138138
pristineCheckCtx
139-
:: Monad m
140-
=> CheckInterface m
139+
:: CheckInterface m
141140
-> GenericPackageDescription
142141
-> CheckCtx m
143142
pristineCheckCtx ci gpd =
@@ -151,7 +150,7 @@ pristineCheckCtx ci gpd =
151150

152151
-- | Adds useful bits to 'CheckCtx' (as now, whether we are operating under
153152
-- a user off-by-default flag).
154-
initCheckCtx :: Monad m => TargetAnnotation a -> CheckCtx m -> CheckCtx m
153+
initCheckCtx :: TargetAnnotation a -> CheckCtx m -> CheckCtx m
155154
initCheckCtx t c = c{ccFlag = taPackageFlag t}
156155

157156
-- | 'TargetAnnotation' collects contextual information on the target we are
@@ -323,7 +322,7 @@ checkIntDep acc mck = do
323322
po <- asksCM (acc . ccInterface)
324323
maybe (return ()) (lc . mck) po
325324
where
326-
lc :: Monad m => m (Maybe PackageCheck) -> CheckM m ()
325+
lc :: m (Maybe PackageCheck) -> CheckM m ()
327326
lc wmck = do
328327
b <- liftCM wmck
329328
maybe (return ()) (check True) b

0 commit comments

Comments
 (0)