Skip to content
Browse files

Let it build with ghc >=7.6

  • Loading branch information...
1 parent 7a96b87 commit 9d8a5a8e2137a4eb1bb8226110683f2a2badd2d2 @ibotty ibotty committed with
Showing with 17 additions and 3 deletions.
  1. +8 −3 hell.cabal
  2. +9 −0 src/Hell/Prelude.hs
View
11 hell.cabal
@@ -1,5 +1,5 @@
name: hell
-version: 0.0.0
+version: 0.0.1
synopsis: hell
description: hell
license: BSD3
@@ -22,8 +22,13 @@ library
ghc-paths,
directory,
data-default,
- old-time,
unix
+ if impl(ghc >= 7.6)
+ build-depends: time
+ else
+ cpp-options: -DUSE_OLD_TIME
+ build-depends: old-time
+
ghc-options: -Wall -threaded
executable hell
@@ -31,4 +36,4 @@ executable hell
hs-source-dirs: src/main
build-depends: base > 4 && <5,
hell
- ghc-options: -Wall -threaded
+ ghc-options: -Wall -threaded
View
9 src/Hell/Prelude.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
-- | A base set of functions for the shell.
module Hell.Prelude where
@@ -8,7 +9,11 @@ import Data.List
import System.Directory
import System.Exit
import System.IO
+#ifdef USE_OLD_TIME
import System.Time
+#else
+import Data.Time.Clock
+#endif
import System.Process
-- | setCurrentDirectory
@@ -52,7 +57,11 @@ perms :: FilePath -> IO Permissions
perms = getPermissions
-- | getModificationTime
+#ifdef USE_OLD_TIME
modified :: FilePath -> IO ClockTime
+#else
+modified :: FilePath -> IO UTCTime
+#endif
modified = getModificationTime
-- | removeDirectory

0 comments on commit 9d8a5a8

Please sign in to comment.
Something went wrong with that request. Please try again.