diff --git a/ChangeLog.md b/ChangeLog.md index 04db6ca4..af57ce1f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -4,6 +4,9 @@ * Add support for GHC 9.8 and 9.10 +* Get rid of the `use-template-haskell` flag. + Template Haskell is now always used. + ## 0.9.3.0 * Headless Host: Generalize to allow returning arbitrary types diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 417b2b09..3197aec7 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -6,9 +6,6 @@ installed: -all -- https://github.com/haskell/cabal/issues/6106 install-dependencies: False -constraint-set no-th - constraints: reflex -use-template-haskell - constraint-set old-these ghc: <8.8 constraints: these <1 diff --git a/reflex.cabal b/reflex.cabal index 554df59a..e540ea20 100644 --- a/reflex.cabal +++ b/reflex.cabal @@ -36,11 +36,6 @@ flag use-reflex-optimizer default: False manual: True -flag use-template-haskell - description: Use template haskell to generate lenses - default: True - manual: True - flag debug-trace-events description: Add instrumentation that outputs the stack trace of the definition of an event whenever it is subscribed to. Warning: It is very slow! default: False @@ -100,7 +95,13 @@ library time >= 1.4 && < 1.13, transformers >= 0.5 && < 0.7, unbounded-delays >= 0.1.0.0 && < 0.2, - witherable >= 0.4 && < 0.5 + witherable >= 0.4 && < 0.5, + haskell-src-exts >= 1.16 && < 1.24, + haskell-src-meta >= 0.6 && < 0.9, + template-haskell >= 2.9 && < 2.23 + + other-extensions: + TemplateHaskell if flag(split-these) build-depends: these >= 1 && <1.3, @@ -124,6 +125,7 @@ library Reflex.BehaviorWriter.Class, Reflex.Collection, Reflex.Dynamic, + Reflex.Dynamic.TH, Reflex.Dynamic.Uniq, Reflex.DynamicWriter, Reflex.DynamicWriter.Base, @@ -184,16 +186,6 @@ library if flag(debug-cycles) cpp-options: -DDEBUG_CYCLES - if flag(use-template-haskell) - cpp-options: -DUSE_TEMPLATE_HASKELL - build-depends: - haskell-src-exts >= 1.16 && < 1.24, - haskell-src-meta >= 0.6 && < 0.9, - template-haskell >= 2.9 && < 2.23 - exposed-modules: - Reflex.Dynamic.TH - other-extensions: TemplateHaskell - if flag(fast-weak) && impl(ghcjs) cpp-options: -DGHCJS_FAST_WEAK diff --git a/src/Reflex.hs b/src/Reflex.hs index 1529280b..945accb7 100644 --- a/src/Reflex.hs +++ b/src/Reflex.hs @@ -13,9 +13,7 @@ import Reflex.Collection as X import Reflex.Dynamic as X import Reflex.EventWriter.Base as X import Reflex.EventWriter.Class as X -#ifdef USE_TEMPLATE_HASKELL import Reflex.Dynamic.TH as X -#endif import Reflex.Dynamic.Uniq as X import Reflex.DynamicWriter.Base as X import Reflex.DynamicWriter.Class as X diff --git a/src/Reflex/Spider/Internal.hs b/src/Reflex/Spider/Internal.hs index bd833ed2..f52c3d25 100644 --- a/src/Reflex/Spider/Internal.hs +++ b/src/Reflex/Spider/Internal.hs @@ -1161,9 +1161,7 @@ data Switch x a , switchSubscribed :: !(IORef (Maybe (SwitchSubscribed x a))) } -#ifdef USE_TEMPLATE_HASKELL {-# ANN CoincidenceSubscribed "HLint: ignore Redundant bracket" #-} -#endif data CoincidenceSubscribed x a = CoincidenceSubscribed { coincidenceSubscribedCachedSubscribed :: !(IORef (Maybe (CoincidenceSubscribed x a))) , coincidenceSubscribedOccurrence :: !(IORef (Maybe a)) @@ -1612,9 +1610,7 @@ getRootSubscribed k r sub = do occ <- getOcc return (sln, subscribed, occ) -#ifdef USE_TEMPLATE_HASKELL {-# ANN cleanupRootSubscribed "HLint: ignore Redundant bracket" #-} -#endif cleanupRootSubscribed :: RootSubscribed x a -> IO () cleanupRootSubscribed self@RootSubscribed { rootSubscribedKey = k, rootSubscribedCachedSubscribed = cached } = do rootSubscribedUninit self @@ -2614,7 +2610,7 @@ instance HasSpiderTimeline x => Reflex.Class.MonadHold (SpiderTimeline x) (Spide headE e = runFrame . runSpiderHostFrame $ Reflex.Class.headE e {-# INLINABLE now #-} now = runFrame . runSpiderHostFrame $ Reflex.Class.now - + instance HasSpiderTimeline x => Reflex.Class.MonadSample (SpiderTimeline x) (SpiderHostFrame x) where sample = SpiderHostFrame . readBehaviorUntracked . unSpiderBehavior --TODO: This can cause problems with laziness, so we should get rid of it if we can diff --git a/src/Reflex/Time.hs b/src/Reflex/Time.hs index 4ae42f26..df4c42a1 100644 --- a/src/Reflex/Time.hs +++ b/src/Reflex/Time.hs @@ -8,9 +8,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeFamilies #-} -#ifdef USE_TEMPLATE_HASKELL {-# LANGUAGE TemplateHaskell #-} -#endif -- | -- Module: -- Reflex.Time @@ -367,18 +365,4 @@ throttleBatchWithLag lag e = do delayed <- lag (void outE) return outE -#ifdef USE_TEMPLATE_HASKELL makeLensesWith (lensRules & simpleLenses .~ True) ''TickInfo -#else -tickInfo_lastUTC :: Lens' TickInfo UTCTime -tickInfo_lastUTC f (TickInfo x1 x2 x3) = (\y -> TickInfo y x2 x3) <$> f x1 -{-# INLINE tickInfo_lastUTC #-} - -tickInfo_n :: Lens' TickInfo Integer -tickInfo_n f (TickInfo x1 x2 x3) = (\y -> TickInfo x1 y x3) <$> f x2 -{-# INLINE tickInfo_n #-} - -tickInfo_alreadyElapsed :: Lens' TickInfo NominalDiffTime -tickInfo_alreadyElapsed f (TickInfo x1 x2 x3) = (\y -> TickInfo x1 x2 y) <$> f x3 -{-# INLINE tickInfo_alreadyElapsed #-} -#endif diff --git a/test/hlint.hs b/test/hlint.hs index ba309924..1bc6ea2e 100644 --- a/test/hlint.hs +++ b/test/hlint.hs @@ -22,7 +22,6 @@ main = do , "--ignore=Use unless" , "--ignore=Reduce duplication" , "--ignore=Replace case with maybe" - , "--cpp-define=USE_TEMPLATE_HASKELL" , "--cpp-define=DEBUG" , "--ignore=Use tuple-section" ]