Skip to content

Commit 2eeb8de

Browse files
committed
Remove -XMultiWayIf
1 parent 5d54d82 commit 2eeb8de

File tree

1 file changed

+12
-14
lines changed
  • cabal-install/src/Distribution/Client/ProjectConfig

1 file changed

+12
-14
lines changed

cabal-install/src/Distribution/Client/ProjectConfig/Legacy.hs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{-# LANGUAGE ConstraintKinds #-}
22
{-# LANGUAGE DataKinds #-}
33
{-# LANGUAGE DeriveGeneric #-}
4-
{-# LANGUAGE MultiWayIf #-}
54
{-# LANGUAGE NamedFieldPuns #-}
65
{-# LANGUAGE RecordWildCards #-}
76
{-# LANGUAGE ScopedTypeVariables #-}
@@ -322,19 +321,18 @@ parseProjectSkeleton cacheDir httpTransport verbosity importsBy dupesMap project
322321
mapM_ (debug verbosity) seenImports
323322
debug verbosity "\n"
324323

325-
if
326-
| isCyclicConfigPath normLocPath ->
327-
pure . projectParseFail Nothing (Just normSource) $ ParseUtils.FromString (render $ cyclicalImportMsg normLocPath) Nothing
328-
| otherwise -> do
329-
when
330-
(isUntrimmedUriConfigPath importLocPath)
331-
(noticeDoc verbosity $ untrimmedUriImportMsg (Disp.text "Warning:") importLocPath)
332-
let fs = (\z -> CondNode z [normLocPath] mempty) <$> fieldsToConfig normSource (reverse acc)
333-
let uniqueFields = if uniqueImport `elem` seenImports then [] else xs
334-
atomicModifyIORef' dupesMap $ \dm -> (Map.insertWith (++) uniqueImport [Dupes uniqueImport normLocPath seenImportsBy] dm, ())
335-
res <- parseProjectSkeleton cacheDir httpTransport verbosity importsBy dupesMap projectDir importLocPath . ProjectConfigToParse =<< fetchImportConfig normLocPath
336-
rest <- go [] uniqueFields
337-
pure . fmap mconcat . sequence $ [projectParse Nothing normSource fs, res, rest]
324+
if isCyclicConfigPath normLocPath
325+
then pure . projectParseFail Nothing (Just normSource) $ ParseUtils.FromString (render $ cyclicalImportMsg normLocPath) Nothing
326+
else do
327+
when
328+
(isUntrimmedUriConfigPath importLocPath)
329+
(noticeDoc verbosity $ untrimmedUriImportMsg (Disp.text "Warning:") importLocPath)
330+
let fs = (\z -> CondNode z [normLocPath] mempty) <$> fieldsToConfig normSource (reverse acc)
331+
let uniqueFields = if uniqueImport `elem` seenImports then [] else xs
332+
atomicModifyIORef' dupesMap $ \dm -> (Map.insertWith (++) uniqueImport [Dupes uniqueImport normLocPath seenImportsBy] dm, ())
333+
res <- parseProjectSkeleton cacheDir httpTransport verbosity importsBy dupesMap projectDir importLocPath . ProjectConfigToParse =<< fetchImportConfig normLocPath
334+
rest <- go [] uniqueFields
335+
pure . fmap mconcat . sequence $ [projectParse Nothing normSource fs, res, rest]
338336
(ParseUtils.Section l "if" p xs') -> do
339337
normSource <- canonicalizeConfigPath projectDir source
340338
subpcs <- go [] xs'

0 commit comments

Comments
 (0)