Skip to content

Commit

Permalink
screened 2024-06-03 08:38:56+00:00
Browse files Browse the repository at this point in the history
  • Loading branch information
hsenag committed Jun 3, 2024
1 parent e81a306 commit 6f54090
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 31 deletions.
10 changes: 3 additions & 7 deletions shelly/src/Shelly.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE ScopedTypeVariables, DeriveDataTypeable, OverloadedStrings,
FlexibleInstances, IncoherentInstances,
FlexibleInstances, IncoherentInstances, CPP,
TypeFamilies, ExistentialQuantification #-}

-- | A module for shell-like programming in Haskell.
Expand Down Expand Up @@ -98,11 +98,7 @@ import Shelly.Find
import Control.Monad ( when, unless, void, forM, filterM, liftM2 )
import Control.Monad.Trans ( MonadIO )
import Control.Monad.Reader (ask)
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 706
import Prelude hiding ( readFile, FilePath, catch)
#else
import Prelude hiding ( readFile, FilePath)
#endif
import Data.Char ( isAlphaNum, isSpace )
import Data.Typeable
import Data.IORef
Expand Down Expand Up @@ -312,7 +308,7 @@ runCommand handles st exe args = findExe exe >>= \fullExe ->
where
findExe :: FilePath -> Sh FilePath
findExe
#if defined(mingw32_HOST_OS) || (defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 708)
#if defined(mingw32_HOST_OS)
fp
#else
_fp
Expand All @@ -327,7 +323,7 @@ runCommand handles st exe args = findExe exe >>= \fullExe ->
-- non-Windows < 7.8 has a bug for read-only file systems
-- https://github.com/yesodweb/Shelly.hs/issues/56
-- it would be better to specifically detect that bug
#if defined(mingw32_HOST_OS) || (defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 708)
#if defined(mingw32_HOST_OS)
Left _ -> return fp
#else
Left err -> liftIO $ throwIO $ userError err
Expand Down
4 changes: 0 additions & 4 deletions shelly/src/Shelly/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ module Shelly.Base
, addTrailingSlash
) where

#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 706
import Prelude hiding (FilePath, catch)
#else
import Prelude hiding (FilePath)
#endif

import Data.Text (Text)
import System.Process( StdStream(..) )
Expand Down
5 changes: 0 additions & 5 deletions shelly/test/src/CopySpec.hs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
{-# Language CPP #-}
module CopySpec ( copySpec ) where

import TestInit

#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 706
import Prelude hiding ( FilePath, catch)
#else
import Prelude hiding ( FilePath)
#endif
import Control.Monad (forM_)
import System.IO.Error
import Help
Expand Down
5 changes: 0 additions & 5 deletions shelly/test/src/EnvSpec.hs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{-# LANGUAGE CPP #-}
module EnvSpec ( envSpec ) where

import TestInit
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 706
import Prelude hiding ( FilePath, catch)
#else
import Prelude hiding ( FilePath)
#endif
import Data.Maybe

envSpec :: Spec
Expand Down
4 changes: 0 additions & 4 deletions shelly/test/src/Help.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ module Help (
) where

import Shelly
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 706
import Prelude hiding ( catch, FilePath )
#else
import Prelude hiding ( FilePath )
#endif
import Test.HUnit
import Control.Monad.Trans ( MonadIO )

Expand Down
6 changes: 0 additions & 6 deletions shelly/test/src/ReadFileSpec.hs
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{-# LANGUAGE CPP #-}

module ReadFileSpec (readFileSpec) where

import TestInit
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 706
import Prelude hiding ( FilePath, catch)
#else
import Prelude hiding ( FilePath)
#endif
import qualified Data.ByteString as BS
import qualified Data.Text as T

Expand Down

0 comments on commit 6f54090

Please sign in to comment.