using Data.Map if containers is old.

hoping passing travis tests.
This commit is contained in:
Kazu Yamamoto 2014-03-26 15:23:12 +09:00
parent 7e6c10b74e
commit 8238c632a8
2 changed files with 9 additions and 4 deletions

View File

@ -62,7 +62,7 @@ Library
Language.Haskell.GhcMod.List Language.Haskell.GhcMod.List
Language.Haskell.GhcMod.Types Language.Haskell.GhcMod.Types
Build-Depends: base >= 4.0 && < 5 Build-Depends: base >= 4.0 && < 5
, containers >= 0.5 , containers
, directory , directory
, filepath , filepath
, ghc , ghc
@ -99,7 +99,7 @@ Executable ghc-modi
GHC-Options: -Wall GHC-Options: -Wall
HS-Source-Dirs: src HS-Source-Dirs: src
Build-Depends: base >= 4.0 && < 5 Build-Depends: base >= 4.0 && < 5
, containers >= 0.5 , containers
, directory , directory
, filepath , filepath
, ghc , ghc
@ -129,7 +129,7 @@ Test-Suite spec
LintSpec LintSpec
ListSpec ListSpec
Build-Depends: base >= 4.0 && < 5 Build-Depends: base >= 4.0 && < 5
, containers >= 0.5 , containers
, directory , directory
, filepath , filepath
, ghc , ghc

View File

@ -1,4 +1,4 @@
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE BangPatterns, CPP #-}
module Main where module Main where
@ -8,8 +8,13 @@ import qualified Control.Exception as E (handle, SomeException(..))
import Control.Monad (when, void) import Control.Monad (when, void)
import Data.Function import Data.Function
import Data.List (intercalate, groupBy, sort, find) import Data.List (intercalate, groupBy, sort, find)
#if MIN_VERSION_containers(0,5,0)
import Data.Map.Strict (Map) import Data.Map.Strict (Map)
import qualified Data.Map.Strict as M import qualified Data.Map.Strict as M
#else
import Data.Map (Map)
import qualified Data.Map as M
#endif
import Data.Set (Set) import Data.Set (Set)
import qualified Data.Set as S import qualified Data.Set as S
import qualified Exception as G (ghandle) import qualified Exception as G (ghandle)