diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2014-09-21 23:22:19 +0200 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2014-09-21 23:28:31 +0200 |
commit | b8f583928fa6cb5371a872fc73080d2002dd87d9 (patch) | |
tree | 9982e3cc06cec45a30e956cffbe4a6151a897cc8 /compiler | |
parent | 1f7f46f94a95ab7fc6f3101da7c02529e1964f24 (diff) | |
download | haskell-b8f583928fa6cb5371a872fc73080d2002dd87d9.tar.gz |
Export `Monoid(..)`/`Foldable(..)`/`Traversable(..)` from Prelude
This finally exposes also the methods of these 3 classes in the Prelude
in order to allow to define basic class instances w/o needing imports.
This almost completes the primary goal of #9586
NOTE: `fold`, `foldl'`, `foldr'`, and `toList` are not exposed yet,
as they require upstream fixes for at least `containers` and
`bytestring`, and are not required for defining basic instances.
Reviewed By: ekmett, austin
Differential Revision: https://phabricator.haskell.org/D236
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/deSugar/MatchLit.lhs | 2 | ||||
-rw-r--r-- | compiler/ghci/RtClosureInspect.hs | 2 | ||||
-rw-r--r-- | compiler/hsSyn/HsBinds.lhs | 2 | ||||
-rw-r--r-- | compiler/iface/TcIface.lhs | 2 | ||||
-rw-r--r-- | compiler/main/Packages.lhs | 2 | ||||
-rw-r--r-- | compiler/rename/RnBinds.lhs | 3 | ||||
-rw-r--r-- | compiler/rename/RnSource.lhs | 2 | ||||
-rw-r--r-- | compiler/typecheck/TcEvidence.lhs | 2 | ||||
-rw-r--r-- | compiler/typecheck/TcHsSyn.lhs | 2 | ||||
-rw-r--r-- | compiler/typecheck/TcPatSyn.lhs | 2 | ||||
-rw-r--r-- | compiler/types/Coercion.lhs | 2 | ||||
-rw-r--r-- | compiler/utils/Pair.lhs | 6 | ||||
-rw-r--r-- | compiler/utils/UniqFM.lhs | 7 |
13 files changed, 32 insertions, 4 deletions
diff --git a/compiler/deSugar/MatchLit.lhs b/compiler/deSugar/MatchLit.lhs index f404997c9f..5a247177a3 100644 --- a/compiler/deSugar/MatchLit.lhs +++ b/compiler/deSugar/MatchLit.lhs @@ -46,7 +46,9 @@ import FastString import Control.Monad import Data.Int +#if __GLASGOW_HASKELL__ < 709 import Data.Traversable (traverse) +#endif import Data.Word \end{code} diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs index dde813d31d..0b69492b0a 100644 --- a/compiler/ghci/RtClosureInspect.hs +++ b/compiler/ghci/RtClosureInspect.hs @@ -65,7 +65,9 @@ import Data.Array.Base import Data.Ix import Data.List import qualified Data.Sequence as Seq +#if __GLASGOW_HASKELL__ < 709 import Data.Monoid (mappend) +#endif import Data.Sequence (viewl, ViewL(..)) import Foreign.Safe import System.IO.Unsafe diff --git a/compiler/hsSyn/HsBinds.lhs b/compiler/hsSyn/HsBinds.lhs index 5ebada6e9c..e6d0c0ecd5 100644 --- a/compiler/hsSyn/HsBinds.lhs +++ b/compiler/hsSyn/HsBinds.lhs @@ -41,10 +41,10 @@ import BooleanFormula (BooleanFormula) import Data.Data hiding ( Fixity ) import Data.List import Data.Ord +#if __GLASGOW_HASKELL__ < 709 import Data.Foldable ( Foldable(..) ) import Data.Traversable ( Traversable(..) ) import Data.Monoid ( mappend ) -#if __GLASGOW_HASKELL__ < 709 import Control.Applicative hiding (empty) #else import Control.Applicative ((<$>)) diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs index 37b65b01af..293e8c9c4c 100644 --- a/compiler/iface/TcIface.lhs +++ b/compiler/iface/TcIface.lhs @@ -72,7 +72,9 @@ import FastString import Control.Monad import qualified Data.Map as Map +#if __GLASGOW_HASKELL__ < 709 import Data.Traversable ( traverse ) +#endif \end{code} This module takes diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs index a6a61e9534..93370d47b3 100644 --- a/compiler/main/Packages.lhs +++ b/compiler/main/Packages.lhs @@ -73,7 +73,9 @@ import qualified System.FilePath.Posix as FilePath.Posix import Control.Monad import Data.List as List import Data.Map (Map) +#if __GLASGOW_HASKELL__ < 709 import Data.Monoid hiding ((<>)) +#endif import qualified Data.Map as Map import qualified FiniteMap as Map import qualified Data.Set as Set diff --git a/compiler/rename/RnBinds.lhs b/compiler/rename/RnBinds.lhs index dfbde13ded..f76090f3d9 100644 --- a/compiler/rename/RnBinds.lhs +++ b/compiler/rename/RnBinds.lhs @@ -9,6 +9,7 @@ type-synonym declarations; those cannot be done at this stage because they may be affected by renaming (which isn't fully worked out yet). \begin{code} +{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-tabs #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and @@ -55,7 +56,9 @@ import FastString import Data.List ( partition, sort ) import Maybes ( orElse ) import Control.Monad +#if __GLASGOW_HASKELL__ < 709 import Data.Traversable ( traverse ) +#endif \end{code} -- ToDo: Put the annotations into the monad, so that they arrive in the proper diff --git a/compiler/rename/RnSource.lhs b/compiler/rename/RnSource.lhs index 4af8be32fd..6aa666642f 100644 --- a/compiler/rename/RnSource.lhs +++ b/compiler/rename/RnSource.lhs @@ -48,7 +48,9 @@ import Util ( mapSnd ) import Control.Monad import Data.List( partition, sortBy ) +#if __GLASGOW_HASKELL__ < 709 import Data.Traversable (traverse) +#endif import Maybes( orElse, mapMaybe ) \end{code} diff --git a/compiler/typecheck/TcEvidence.lhs b/compiler/typecheck/TcEvidence.lhs index 8b64d2408b..468f9c3956 100644 --- a/compiler/typecheck/TcEvidence.lhs +++ b/compiler/typecheck/TcEvidence.lhs @@ -50,7 +50,9 @@ import Util import Bag import Pair import Control.Applicative +#if __GLASGOW_HASKELL__ < 709 import Data.Traversable (traverse, sequenceA) +#endif import qualified Data.Data as Data import Outputable import FastString diff --git a/compiler/typecheck/TcHsSyn.lhs b/compiler/typecheck/TcHsSyn.lhs index f4d5cf262c..b19bfbbdc1 100644 --- a/compiler/typecheck/TcHsSyn.lhs +++ b/compiler/typecheck/TcHsSyn.lhs @@ -58,7 +58,9 @@ import Bag import FastString import Outputable import Util +#if __GLASGOW_HASKELL__ < 709 import Data.Traversable ( traverse ) +#endif \end{code} %************************************************************************ diff --git a/compiler/typecheck/TcPatSyn.lhs b/compiler/typecheck/TcPatSyn.lhs index 6ae3ba0153..9b2b5110f4 100644 --- a/compiler/typecheck/TcPatSyn.lhs +++ b/compiler/typecheck/TcPatSyn.lhs @@ -30,7 +30,9 @@ import BasicTypes import TcSimplify import TcType import VarSet +#if __GLASGOW_HASKELL__ < 709 import Data.Monoid +#endif import Bag import TcEvidence import BuildTyCl diff --git a/compiler/types/Coercion.lhs b/compiler/types/Coercion.lhs index fc6c8a7669..36eb711bdc 100644 --- a/compiler/types/Coercion.lhs +++ b/compiler/types/Coercion.lhs @@ -102,7 +102,9 @@ import Pair import SrcLoc import PrelNames ( funTyConKey, eqPrimTyConKey, eqReprPrimTyConKey ) import Control.Applicative +#if __GLASGOW_HASKELL__ < 709 import Data.Traversable (traverse, sequenceA) +#endif import FastString import ListSetOps diff --git a/compiler/utils/Pair.lhs b/compiler/utils/Pair.lhs index ca7c2a7f8e..529ba669ea 100644 --- a/compiler/utils/Pair.lhs +++ b/compiler/utils/Pair.lhs @@ -10,10 +10,12 @@ module Pair ( Pair(..), unPair, toPair, swap ) where #include "HsVersions.h" import Outputable -import Data.Monoid import Control.Applicative +#if __GLASGOW_HASKELL__ < 709 import Data.Foldable +import Data.Monoid import Data.Traversable +#endif data Pair a = Pair { pFst :: a, pSnd :: a } -- Note that Pair is a *unary* type constructor @@ -46,4 +48,4 @@ toPair (x,y) = Pair x y swap :: Pair a -> Pair a swap (Pair x y) = Pair y x -\end{code}
\ No newline at end of file +\end{code} diff --git a/compiler/utils/UniqFM.lhs b/compiler/utils/UniqFM.lhs index d8e08f599a..c941ce8884 100644 --- a/compiler/utils/UniqFM.lhs +++ b/compiler/utils/UniqFM.lhs @@ -20,7 +20,10 @@ and ``addToUFM\_C'' and ``Data.IntMap.insertWith'' differ in the order of arguments of combining function. \begin{code} -{-# LANGUAGE DeriveTraversable, DeriveDataTypeable, GeneralizedNewtypeDeriving #-} +{-# LANGUAGE CPP #-} +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveTraversable #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# OPTIONS_GHC -Wall #-} module UniqFM ( @@ -76,7 +79,9 @@ import qualified Data.Foldable as Foldable import qualified Data.Traversable as Traversable import Data.Typeable import Data.Data +#if __GLASGOW_HASKELL__ < 709 import Data.Monoid +#endif \end{code} %************************************************************************ |