From 454a5177401e35ddabfd6d35c0f6d2ad0c5835c2 Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Thu, 16 Jan 2025 03:47:40 +0000 Subject: [PATCH] Remove outdated CPP --- bench/Main.hs | 5 ----- src/Control/Monad/ReaderIO.hs | 4 ---- src/Data/AppendMap.hs | 4 ---- src/Reflex/Dynamic/TH.hs | 9 --------- src/Reflex/FunctorMaybe.hs | 2 -- src/Reflex/Optimizer.hs | 2 -- src/Reflex/Requester/Base/Internal.hs | 3 --- src/Reflex/Spider/Internal.hs | 4 ---- 8 files changed, 33 deletions(-) diff --git a/bench/Main.hs b/bench/Main.hs index 2e12e9c1..8e0fcc47 100644 --- a/bench/Main.hs +++ b/bench/Main.hs @@ -29,11 +29,6 @@ main :: IO () main = defaultMain [ bgroup "micro" micros ] -#if !(MIN_VERSION_deepseq(1,4,2)) -instance NFData (IORef a) where - rnf x = seq x () -#endif - instance NFData (TVar a) where rnf x = seq x () diff --git a/src/Control/Monad/ReaderIO.hs b/src/Control/Monad/ReaderIO.hs index 98411e96..350848cc 100644 --- a/src/Control/Monad/ReaderIO.hs +++ b/src/Control/Monad/ReaderIO.hs @@ -9,9 +9,7 @@ module Control.Monad.ReaderIO where import Control.Monad.Fix -#if MIN_VERSION_base(4,10,0) import Control.Applicative -#endif import Control.Monad import Control.Monad.Reader.Class import Control.Monad.IO.Class @@ -34,10 +32,8 @@ instance Applicative (ReaderIO e) where {-# INLINE pure #-} (<*>) = ap {-# INLINE (<*>) #-} -#if MIN_VERSION_base(4,10,0) liftA2 = liftM2 {-# INLINE liftA2 #-} -#endif instance Monad (ReaderIO e) where ReaderIO q >>= f = ReaderIO $ \e -> q e >>= \a -> runReaderIO (f a) e diff --git a/src/Data/AppendMap.hs b/src/Data/AppendMap.hs index 5f709d60..49a40ae1 100644 --- a/src/Data/AppendMap.hs +++ b/src/Data/AppendMap.hs @@ -25,11 +25,7 @@ import Prelude hiding (null) import Data.Coerce import Data.Default import Data.Map (Map) -#if MIN_VERSION_containers(0,5,11) import qualified Data.Map.Internal.Debug as Map (showTree, showTreeWith) -#else -import qualified Data.Map as Map (showTree, showTreeWith) -#endif import Data.Map.Monoidal diff --git a/src/Reflex/Dynamic/TH.hs b/src/Reflex/Dynamic/TH.hs index 61dd4189..ea155a9d 100644 --- a/src/Reflex/Dynamic/TH.hs +++ b/src/Reflex/Dynamic/TH.hs @@ -90,7 +90,6 @@ mkDynExp s = case Hs.parseExpWithMode Hs.defaultParseMode { Hs.extensions = [ Hs Hs.ParseFailed (Hs.SrcLoc _ l c) err -> fail $ "mkDyn:" <> show l <> ":" <> show c <> ": " <> err Hs.ParseOk e -> qDynPure $ return $ everywhere (id `extT` reinstateUnqDyn) $ Hs.toExp $ everywhere (id `extT` antiE) e where TH.Name (TH.OccName occName) (TH.NameG _ _ (TH.ModName modName)) = 'unqMarker -#if MIN_VERSION_haskell_src_exts(1,18,0) antiE :: Hs.Exp Hs.SrcSpanInfo -> Hs.Exp Hs.SrcSpanInfo antiE x = case x of Hs.SpliceExp l se -> @@ -98,14 +97,6 @@ mkDynExp s = case Hs.parseExpWithMode Hs.defaultParseMode { Hs.extensions = [ Hs Hs.IdSplice l2 v -> Hs.Var l2 $ Hs.UnQual l2 $ Hs.Ident l2 v Hs.ParenSplice _ ps -> ps _ -> x -#else - antiE x = case x of - Hs.SpliceExp se -> - Hs.App (Hs.Var $ Hs.Qual (Hs.ModuleName modName) (Hs.Ident occName)) $ case se of - Hs.IdSplice v -> Hs.Var $ Hs.UnQual $ Hs.Ident v - Hs.ParenSplice ps -> ps - _ -> x -#endif reinstateUnqDyn (TH.Name (TH.OccName occName') (TH.NameQ (TH.ModName modName'))) | modName == modName' && occName == occName' = 'unqMarker reinstateUnqDyn x = x diff --git a/src/Reflex/FunctorMaybe.hs b/src/Reflex/FunctorMaybe.hs index 8368562a..d5bb8445 100644 --- a/src/Reflex/FunctorMaybe.hs +++ b/src/Reflex/FunctorMaybe.hs @@ -1,8 +1,6 @@ {-# LANGUAGE CPP #-} -#if MIN_VERSION_base(4,9,0) {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE StandaloneDeriving #-} -#endif -- | -- Module: diff --git a/src/Reflex/Optimizer.hs b/src/Reflex/Optimizer.hs index 63ca5cb7..a24c647b 100644 --- a/src/Reflex/Optimizer.hs +++ b/src/Reflex/Optimizer.hs @@ -21,9 +21,7 @@ import CoreMonad import Data.String import GhcPlugins -#if MIN_VERSION_base(4,9,0) import Prelude hiding ((<>)) -#endif #endif diff --git a/src/Reflex/Requester/Base/Internal.hs b/src/Reflex/Requester/Base/Internal.hs index 15aba66b..2a0b2210 100644 --- a/src/Reflex/Requester/Base/Internal.hs +++ b/src/Reflex/Requester/Base/Internal.hs @@ -272,10 +272,7 @@ data RequesterState t (request :: Type -> Type) = RequesterState -- | A basic implementation of 'Requester'. newtype RequesterT t request (response :: Type -> Type) m a = RequesterT { unRequesterT :: StateT (RequesterState t request) (ReaderT (EventSelectorInt t Any) m) a } deriving (Functor, Applicative, Monad, MonadFix, MonadIO, MonadException --- MonadAsyncException can't be derived on ghc-8.0.1; we use base-4.9.1 as a proxy for ghc-8.0.2 -#if MIN_VERSION_base(4,9,1) , MonadAsyncException -#endif , MonadCatch , MonadThrow , MonadMask diff --git a/src/Reflex/Spider/Internal.hs b/src/Reflex/Spider/Internal.hs index 9156ad9a..16f01e8d 100644 --- a/src/Reflex/Spider/Internal.hs +++ b/src/Reflex/Spider/Internal.hs @@ -29,9 +29,7 @@ -- a graph traversal algorithm to propagate 'Event's and 'Behavior's. module Reflex.Spider.Internal (module Reflex.Spider.Internal) where -#if MIN_VERSION_base(4,10,0) import Control.Applicative (liftA2) -#endif import Control.Concurrent import Control.Exception import Control.Monad hiding (forM, forM_, mapM, mapM_) @@ -2577,9 +2575,7 @@ mapDynamicSpider f = SpiderDynamic . newMapDyn f . unSpiderDynamic instance HasSpiderTimeline x => Applicative (Reflex.Class.Dynamic (SpiderTimeline x)) where pure = SpiderDynamic . dynamicConst -#if MIN_VERSION_base(4,10,0) liftA2 f a b = SpiderDynamic $ Reflex.Spider.Internal.zipDynWith f (unSpiderDynamic a) (unSpiderDynamic b) -#endif SpiderDynamic a <*> SpiderDynamic b = SpiderDynamic $ Reflex.Spider.Internal.zipDynWith ($) a b a *> b = R.unsafeBuildDynamic (R.sample $ R.current b) $ R.leftmost [R.updated b, R.tag (R.current b) $ R.updated a] (<*) = flip (*>) -- There are no effects, so order doesn't matter