Commit fc78975f authored by Duncan Coutts's avatar Duncan Coutts

Build with ghc-6.6

parent 8a3877ae
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Client.Init -- Module : Distribution.Client.Init
...@@ -34,7 +35,11 @@ import Data.Maybe ...@@ -34,7 +35,11 @@ import Data.Maybe
import Data.Traversable import Data.Traversable
( traverse ) ( traverse )
import Control.Monad import Control.Monad
( (>=>), when ) ( when )
#if MIN_VERSION_base(3,0,0)
import Control.Monad
( (>=>) )
#endif
import Text.PrettyPrint.HughesPJ hiding (mode, cat) import Text.PrettyPrint.HughesPJ hiding (mode, cat)
...@@ -558,3 +563,9 @@ generateWarnings flags = do ...@@ -558,3 +563,9 @@ generateWarnings flags = do
message :: InitFlags -> String -> IO () message :: InitFlags -> String -> IO ()
message (InitFlags{quiet = Flag True}) _ = return () message (InitFlags{quiet = Flag True}) _ = return ()
message _ s = putStrLn s message _ s = putStrLn s
#if MIN_VERSION_base(3,0,0)
#else
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> (a -> m c)
f >=> g = \x -> f x >>= g
#endif
{-# LANGUAGE CPP #-} {-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -cpp #-}
{-# OPTIONS_NHC98 -cpp #-}
{-# OPTIONS_JHC -fcpp #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Client.Init.Heuristics -- Module : Distribution.Client.Init.Heuristics
...@@ -28,6 +25,8 @@ import Distribution.Client.PackageIndex ...@@ -28,6 +25,8 @@ import Distribution.Client.PackageIndex
( allPackagesByName ) ( allPackagesByName )
import qualified Distribution.PackageDescription as PD import qualified Distribution.PackageDescription as PD
( category, packageDescription ) ( category, packageDescription )
import Distribution.Simple.Utils
( intercalate )
import Distribution.Client.Types ( packageDescription, AvailablePackageDb(..) ) import Distribution.Client.Types ( packageDescription, AvailablePackageDb(..) )
import Control.Monad (liftM ) import Control.Monad (liftM )
...@@ -35,7 +34,6 @@ import Data.Char ( isUpper, isLower, isSpace ) ...@@ -35,7 +34,6 @@ import Data.Char ( isUpper, isLower, isSpace )
#if MIN_VERSION_base(3,0,3) #if MIN_VERSION_base(3,0,3)
import Data.Either ( partitionEithers ) import Data.Either ( partitionEithers )
#endif #endif
import Data.List ( intercalate )
import Data.Maybe ( catMaybes ) import Data.Maybe ( catMaybes )
import Data.Monoid ( mempty, mappend ) import Data.Monoid ( mempty, mappend )
import qualified Data.Set as Set ( fromList, toList ) import qualified Data.Set as Set ( fromList, toList )
......
{-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Client.Init.Types -- Module : Distribution.Client.Init.Types
...@@ -154,3 +155,13 @@ data Stability ...@@ -154,3 +155,13 @@ data Stability
instance Text Stability where instance Text Stability where
disp = Disp.text . show disp = Disp.text . show
parse = Parse.choice $ map (fmap read . Parse.string . show) [Stable .. ] parse = Parse.choice $ map (fmap read . Parse.string . show) [Stable .. ]
#if MIN_VERSION_base(3,0,0)
#else
-- Compat instance for ghc-6.6 era
instance Monoid a => Monoid (Maybe a) where
mempty = Nothing
Nothing `mappend` m = m
m `mappend` Nothing = m
Just m1 `mappend` Just m2 = Just (m1 `mappend` m2)
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment