Commit 1aee4142 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov

-Wall police (GHC 7.10 edition).

parent af77559c
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Compat.ReadP -- Module : Distribution.Compat.ReadP
...@@ -71,7 +72,10 @@ module Distribution.Compat.ReadP ...@@ -71,7 +72,10 @@ module Distribution.Compat.ReadP
import Control.Monad( MonadPlus(..), liftM, liftM2, ap ) import Control.Monad( MonadPlus(..), liftM, liftM2, ap )
import Data.Char (isSpace) import Data.Char (isSpace)
import Control.Applicative (Applicative(..), Alternative(empty, (<|>))) #if __GLASGOW_HASKELL__ < 710
import Control.Applicative (Applicative(..))
#endif
import Control.Applicative (Alternative(empty, (<|>)))
infixr 5 +++, <++ infixr 5 +++, <++
......
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveGeneric #-}
...@@ -109,7 +110,9 @@ import Distribution.Compat.Binary (Binary) ...@@ -109,7 +110,9 @@ import Distribution.Compat.Binary (Binary)
import Data.Data (Data) import Data.Data (Data)
import Data.List (nub, intercalate) import Data.List (nub, intercalate)
import Data.Maybe (fromMaybe, maybeToList) import Data.Maybe (fromMaybe, maybeToList)
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid (Monoid(mempty, mappend)) import Data.Monoid (Monoid(mempty, mappend))
#endif
import Data.Typeable ( Typeable ) import Data.Typeable ( Typeable )
import Control.Monad (MonadPlus(mplus)) import Control.Monad (MonadPlus(mplus))
import GHC.Generics (Generic) import GHC.Generics (Generic)
......
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveDataTypeable #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
...@@ -42,10 +43,12 @@ module Distribution.PackageDescription.Parse ( ...@@ -42,10 +43,12 @@ module Distribution.PackageDescription.Parse (
import Data.Char (isSpace) import Data.Char (isSpace)
import Data.Maybe (listToMaybe, isJust) import Data.Maybe (listToMaybe, isJust)
import Data.Monoid ( Monoid(..) )
import Data.List (nub, unfoldr, partition, (\\)) import Data.List (nub, unfoldr, partition, (\\))
import Control.Monad (liftM, foldM, when, unless, ap) import Control.Monad (liftM, foldM, when, unless, ap)
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid ( Monoid(..) )
import Control.Applicative (Applicative(..)) import Control.Applicative (Applicative(..))
#endif
import Control.Arrow (first) import Control.Arrow (first)
import System.Directory (doesFileExist) import System.Directory (doesFileExist)
import qualified Data.ByteString.Lazy.Char8 as BS.Char8 import qualified Data.ByteString.Lazy.Char8 as BS.Char8
...@@ -622,10 +625,15 @@ newtype StT s m a = StT { runStT :: s -> m (a,s) } ...@@ -622,10 +625,15 @@ newtype StT s m a = StT { runStT :: s -> m (a,s) }
instance Functor f => Functor (StT s f) where instance Functor f => Functor (StT s f) where
fmap g (StT f) = StT $ fmap (first g) . f fmap g (StT f) = StT $ fmap (first g) . f
#if __GLASGOW_HASKELL__ >= 710
instance (Monad m) => Applicative (StT s m) where
#else
instance (Monad m, Functor m) => Applicative (StT s m) where instance (Monad m, Functor m) => Applicative (StT s m) where
#endif
pure = return pure = return
(<*>) = ap (<*>) = ap
instance Monad m => Monad (StT s m) where instance Monad m => Monad (StT s m) where
return a = StT (\s -> return (a,s)) return a = StT (\s -> return (a,s))
StT f >>= g = StT $ \s -> do StT f >>= g = StT $ \s -> do
......
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.PackageDescription.PrettyPrint -- Module : Distribution.PackageDescription.PrettyPrint
...@@ -17,7 +18,9 @@ module Distribution.PackageDescription.PrettyPrint ( ...@@ -17,7 +18,9 @@ module Distribution.PackageDescription.PrettyPrint (
showGenericPackageDescription, showGenericPackageDescription,
) where ) where
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid (Monoid(mempty)) import Data.Monoid (Monoid(mempty))
#endif
import Distribution.PackageDescription import Distribution.PackageDescription
( Benchmark(..), BenchmarkInterface(..), benchmarkType ( Benchmark(..), BenchmarkInterface(..), benchmarkType
, TestSuite(..), TestSuiteInterface(..), testType , TestSuite(..), TestSuiteInterface(..), testType
......
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.ParseUtils -- Module : Distribution.ParseUtils
...@@ -61,7 +62,9 @@ import Data.Maybe (fromMaybe) ...@@ -61,7 +62,9 @@ import Data.Maybe (fromMaybe)
import Data.Tree as Tree (Tree(..), flatten) import Data.Tree as Tree (Tree(..), flatten)
import qualified Data.Map as Map import qualified Data.Map as Map
import Control.Monad (foldM, ap) import Control.Monad (foldM, ap)
#if __GLASGOW_HASKELL__ < 710
import Control.Applicative (Applicative(..)) import Control.Applicative (Applicative(..))
#endif
import System.FilePath (normalise) import System.FilePath (normalise)
import Data.List (sortBy) import Data.List (sortBy)
......
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Client.BuildTargets -- Module : Distribution.Client.BuildTargets
...@@ -55,7 +56,10 @@ import Data.Either ...@@ -55,7 +56,10 @@ import Data.Either
( partitionEithers ) ( partitionEithers )
import qualified Data.Map as Map import qualified Data.Map as Map
import Control.Monad import Control.Monad
import Control.Applicative (Applicative(..), Alternative(..)) #if __GLASGOW_HASKELL__ < 710
import Control.Applicative (Applicative(..))
#endif
import Control.Applicative (Alternative(..))
import qualified Distribution.Compat.ReadP as Parse import qualified Distribution.Compat.ReadP as Parse
import Distribution.Compat.ReadP import Distribution.Compat.ReadP
( (+++), (<++) ) ( (+++), (<++) )
......
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Simple.CCompiler -- Module : Distribution.Simple.CCompiler
...@@ -46,8 +47,10 @@ module Distribution.Simple.CCompiler ( ...@@ -46,8 +47,10 @@ module Distribution.Simple.CCompiler (
filenameCDialect filenameCDialect
) where ) where
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid import Data.Monoid
( Monoid(..) ) ( Monoid(..) )
#endif
import System.FilePath import System.FilePath
( takeExtension ) ( takeExtension )
......
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Simple.Command -- Module : Distribution.Simple.Command
...@@ -63,7 +64,9 @@ import Control.Monad ...@@ -63,7 +64,9 @@ import Control.Monad
import Data.Char (isAlpha, toLower) import Data.Char (isAlpha, toLower)
import Data.List (sortBy) import Data.List (sortBy)
import Data.Maybe import Data.Maybe
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid import Data.Monoid
#endif
import qualified Distribution.GetOpt as GetOpt import qualified Distribution.GetOpt as GetOpt
import Distribution.Text import Distribution.Text
( Text(disp, parse) ) ( Text(disp, parse) )
...@@ -175,7 +178,7 @@ optArg' ad mkflag showflag = ...@@ -175,7 +178,7 @@ optArg' ad mkflag showflag =
optArg ad (succeedReadE (mkflag . Just)) def showflag optArg ad (succeedReadE (mkflag . Just)) def showflag
where def = mkflag Nothing where def = mkflag Nothing
noArg :: (Eq b, Monoid b) => b -> MkOptDescr (a -> b) (b -> a -> a) a noArg :: (Eq b) => b -> MkOptDescr (a -> b) (b -> a -> a) a
noArg flag sf lf d = choiceOpt [(flag, (sf,lf), d)] sf lf d noArg flag sf lf d = choiceOpt [(flag, (sf,lf), d)] sf lf d
boolOpt :: (b -> Maybe Bool) -> (Bool -> b) -> SFlags -> SFlags boolOpt :: (b -> Maybe Bool) -> (Bool -> b) -> SFlags -> SFlags
......
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE RecordWildCards #-}
...@@ -135,8 +136,10 @@ import Data.Maybe ...@@ -135,8 +136,10 @@ import Data.Maybe
import Data.Either import Data.Either
( partitionEithers ) ( partitionEithers )
import qualified Data.Set as Set import qualified Data.Set as Set
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid import Data.Monoid
( Monoid(..) ) ( Monoid(..) )
#endif
import qualified Data.Map as Map import qualified Data.Map as Map
import Data.Map (Map) import Data.Map (Map)
import Data.Traversable import Data.Traversable
......
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Simple.GHC -- Module : Distribution.Simple.GHC
...@@ -107,7 +108,9 @@ import Data.Char ( isDigit, isSpace ) ...@@ -107,7 +108,9 @@ import Data.Char ( isDigit, isSpace )
import Data.List import Data.List
import qualified Data.Map as M ( fromList ) import qualified Data.Map as M ( fromList )
import Data.Maybe ( catMaybes ) import Data.Maybe ( catMaybes )
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid ( Monoid(..) ) import Data.Monoid ( Monoid(..) )
#endif
import Data.Version ( showVersion ) import Data.Version ( showVersion )
import System.Directory import System.Directory
( doesFileExist, getAppUserDataDirectory, createDirectoryIfMissing ) ( doesFileExist, getAppUserDataDirectory, createDirectoryIfMissing )
......
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Simple.GHC.Internal -- Module : Distribution.Simple.GHC.Internal
...@@ -66,7 +67,9 @@ import qualified Data.Map as M ...@@ -66,7 +67,9 @@ import qualified Data.Map as M
import Data.Char ( isSpace ) import Data.Char ( isSpace )
import Data.Maybe ( fromMaybe, maybeToList, isJust ) import Data.Maybe ( fromMaybe, maybeToList, isJust )
import Control.Monad ( unless, when ) import Control.Monad ( unless, when )
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid ( Monoid(..) ) import Data.Monoid ( Monoid(..) )
#endif
import System.Directory ( getDirectoryContents, getTemporaryDirectory ) import System.Directory ( getDirectoryContents, getTemporaryDirectory )
import System.Environment ( getEnv ) import System.Environment ( getEnv )
import System.FilePath ( (</>), (<.>), takeExtension, takeDirectory ) import System.FilePath ( (</>), (<.>), takeExtension, takeDirectory )
......
{-# LANGUAGE CPP #-}
module Distribution.Simple.GHCJS ( module Distribution.Simple.GHCJS (
configure, getInstalledPackages, getPackageDBContents, configure, getInstalledPackages, getPackageDBContents,
buildLib, buildExe, buildLib, buildExe,
...@@ -71,7 +72,9 @@ import Language.Haskell.Extension ( Extension(..) ...@@ -71,7 +72,9 @@ import Language.Haskell.Extension ( Extension(..)
import Control.Monad ( unless, when ) import Control.Monad ( unless, when )
import Data.Char ( isSpace ) import Data.Char ( isSpace )
import qualified Data.Map as M ( fromList ) import qualified Data.Map as M ( fromList )
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid ( Monoid(..) ) import Data.Monoid ( Monoid(..) )
#endif
import System.Directory ( doesFileExist ) import System.Directory ( doesFileExist )
import System.FilePath ( (</>), (<.>), takeExtension, import System.FilePath ( (</>), (<.>), takeExtension,
takeDirectory, replaceExtension, takeDirectory, replaceExtension,
......
{-# LANGUAGE CPP, ForeignFunctionInterface #-} {-# LANGUAGE CPP #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveGeneric #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
...@@ -47,7 +48,9 @@ module Distribution.Simple.InstallDirs ( ...@@ -47,7 +48,9 @@ module Distribution.Simple.InstallDirs (
import Distribution.Compat.Binary (Binary) import Distribution.Compat.Binary (Binary)
import Data.List (isPrefixOf) import Data.List (isPrefixOf)
import Data.Maybe (fromMaybe) import Data.Maybe (fromMaybe)
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid (Monoid(..)) import Data.Monoid (Monoid(..))
#endif
import GHC.Generics (Generic) import GHC.Generics (Generic)
import System.Directory (getAppUserDataDirectory) import System.Directory (getAppUserDataDirectory)
import System.FilePath ((</>), isPathSeparator, pathSeparator) import System.FilePath ((</>), isPathSeparator, pathSeparator)
......
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Simple.LHC -- Module : Distribution.Simple.LHC
...@@ -90,7 +91,9 @@ import Control.Monad ( unless, when ) ...@@ -90,7 +91,9 @@ import Control.Monad ( unless, when )
import Data.List import Data.List
import qualified Data.Map as M ( empty ) import qualified Data.Map as M ( empty )
import Data.Maybe ( catMaybes ) import Data.Maybe ( catMaybes )
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid ( Monoid(..) ) import Data.Monoid ( Monoid(..) )
#endif
import System.Directory ( removeFile, renameFile, import System.Directory ( removeFile, renameFile,
getDirectoryContents, doesFileExist, getDirectoryContents, doesFileExist,
getTemporaryDirectory ) getTemporaryDirectory )
......
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveGeneric #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
...@@ -79,7 +80,9 @@ import qualified Data.Graph as Graph ...@@ -79,7 +80,9 @@ import qualified Data.Graph as Graph
import Data.List as List import Data.List as List
( null, foldl', sort ( null, foldl', sort
, groupBy, sortBy, find, isInfixOf, nubBy, deleteBy, deleteFirstsBy ) , groupBy, sortBy, find, isInfixOf, nubBy, deleteBy, deleteFirstsBy )
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid (Monoid(..)) import Data.Monoid (Monoid(..))
#endif
import Data.Map (Map) import Data.Map (Map)
import qualified Data.Map as Map import qualified Data.Map as Map
import Data.Maybe (isNothing, fromMaybe) import Data.Maybe (isNothing, fromMaybe)
...@@ -379,7 +382,7 @@ allPackagesBySourcePackageId (PackageIndex _ pnames) = ...@@ -379,7 +382,7 @@ allPackagesBySourcePackageId (PackageIndex _ pnames) =
-- Since multiple package DBs mask each other by 'InstalledPackageId', -- Since multiple package DBs mask each other by 'InstalledPackageId',
-- then we get back at most one package. -- then we get back at most one package.
-- --
lookupInstalledPackageId :: PackageInstalled a => PackageIndex a -> InstalledPackageId lookupInstalledPackageId :: PackageIndex a -> InstalledPackageId
-> Maybe a -> Maybe a
lookupInstalledPackageId (PackageIndex pids _) pid = Map.lookup pid pids lookupInstalledPackageId (PackageIndex pids _) pid = Map.lookup pid pids
...@@ -390,7 +393,7 @@ lookupInstalledPackageId (PackageIndex pids _) pid = Map.lookup pid pids ...@@ -390,7 +393,7 @@ lookupInstalledPackageId (PackageIndex pids _) pid = Map.lookup pid pids
-- but different 'InstalledPackageId'. They are returned in order of -- but different 'InstalledPackageId'. They are returned in order of
-- preference, with the most preferred first. -- preference, with the most preferred first.
-- --
lookupSourcePackageId :: PackageInstalled a => PackageIndex a -> PackageId -> [a] lookupSourcePackageId :: PackageIndex a -> PackageId -> [a]
lookupSourcePackageId (PackageIndex _ pnames) pkgid = lookupSourcePackageId (PackageIndex _ pnames) pkgid =
case Map.lookup (packageName pkgid) pnames of case Map.lookup (packageName pkgid) pnames of
Nothing -> [] Nothing -> []
...@@ -408,7 +411,7 @@ lookupPackageId index pkgid = case lookupSourcePackageId index pkgid of ...@@ -408,7 +411,7 @@ lookupPackageId index pkgid = case lookupSourcePackageId index pkgid of
-- | Does a lookup by source package name. -- | Does a lookup by source package name.
-- --
lookupPackageName :: PackageInstalled a => PackageIndex a -> PackageName lookupPackageName :: PackageIndex a -> PackageName
-> [(Version, [a])] -> [(Version, [a])]
lookupPackageName (PackageIndex _ pnames) name = lookupPackageName (PackageIndex _ pnames) name =
case Map.lookup name pnames of case Map.lookup name pnames of
...@@ -421,7 +424,7 @@ lookupPackageName (PackageIndex _ pnames) name = ...@@ -421,7 +424,7 @@ lookupPackageName (PackageIndex _ pnames) name =
-- We get back any number of versions of the specified package name, all -- We get back any number of versions of the specified package name, all
-- satisfying the version range constraint. -- satisfying the version range constraint.
-- --
lookupDependency :: PackageInstalled a => PackageIndex a -> Dependency lookupDependency :: PackageIndex a -> Dependency
-> [(Version, [a])] -> [(Version, [a])]
lookupDependency (PackageIndex _ pnames) (Dependency name versionRange) = lookupDependency (PackageIndex _ pnames) (Dependency name versionRange) =
case Map.lookup name pnames of case Map.lookup name pnames of
...@@ -446,7 +449,7 @@ lookupDependency (PackageIndex _ pnames) (Dependency name versionRange) = ...@@ -446,7 +449,7 @@ lookupDependency (PackageIndex _ pnames) (Dependency name versionRange) =
-- packages. The list of ambiguous results is split by exact package name. So -- packages. The list of ambiguous results is split by exact package name. So
-- it is a non-empty list of non-empty lists. -- it is a non-empty list of non-empty lists.
-- --
searchByName :: PackageInstalled a => PackageIndex a -> String -> SearchResult [a] searchByName :: PackageIndex a -> String -> SearchResult [a]
searchByName (PackageIndex _ pnames) name = searchByName (PackageIndex _ pnames) name =
case [ pkgs | pkgs@(PackageName name',_) <- Map.toList pnames case [ pkgs | pkgs@(PackageName name',_) <- Map.toList pnames
, lowercase name' == lname ] of , lowercase name' == lname ] of
...@@ -463,7 +466,7 @@ data SearchResult a = None | Unambiguous a | Ambiguous [a] ...@@ -463,7 +466,7 @@ data SearchResult a = None | Unambiguous a | Ambiguous [a]
-- --
-- That is, all packages that contain the given string in their name. -- That is, all packages that contain the given string in their name.
-- --
searchByNameSubstring :: PackageInstalled a => PackageIndex a -> String -> [a] searchByNameSubstring :: PackageIndex a -> String -> [a]
searchByNameSubstring (PackageIndex _ pnames) searchterm = searchByNameSubstring (PackageIndex _ pnames) searchterm =
[ pkg [ pkg
| (PackageName name, pvers) <- Map.toList pnames | (PackageName name, pvers) <- Map.toList pnames
......
{-# LANGUAGE CPP #-}
module Distribution.Simple.Program.GHC ( module Distribution.Simple.Program.GHC (
GhcOptions(..), GhcOptions(..),
GhcMode(..), GhcMode(..),
...@@ -26,7 +27,9 @@ import Distribution.Utils.NubList ( NubListR, fromNubListR ) ...@@ -26,7 +27,9 @@ import Distribution.Utils.NubList ( NubListR, fromNubListR )
import Language.Haskell.Extension ( Language(..), Extension(..) ) import Language.Haskell.Extension ( Language(..), Extension(..) )
import qualified Data.Map as M import qualified Data.Map as M
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid import Data.Monoid
#endif
import Data.List ( intercalate ) import Data.List ( intercalate )
-- | A structured set of GHC options/flags -- | A structured set of GHC options/flags
......
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveGeneric #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
...@@ -103,7 +104,9 @@ import Control.Monad (liftM) ...@@ -103,7 +104,9 @@ import Control.Monad (liftM)
import Distribution.Compat.Binary (Binary) import Distribution.Compat.Binary (Binary)
import Data.List ( sort ) import Data.List ( sort )
import Data.Char ( isSpace, isAlpha ) import Data.Char ( isSpace, isAlpha )
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid ( Monoid(..) ) import Data.Monoid ( Monoid(..) )
#endif
import GHC.Generics (Generic) import GHC.Generics (Generic)
-- FIXME Not sure where this should live -- FIXME Not sure where this should live
......
{-# LANGUAGE CPP #-}
module Distribution.Utils.NubList module Distribution.Utils.NubList
( NubList -- opaque ( NubList -- opaque
, toNubList -- smart construtor , toNubList -- smart construtor
...@@ -11,7 +12,9 @@ module Distribution.Utils.NubList ...@@ -11,7 +12,9 @@ module Distribution.Utils.NubList
) where ) where
import Distribution.Compat.Binary import Distribution.Compat.Binary
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid import Data.Monoid
#endif
import Distribution.Simple.Utils (ordNub, listUnion, ordNubRight, listUnionRight) import Distribution.Simple.Utils (ordNub, listUnion, ordNubRight, listUnionRight)
...@@ -60,7 +63,7 @@ instance (Ord a, Read a) => Read (NubList a) where ...@@ -60,7 +63,7 @@ instance (Ord a, Read a) => Read (NubList a) where
readPrec = readNubList toNubList readPrec = readNubList toNubList
-- | Helper used by NubList/NubListR's Read instances. -- | Helper used by NubList/NubListR's Read instances.
readNubList :: (Ord a, Read a) => ([a] -> l a) -> R.ReadPrec (l a) readNubList :: (Read a) => ([a] -> l a) -> R.ReadPrec (l a)
readNubList toList = R.parens . R.prec 10 $ fmap toList R.readPrec readNubList toList = R.parens . R.prec 10 $ fmap toList R.readPrec
-- | Binary instance for 'NubList a' is the same as for '[a]'. For 'put', we -- | Binary instance for 'NubList a' is the same as for '[a]'. For 'put', we
......
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
module PackageTests.DeterministicAr.Check where module PackageTests.DeterministicAr.Check where
...@@ -7,7 +8,9 @@ import qualified Data.ByteString as BS ...@@ -7,7 +8,9 @@ import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BS8 import qualified Data.ByteString.Char8 as BS8
import Data.Char (isSpace) import Data.Char (isSpace)
import Data.List import Data.List
#if __GLASGOW_HASKELL__ < 710
import Data.Traversable import Data.Traversable
#endif
import PackageTests.PackageTester import PackageTests.PackageTester
import System.Exit import System.Exit
import System.FilePath import System.FilePath
......
{-# LANGUAGE CPP #-}
module UnitTests.Distribution.Utils.NubList module UnitTests.Distribution.Utils.NubList
( tests ( tests
) where ) where
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid import Data.Monoid
#endif
import Distribution.Utils.NubList import Distribution.Utils.NubList
import Test.Framework import Test.Framework
import Test.Framework.Providers.HUnit (testCase) import Test.Framework.Providers.HUnit (testCase)
......
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Client.Config -- Module : Distribution.Client.Config
...@@ -91,8 +92,10 @@ import Data.List ...@@ -91,8 +92,10 @@ import Data.List
( partition, find, foldl' ) ( partition, find, foldl' )
import Data.Maybe import Data.Maybe
( fromMaybe ) ( fromMaybe )
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid import Data.Monoid
( Monoid(..) )