Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cabal-described/src/Distribution/Utils/CharSet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ instance Semigroup CharSet where

instance Monoid CharSet where
mempty = empty
mappend = (<>)

-- | Empty character set.
empty :: CharSet
Expand Down
1 change: 0 additions & 1 deletion Cabal-described/src/Distribution/Utils/GrammarRegex.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ instance Semigroup (GrammarRegex a) where

instance Monoid (GrammarRegex a) where
mempty = REAppend []
mappend = (<>)

-------------------------------------------------------------------------------
-- Smart constructors
Expand Down
1 change: 0 additions & 1 deletion Cabal-syntax/src/Distribution/Compat/DList.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ snoc xs x = xs <> singleton x

instance Monoid (DList a) where
mempty = empty
mappend = (<>)

instance Semigroup (DList a) where
DList a <> DList b = DList (a . b)
1 change: 0 additions & 1 deletion Cabal-syntax/src/Distribution/Compiler.hs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ instance Semigroup a => Semigroup (PerCompilerFlavor a) where

instance Monoid a => Monoid (PerCompilerFlavor a) where
mempty = PerCompilerFlavor mempty mempty
mappend = (<>)

-- ------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions Cabal-syntax/src/Distribution/FieldGrammar/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class

-- | Monoidal field.
--
-- Values are combined with 'mappend'.
-- Values are combined with '(<>)'.
--
-- /Note:/ 'optionalFieldAla' is a @monoidalField@ with 'Last' monoid.
monoidalFieldAla
Expand Down Expand Up @@ -221,7 +221,7 @@ optionalFieldDef
-> g s a
optionalFieldDef fn l x = optionalFieldDefAla fn Identity l x

-- | Field which can be define multiple times, and the results are @mappend@ed.
-- | Field which can be define multiple times, and the results are combined with '(<>)'.
monoidalField
:: (FieldGrammar c g, c (Identity a), Monoid a)
=> FieldName
Expand Down
4 changes: 2 additions & 2 deletions Cabal-syntax/src/Distribution/FieldGrammar/FieldDescrs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ newtype FieldDescrs s a = F {runF :: Map P.FieldName (SP s)}

instance Applicative (FieldDescrs s) where
pure _ = F mempty
f <*> x = F (mappend (runF f) (runF x))
f <*> x = F (runF f <> runF x)

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

prefixedFields _fnPfx _l = F mempty
knownField _ = pure ()
Expand Down
4 changes: 2 additions & 2 deletions Cabal-syntax/src/Distribution/FieldGrammar/Parsec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ instance Applicative (ParsecFieldGrammar s) where

ParsecFG f f' f'' <*> ParsecFG x x' x'' =
ParsecFG
(mappend f x)
(mappend f' x')
(f <> x)
(f' <> x')
(\v fields -> f'' v fields <*> x'' v fields)
{-# INLINE (<*>) #-}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ data DepTestRslt

instance Monoid DepTestRslt where
mempty = DepOk
mappend = (<>)

instance Semigroup DepTestRslt where
DepOk <> x = x
Expand Down Expand Up @@ -402,7 +401,6 @@ data PDTagged

instance Monoid PDTagged where
mempty = PDNull
mappend = (<>)

instance Semigroup PDTagged where
PDNull <> x = x
Expand Down
4 changes: 2 additions & 2 deletions Cabal-syntax/src/Distribution/PackageDescription/Parsec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -717,10 +717,10 @@ onAllBranches p = go mempty
-- done. If not, then one of the conditional branches below the current node
-- must satisfy it. Each node may have multiple immediate children; we only
-- one need one to satisfy the property because the configure step uses
-- 'mappend' to join together the results of flag resolution.
-- '(<>)' to join together the results of flag resolution.
go :: a -> CondTree v a -> Bool
go acc ct =
let acc' = acc `mappend` condTreeData ct
let acc' = acc <> condTreeData ct
in p acc' || any (goBranch acc') (condTreeComponents ct)

-- Both the 'true' and the 'false' block must satisfy the property.
Expand Down
3 changes: 1 addition & 2 deletions Cabal-syntax/src/Distribution/Types/Benchmark.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ instance Monoid Benchmark where
, benchmarkInterface = mempty
, benchmarkBuildInfo = mempty
}
mappend = (<>)

instance Semigroup Benchmark where
a <> b =
Expand All @@ -53,7 +52,7 @@ instance Semigroup Benchmark where
, benchmarkBuildInfo = combine benchmarkBuildInfo
}
where
combine field = field a `mappend` field b
combine field = field a <> field b

emptyBenchmark :: Benchmark
emptyBenchmark = mempty
Expand Down
1 change: 0 additions & 1 deletion Cabal-syntax/src/Distribution/Types/BenchmarkInterface.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ instance NFData BenchmarkInterface

instance Monoid BenchmarkInterface where
mempty = BenchmarkUnsupported (BenchmarkTypeUnknown mempty nullVersion)
mappend = (<>)

instance Semigroup BenchmarkInterface where
a <> (BenchmarkUnsupported _) = a
Expand Down
3 changes: 1 addition & 2 deletions Cabal-syntax/src/Distribution/Types/BuildInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ instance Monoid BuildInfo where
, targetBuildDepends = []
, mixins = []
}
mappend = (<>)

instance Semigroup BuildInfo where
a <> b =
Expand Down Expand Up @@ -260,7 +259,7 @@ instance Semigroup BuildInfo where
, mixins = combine mixins
}
where
combine field = field a `mappend` field b
combine field = field a <> field b
combineNub field = ordNub (combine field)
combineMby field = field b `mplus` field a

Expand Down
1 change: 0 additions & 1 deletion Cabal-syntax/src/Distribution/Types/CondTree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ instance Semigroup a => Semigroup (CondTree v a) where
(CondNode a bs) <> (CondNode a' bs') = CondNode (a <> a') (bs <> bs')

instance Monoid a => Monoid (CondTree v a) where
mappend = (<>)
mempty = CondNode mempty mempty

-- | A 'CondBranch' represents a conditional branch, e.g., @if
Expand Down
9 changes: 4 additions & 5 deletions Cabal-syntax/src/Distribution/Types/Condition.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ instance Foldable Condition where
f `foldMap` Var c = f c
_ `foldMap` Lit _ = mempty
f `foldMap` CNot c = foldMap f c
f `foldMap` COr c d = foldMap f c `mappend` foldMap f d
f `foldMap` CAnd c d = foldMap f c `mappend` foldMap f d
f `foldMap` COr c d = foldMap f c <> foldMap f d
f `foldMap` CAnd c d = foldMap f c <> foldMap f d

instance Traversable Condition where
f `traverse` Var c = Var `fmap` f c
Expand All @@ -85,18 +85,17 @@ instance Monad Condition where

instance Monoid (Condition a) where
mempty = Lit False
mappend = (<>)

instance Semigroup (Condition a) where
(<>) = COr

instance Alternative Condition where
empty = mempty
(<|>) = mappend
(<|>) = (<>)

instance MonadPlus Condition where
mzero = mempty
mplus = mappend
mplus = (<>)

instance Binary c => Binary (Condition c)
instance Structured c => Structured (Condition c)
Expand Down
1 change: 0 additions & 1 deletion Cabal-syntax/src/Distribution/Types/DependencyMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ newtype DependencyMap = DependencyMap {unDependencyMap :: Map PackageName (Versi

instance Monoid DependencyMap where
mempty = DependencyMap Map.empty
mappend = (<>)

instance Semigroup DependencyMap where
(DependencyMap a) <> (DependencyMap b) =
Expand Down
3 changes: 1 addition & 2 deletions Cabal-syntax/src/Distribution/Types/Executable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ instance Monoid Executable where
, exeScope = mempty
, buildInfo = mempty
}
mappend = (<>)

instance Semigroup Executable where
a <> b =
Expand All @@ -54,7 +53,7 @@ instance Semigroup Executable where
, buildInfo = combine buildInfo
}
where
combine field = field a `mappend` field b
combine field = field a <> field b

emptyExecutable :: Executable
emptyExecutable = mempty
Expand Down
1 change: 0 additions & 1 deletion Cabal-syntax/src/Distribution/Types/ExecutableScope.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ instance Semigroup ExecutableScope where
-- | 'mempty' = 'ExecutablePublic'
instance Monoid ExecutableScope where
mempty = ExecutablePublic
mappend = (<>)
1 change: 0 additions & 1 deletion Cabal-syntax/src/Distribution/Types/Flag.hs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ instance Semigroup FlagAssignment where

instance Monoid FlagAssignment where
mempty = FlagAssignment Map.empty
mappend = (<>)

-- | Construct a 'FlagAssignment' from a list of flag/value pairs.
--
Expand Down
3 changes: 1 addition & 2 deletions Cabal-syntax/src/Distribution/Types/ForeignLib.hs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ instance Semigroup ForeignLib where
, foreignLibModDefFile = combine foreignLibModDefFile
}
where
combine field = field a `mappend` field b
combine field = field a <> field b
-- chooseLast: the second field overrides the first, unless it is Nothing
chooseLast field = getLast (Last (field a) <> Last (field b))

Expand All @@ -167,7 +167,6 @@ instance Monoid ForeignLib where
, foreignLibVersionLinux = Nothing
, foreignLibModDefFile = []
}
mappend = (<>)

-- | An empty foreign library.
emptyForeignLib :: ForeignLib
Expand Down
1 change: 0 additions & 1 deletion Cabal-syntax/src/Distribution/Types/ForeignLibType.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ instance Semigroup ForeignLibType where

instance Monoid ForeignLibType where
mempty = ForeignLibTypeUnknown
mappend = (<>)

knownForeignLibTypes :: [ForeignLibType]
knownForeignLibTypes =
Expand Down
3 changes: 1 addition & 2 deletions Cabal-syntax/src/Distribution/Types/Library.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ emptyLibrary =
-- libraries when `buildable: false`. This may cause problems.
instance Monoid Library where
mempty = emptyLibrary
mappend = (<>)

instance Semigroup Library where
a <> b =
Expand All @@ -75,7 +74,7 @@ instance Semigroup Library where
, libBuildInfo = combine libBuildInfo
}
where
combine field = field a `mappend` field b
combine field = field a <> field b

-- | Get all the module names from the library (exposed and internal modules)
-- which are explicitly listed in the package description which would
Expand Down
1 change: 0 additions & 1 deletion Cabal-syntax/src/Distribution/Types/LibraryVisibility.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,3 @@ instance Semigroup LibraryVisibility where

instance Monoid LibraryVisibility where
mempty = LibraryVisibilityPrivate
mappend = (<>)
4 changes: 2 additions & 2 deletions Cabal-syntax/src/Distribution/Types/PackageDescription.hs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ updatePackageDescription (mb_lib_bi, exe_bi) p =
}
where
updateLibrary :: Maybe BuildInfo -> Maybe Library -> Maybe Library
updateLibrary (Just bi) (Just lib) = Just (lib{libBuildInfo = bi `mappend` libBuildInfo lib})
updateLibrary (Just bi) (Just lib) = Just (lib{libBuildInfo = bi <> libBuildInfo lib})
updateLibrary Nothing mb_lib = mb_lib
updateLibrary (Just _) Nothing = Nothing

Expand All @@ -402,7 +402,7 @@ updatePackageDescription (mb_lib_bi, exe_bi) p =
-- \^list with exeName updated
updateExecutable _ [] = []
updateExecutable exe_bi'@(name, bi) (exe : exes)
| exeName exe == name = exe{buildInfo = bi `mappend` buildInfo exe} : exes
| exeName exe == name = exe{buildInfo = bi <> buildInfo exe} : exes
| otherwise = exe : updateExecutable exe_bi' exes

-- -----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion Cabal-syntax/src/Distribution/Types/SetupBuildInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ instance NFData SetupBuildInfo

instance Monoid SetupBuildInfo where
mempty = SetupBuildInfo [] False
mappend = (<>)

instance Semigroup SetupBuildInfo where
a <> b =
Expand Down
3 changes: 1 addition & 2 deletions Cabal-syntax/src/Distribution/Types/TestSuite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ instance Monoid TestSuite where
, testBuildInfo = mempty
, testCodeGenerators = mempty
}
mappend = (<>)

instance Semigroup TestSuite where
a <> b =
Expand All @@ -57,7 +56,7 @@ instance Semigroup TestSuite where
, testCodeGenerators = combine testCodeGenerators
}
where
combine field = field a `mappend` field b
combine field = field a <> field b

emptyTestSuite :: TestSuite
emptyTestSuite = mempty
Expand Down
1 change: 0 additions & 1 deletion Cabal-syntax/src/Distribution/Types/TestSuiteInterface.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ instance NFData TestSuiteInterface

instance Monoid TestSuiteInterface where
mempty = TestSuiteUnsupported (TestTypeUnknown mempty nullVersion)
mappend = (<>)

instance Semigroup TestSuiteInterface where
a <> (TestSuiteUnsupported _) = a
Expand Down
2 changes: 1 addition & 1 deletion Cabal-syntax/src/Distribution/Types/VersionInterval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ stage2 = sortBy lowerboundCmp

lowerboundCmp :: VersionInterval -> VersionInterval -> Ordering
lowerboundCmp (VersionInterval (LowerBound v vb) _) (VersionInterval (LowerBound u ub) _) =
compare v u `mappend` compareBound vb ub
compare v u <> compareBound vb ub
where
compareBound :: Bound -> Bound -> Ordering
compareBound InclusiveBound InclusiveBound = EQ
Expand Down
4 changes: 1 addition & 3 deletions Cabal-tests/tests/HackageTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ instance Semigroup ParsecResult where

instance Monoid ParsecResult where
mempty = ParsecResult 0 0 0
mappend = (<>)

instance NFData ParsecResult where
rnf ParsecResult{} = ()
Expand Down Expand Up @@ -243,7 +242,6 @@ instance Semigroup CheckResult where

instance Monoid CheckResult where
mempty = CheckResult 0 0 0 0 0 0 0 0
mappend = (<>)

toCheckResult :: PackageCheck -> CheckResult
toCheckResult PackageBuildImpossible {} = CheckResult 0 0 1 1 0 0 0 0
Expand Down Expand Up @@ -472,4 +470,4 @@ fieldLinesToString fieldLines =
foldIO :: forall a m. (Monoid m) => (a -> IO m) -> [a] -> IO m
foldIO f = go mempty where
go !acc [] = acc
go !acc (x:xs) = go (mappend acc (f x)) xs
go !acc (x:xs) = go (acc <> f x) xs
Loading
Loading