From 233bf06f433d21b04b1ae42c33f26951d0e87fb8 Mon Sep 17 00:00:00 2001 From: Ganesh Sittampalam Date: Mon, 3 Jun 2024 21:56:44 +0100 Subject: [PATCH] screened 2024-06-03 20:56:44+00:00 --- .github/workflows/build-and-test.yml | 2 -- README.md | 2 +- darcs.cabal | 4 ++-- harness/Darcs/Test/Patch/Examples/Unwind.hs | 6 ------ shelly/src/Shelly.hs | 4 ---- shelly/src/Shelly/Base.hs | 8 -------- shelly/src/Shelly/Find.hs | 4 ---- src/Darcs/Prelude.hs | 7 ------- src/Darcs/Util/Regex.hs | 13 ------------- 9 files changed, 3 insertions(+), 47 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 71146a39..f708603c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -18,8 +18,6 @@ jobs: # - windows-2019 - windows-2022 ghc: - - 8.4.4 - - 8.6.5 - 8.8.2 - 8.10.7 - 9.0.2 diff --git a/README.md b/README.md index 61bf6ff6..38f36f25 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ cabal update && cabal install darcs ``` with a recent cabal (version 3.2 or later is recommended). Any version of -ghc from 8.2 up to 9.8 should work. +ghc from 8.8 up to 9.8 should work. From inside a clone or a source dist, use diff --git a/darcs.cabal b/darcs.cabal index ee9558f8..b77dd4c6 100644 --- a/darcs.cabal +++ b/darcs.cabal @@ -123,7 +123,7 @@ flag warn-as-error -- ---------------------------------------------------------------------- custom-setup - setup-depends: base >= 4.10 && < 4.20, + setup-depends: base >= 4.13 && < 4.20, Cabal >= 2.4 && < 3.11, process >= 1.2.3.0 && < 1.7, filepath >= 1.4.1 && < 1.5.0.0, @@ -412,7 +412,7 @@ Library else build-depends: unix >= 2.7.1.0 && < 2.9 - build-depends: base >= 4.10 && < 4.20, + build-depends: base >= 4.13 && < 4.20, safe >= 0.3.20 && < 0.4, stm >= 2.1 && < 2.6, binary >= 0.5 && < 0.11, diff --git a/harness/Darcs/Test/Patch/Examples/Unwind.hs b/harness/Darcs/Test/Patch/Examples/Unwind.hs index cd5bfa73..ae74b8c5 100644 --- a/harness/Darcs/Test/Patch/Examples/Unwind.hs +++ b/harness/Darcs/Test/Patch/Examples/Unwind.hs @@ -8,7 +8,6 @@ {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE CPP #-} module Darcs.Test.Patch.Examples.Unwind where import Darcs.Prelude @@ -38,9 +37,6 @@ import Darcs.Test.Patch.V1Model import Darcs.Test.Patch.WithState import Darcs.Test.TestOnly.Instance () -#if MIN_VERSION_base(4,12,0) && !MIN_VERSION_base(4,13,0) -import Control.Monad.Fail -#endif import Data.ByteString.Char8 ( pack ) import qualified Data.ByteString.Lazy.Char8 as BLC import Data.Constraint @@ -240,9 +236,7 @@ instance Applicative ErrorFail where liftA2 f (ErrorFail v1) (ErrorFail v2) = ErrorFail (f v1 v2) instance Monad ErrorFail where ErrorFail v >>= f = f v -#if MIN_VERSION_base(4,12,0) instance MonadFail ErrorFail where -#endif fail = error -- For now this code isn't used, it just demonstrates how example4 is broken in V1 diff --git a/shelly/src/Shelly.hs b/shelly/src/Shelly.hs index bfed3ccd..b6e38aec 100644 --- a/shelly/src/Shelly.hs +++ b/shelly/src/Shelly.hs @@ -124,10 +124,6 @@ import qualified Data.Text as T import qualified Data.ByteString as BS import Data.ByteString (ByteString) -#if !MIN_VERSION_base(4,13,0) -import Data.Monoid (mempty, mappend, (<>)) -#endif - import Filesystem.Path.CurrentOS hiding (concat, fromText, (), (<.>)) import Filesystem hiding (canonicalizePath) import qualified Filesystem.Path.CurrentOS as FP diff --git a/shelly/src/Shelly/Base.hs b/shelly/src/Shelly/Base.hs index 4e45aaca..fc0f488f 100644 --- a/shelly/src/Shelly/Base.hs +++ b/shelly/src/Shelly/Base.hs @@ -40,18 +40,12 @@ import System.IO ( Handle, hFlush, stderr, stdout ) import Control.Monad (when, (>=>)) import Control.Monad.Base import Control.Monad.Trans.Control -#if !MIN_VERSION_base(4,13,0) -import Control.Applicative (Applicative, (<$>)) -#endif import Filesystem (isDirectory, listDirectory) import System.PosixCompat.Files( getSymbolicLinkStatus, isSymbolicLink ) import Filesystem.Path.CurrentOS (FilePath, encodeString, relative) import qualified Filesystem.Path.CurrentOS as FP import qualified Filesystem as FS import Data.IORef (readIORef, modifyIORef, IORef) -#if !MIN_VERSION_base(4,13,0) -import Data.Monoid (mappend) -#endif import qualified Data.Text as T import qualified Data.Text.IO as TIO import Control.Exception (SomeException, catch, throwIO, Exception) @@ -71,10 +65,8 @@ newtype Sh a = Sh { unSh :: ReaderT (IORef State) IO a } deriving (Applicative, Monad, MonadIO, MonadReader (IORef State), Functor, Catch.MonadMask) -#if MIN_VERSION_base(4,13,0) instance MonadFail Sh where fail = liftIO . fail -#endif instance MonadBase IO Sh where liftBase = Sh . ReaderT . const diff --git a/shelly/src/Shelly/Find.hs b/shelly/src/Shelly/Find.hs index 08b89d99..846a25c8 100644 --- a/shelly/src/Shelly/Find.hs +++ b/shelly/src/Shelly/Find.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} -- | File finding utiliites for Shelly -- The basic 'find' takes a dir and gives back a list of files. @@ -12,9 +11,6 @@ module Shelly.Find import Prelude hiding (FilePath) import Shelly.Base import Control.Monad (foldM) -#if !MIN_VERSION_base(4,13,0) -import Data.Monoid (mappend) -#endif import System.PosixCompat.Files( getSymbolicLinkStatus, isSymbolicLink ) import Filesystem (isDirectory) import Filesystem.Path.CurrentOS (encodeString) diff --git a/src/Darcs/Prelude.hs b/src/Darcs/Prelude.hs index d9b8f5e2..6ff6c128 100644 --- a/src/Darcs/Prelude.hs +++ b/src/Darcs/Prelude.hs @@ -28,7 +28,6 @@ module Darcs.Prelude , module Control.Applicative , module Data.List , module Data.Monoid - , Semigroup(..) , module Data.Traversable ) where @@ -43,11 +42,6 @@ import Prelude hiding , -- because it's in the new Prelude but only in Data.Monoid in older GHCs Monoid(..) -#if MIN_VERSION_base(4,11,0) - , - -- because it's in the new Prelude but only in Data.Semigroup in older GHCs - Semigroup(..) -#endif , -- because it's in the new Prelude but only in Data.Traversable in older GHCs traverse @@ -69,5 +63,4 @@ import Prelude hiding import Control.Applicative ( Applicative(..), (<$>), (<*>) ) import Data.List ( foldl' ) import Data.Monoid ( Monoid(..) ) -import Data.Semigroup ( Semigroup(..) ) import Data.Traversable ( traverse ) diff --git a/src/Darcs/Util/Regex.hs b/src/Darcs/Util/Regex.hs index 8929ef10..5a9be4f9 100644 --- a/src/Darcs/Util/Regex.hs +++ b/src/Darcs/Util/Regex.hs @@ -1,5 +1,4 @@ -- | This module is a subset of the defunct regex-compat-tdfa. -{-# LANGUAGE CPP #-} module Darcs.Util.Regex ( Regex , mkRegex @@ -10,9 +9,6 @@ module Darcs.Util.Regex import Darcs.Prelude import Control.Exception ( throw ) -#if !MIN_VERSION_base(4,13,0) -import Control.Monad.Fail -#endif import Text.Regex.Base ( RegexContext(matchM) , RegexMaker(makeRegexOptsM) @@ -27,16 +23,7 @@ newtype RegexFail a = RegexFail { runRegexFail :: Either String a } -- The subtlety here is that only in base-4.13.0 the fail method -- in class Monad was removed. For earlier versions, regex-tdfa -- calls the fail from class Monad, not the one from class MonadFail. -#if MIN_VERSION_base(4,13,0) deriving (Functor, Applicative, Monad) -#else - deriving (Functor, Applicative) - -instance Monad RegexFail where - RegexFail (Left e) >>= _ = RegexFail (Left e) - RegexFail (Right r) >>= k = k r - fail = RegexFail . Left -#endif instance MonadFail RegexFail where fail = RegexFail . Left