Skip to content

Commit b5a4d7c

Browse files
committed
Monoid of no Mappend
1 parent 1c532b0 commit b5a4d7c

86 files changed

Lines changed: 177 additions & 270 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cabal-described/src/Distribution/Utils/CharSet.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ instance Semigroup CharSet where
6161

6262
instance Monoid CharSet where
6363
mempty = empty
64-
mappend = (<>)
6564

6665
-- | Empty character set.
6766
empty :: CharSet

Cabal-described/src/Distribution/Utils/GrammarRegex.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ instance Semigroup (GrammarRegex a) where
7777

7878
instance Monoid (GrammarRegex a) where
7979
mempty = REAppend []
80-
mappend = (<>)
8180

8281
-------------------------------------------------------------------------------
8382
-- Smart constructors

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ snoc xs x = xs <> singleton x
4848

4949
instance Monoid (DList a) where
5050
mempty = empty
51-
mappend = (<>)
5251

5352
instance Semigroup (DList a) where
5453
DList a <> DList b = DList (a . b)

Cabal-syntax/src/Distribution/Compiler.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ instance Semigroup a => Semigroup (PerCompilerFlavor a) where
164164

165165
instance Monoid a => Monoid (PerCompilerFlavor a) where
166166
mempty = PerCompilerFlavor mempty mempty
167-
mappend = (<>)
168167

169168
-- ------------------------------------------------------------
170169

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class
121121

122122
-- | Monoidal field.
123123
--
124-
-- Values are combined with 'mappend'.
124+
-- Values are combined with '(<>)'.
125125
--
126126
-- /Note:/ 'optionalFieldAla' is a @monoidalField@ with 'Last' monoid.
127127
monoidalFieldAla
@@ -221,7 +221,7 @@ optionalFieldDef
221221
-> g s a
222222
optionalFieldDef fn l x = optionalFieldDefAla fn Identity l x
223223

224-
-- | Field which can be define multiple times, and the results are @mappend@ed.
224+
-- | Field which can be define multiple times, and the results are combined with '(<>)'.
225225
monoidalField
226226
:: (FieldGrammar c g, c (Identity a), Monoid a)
227227
=> FieldName

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ newtype FieldDescrs s a = F {runF :: Map P.FieldName (SP s)}
3838

3939
instance Applicative (FieldDescrs s) where
4040
pure _ = F mempty
41-
f <*> x = F (mappend (runF f) (runF x))
41+
f <*> x = F (runF f <> runF x)
4242

4343
singletonF :: P.FieldName -> (s -> Disp.Doc) -> (forall m. P.CabalParsing m => s -> m s) -> FieldDescrs s a
4444
singletonF fn f g = F $ Map.singleton fn (SP f g)
@@ -102,7 +102,7 @@ instance FieldGrammar ParsecPretty FieldDescrs where
102102
monoidalFieldAla fn _pack l = singletonF fn f g
103103
where
104104
f s = pretty (pack' _pack (aview l s))
105-
g s = cloneLens l (\x -> mappend x . unpack' _pack <$> P.parsec) s
105+
g s = cloneLens l (\x -> (x <>) . unpack' _pack <$> P.parsec) s
106106

107107
prefixedFields _fnPfx _l = F mempty
108108
knownField _ = pure ()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ instance Applicative (ParsecFieldGrammar s) where
154154

155155
ParsecFG f f' f'' <*> ParsecFG x x' x'' =
156156
ParsecFG
157-
(mappend f x)
158-
(mappend f' x')
157+
(f <> x)
158+
(f' <> x')
159159
(\v fields -> f'' v fields <*> x'' v fields)
160160
{-# INLINE (<*>) #-}
161161

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ data DepTestRslt
155155

156156
instance Monoid DepTestRslt where
157157
mempty = DepOk
158-
mappend = (<>)
159158

160159
instance Semigroup DepTestRslt where
161160
DepOk <> x = x
@@ -402,7 +401,6 @@ data PDTagged
402401

403402
instance Monoid PDTagged where
404403
mempty = PDNull
405-
mappend = (<>)
406404

407405
instance Semigroup PDTagged where
408406
PDNull <> x = x

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,10 +717,10 @@ onAllBranches p = go mempty
717717
-- done. If not, then one of the conditional branches below the current node
718718
-- must satisfy it. Each node may have multiple immediate children; we only
719719
-- one need one to satisfy the property because the configure step uses
720-
-- 'mappend' to join together the results of flag resolution.
720+
-- '(<>)' to join together the results of flag resolution.
721721
go :: a -> CondTree v a -> Bool
722722
go acc ct =
723-
let acc' = acc `mappend` condTreeData ct
723+
let acc' = acc <> condTreeData ct
724724
in p acc' || any (goBranch acc') (condTreeComponents ct)
725725

726726
-- Both the 'true' and the 'false' block must satisfy the property.

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ instance Monoid Benchmark where
4343
, benchmarkInterface = mempty
4444
, benchmarkBuildInfo = mempty
4545
}
46-
mappend = (<>)
4746

4847
instance Semigroup Benchmark where
4948
a <> b =
@@ -53,7 +52,7 @@ instance Semigroup Benchmark where
5352
, benchmarkBuildInfo = combine benchmarkBuildInfo
5453
}
5554
where
56-
combine field = field a `mappend` field b
55+
combine field = field a <> field b
5756

5857
emptyBenchmark :: Benchmark
5958
emptyBenchmark = mempty

0 commit comments

Comments
 (0)