Skip to content

Commit

Permalink
Fix compat for various ghc versions
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoutts committed Nov 20, 2017
1 parent 4760f24 commit 7996ed5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
7 changes: 3 additions & 4 deletions cabal-install/Distribution/Client/ProjectOrchestration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ module Distribution.Client.ProjectOrchestration (
cmdCommonHelpTextNewBuildBeta,
) where

import Prelude ()
import Distribution.Client.Compat.Prelude

import Distribution.Client.ProjectConfig
import Distribution.Client.ProjectPlanning
hiding ( pruneInstallPlanToTargets )
Expand Down Expand Up @@ -143,11 +146,7 @@ import Distribution.Simple.Compiler
import qualified Data.Monoid as Mon
import qualified Data.Set as Set
import qualified Data.Map as Map
import Data.Map (Map)
import Data.List
import Data.Maybe
import Data.Either
import Control.Monad (void)
import Control.Exception (Exception(..), throwIO, assert)
import System.Exit (ExitCode(..), exitFailure)
#ifdef MIN_VERSION_unix
Expand Down
25 changes: 6 additions & 19 deletions cabal-install/Distribution/Client/TargetSelector.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ module Distribution.Client.TargetSelector (
defaultDirActions,
) where

import Prelude ()
import Distribution.Client.Compat.Prelude

import Distribution.Package
( Package(..), PackageId, PackageName, packageName )
import Distribution.Types.UnqualComponentName
Expand Down Expand Up @@ -74,36 +77,19 @@ import Data.Either
import Data.Function
( on )
import Data.List
( nubBy, stripPrefix, partition, intercalate, sortBy, groupBy )
import Data.Maybe
( maybeToList )
( stripPrefix, partition, groupBy )
import Data.Ord
( comparing )
import Distribution.Compat.Binary (Binary)
import GHC.Generics (Generic)
#if MIN_VERSION_containers(0,5,0)
import qualified Data.Map.Lazy as Map.Lazy
import qualified Data.Map.Strict as Map
import Data.Map.Strict (Map)
#else
import qualified Data.Map as Map.Lazy
import qualified Data.Map as Map
import Data.Map (Map)
#endif
import qualified Data.Set as Set
import Control.Arrow ((&&&))
import Control.Monad
#if __GLASGOW_HASKELL__ < 710
import Control.Applicative (Applicative(..), (<$>))
#endif
import Control.Applicative (Alternative(..))
import qualified Distribution.Compat.ReadP as Parse
import Distribution.Compat.ReadP
( (+++), (<++) )
import Distribution.ParseUtils
( readPToMaybe )
import Data.Char
( isSpace, isAlphaNum )
import System.FilePath as FilePath
( takeExtension, dropExtension
, splitDirectories, joinPath, splitPath )
Expand Down Expand Up @@ -1014,7 +1000,8 @@ syntaxForm1File ps =
-- all the other forms we don't require that.
syntaxForm1 render $ \str1 fstatus1 ->
expecting "file" str1 $ do
(pkgfile, KnownPackage{pinfoId, pinfoComponents})
(pkgfile, ~KnownPackage{pinfoId, pinfoComponents})
-- always returns the KnownPackage case
<- matchPackageDirectoryPrefix ps fstatus1
orNoThingIn "package" (display (packageName pinfoId)) $ do
(filepath, c) <- matchComponentFile pinfoComponents pkgfile
Expand Down

0 comments on commit 7996ed5

Please sign in to comment.