[commit: Cabal] master: Fix building with ghc-6.8 (c671acf)
Ian Lynagh
igloo at earth.li
Fri Jun 24 02:04:27 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/c671acf44715d757f523f05d3473c9cb721fb4fb
>---------------------------------------------------------------
commit c671acf44715d757f523f05d3473c9cb721fb4fb
Author: Duncan Coutts <duncan at haskell.org>
Date: Wed Oct 28 16:33:52 2009 +0000
Fix building with ghc-6.8
>---------------------------------------------------------------
.../Distribution/Client/Init/Heuristics.hs | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/cabal-install/Distribution/Client/Init/Heuristics.hs b/cabal-install/Distribution/Client/Init/Heuristics.hs
index ba19cf0..0e0fb80 100644
--- a/cabal-install/Distribution/Client/Init/Heuristics.hs
+++ b/cabal-install/Distribution/Client/Init/Heuristics.hs
@@ -1,3 +1,7 @@
+{-# LANGUAGE CPP #-}
+{-# OPTIONS_GHC -cpp #-}
+{-# OPTIONS_NHC98 -cpp #-}
+{-# OPTIONS_JHC -fcpp #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Init.Heuristics
@@ -28,7 +32,9 @@ import qualified Distribution.PackageDescription as PD
import Distribution.Client.Types ( packageDescription, AvailablePackageDb(..) )
import Control.Monad (liftM )
import Data.Char ( isUpper, isLower, isSpace )
+#if MIN_VERSION_base(3,0,3)
import Data.Either ( partitionEithers )
+#endif
import Data.List ( intercalate )
import Data.Maybe ( catMaybes )
import Data.Monoid ( mempty, mappend )
@@ -171,4 +177,13 @@ test db testProjectRoot = do
putStrLn "List of known categories"
print $ knownCategories db
--}
\ No newline at end of file
+-}
+
+#if MIN_VERSION_base(3,0,3)
+#else
+partitionEithers :: [Either a b] -> ([a],[b])
+partitionEithers = foldr (either left right) ([],[])
+ where
+ left a (l, r) = (a:l, r)
+ right a (l, r) = (l, a:r)
+#endif
More information about the Cvs-libraries
mailing list