Skip to content

Commit 2f516e4

Browse files
committed
Make fourmolu happy
Cabal codebase has now a formatter/style standard (see haskell#8950). “Ravioli ravioli, give me the formuoli”
1 parent 9c270c7 commit 2f516e4

File tree

10 files changed

+3233
-2525
lines changed

10 files changed

+3233
-2525
lines changed

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

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,29 @@ unqualComponentNameToPackageName = mkPackageNameST . unUnqualComponentNameST
110110
-- | Combine names in targets if one name is empty or both names are equal
111111
-- (partial function).
112112
-- Useful in 'Semigroup' and similar instances.
113-
combineNames :: a -> a -> (a -> UnqualComponentName) -> String ->
114-
UnqualComponentName
113+
combineNames
114+
:: a
115+
-> a
116+
-> (a -> UnqualComponentName)
117+
-> String
118+
-> UnqualComponentName
115119
combineNames a b tacc tt
116-
-- One empty or the same.
117-
| P.null unb ||
118-
una == unb = na
119-
| P.null una = nb
120-
-- Both non-empty, different.
121-
| otherwise = error $ "Ambiguous values for " ++ tt ++ " field: '"
122-
++ una ++ "' and '" ++ unb ++ "'"
123-
where
124-
(na, nb) = (tacc a, tacc b)
125-
una = unUnqualComponentName na
126-
unb = unUnqualComponentName nb
127-
120+
-- One empty or the same.
121+
| P.null unb
122+
|| una == unb =
123+
na
124+
| P.null una = nb
125+
-- Both non-empty, different.
126+
| otherwise =
127+
error $
128+
"Ambiguous values for "
129+
++ tt
130+
++ " field: '"
131+
++ una
132+
++ "' and '"
133+
++ unb
134+
++ "'"
135+
where
136+
(na, nb) = (tacc a, tacc b)
137+
una = unUnqualComponentName na
138+
unb = unUnqualComponentName nb

0 commit comments

Comments
 (0)