diff --git a/.ghci b/.ghci deleted file mode 100644 index e53ed721..00000000 --- a/.ghci +++ /dev/null @@ -1,2 +0,0 @@ -:set -isrc -:seti -XOverloadedStrings diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 5a048b2a..237a6eb1 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -6,7 +6,7 @@ jobs: build: strategy: matrix: - ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.2', '9.2.5', '9.4.5', '9.6.1', '9.8.2', '9.10.1'] + ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.2', '9.2.5', '9.4.5', '9.6.1', '9.8.2', '9.10.1', '9.12.1'] os: ['ubuntu-latest', 'macos-latest'] runs-on: ${{ matrix.os }} diff --git a/ChangeLog.md b/ChangeLog.md index a0bcc0eb..e2147c75 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,10 @@ # Revision history for reflex +## 0.9.3.3 + +* Add support for GHC 9.12 +* Loosen version bounds + ## 0.9.3.2 * Add support for witherable 0.5 diff --git a/reflex.cabal b/reflex.cabal index 0b6a6c85..64c8eae0 100644 --- a/reflex.cabal +++ b/reflex.cabal @@ -1,5 +1,5 @@ Name: reflex -Version: 0.9.3.2 +Version: 0.9.3.3 Synopsis: Higher-order Functional Reactive Programming Description: Interactive programs without callbacks or side-effects. @@ -28,7 +28,7 @@ extra-source-files: ChangeLog.md tested-with: - GHC ==8.4.4 || ==8.6.5 || ==8.8.1 || ==8.10.7 || ==9.0.1 || ==9.2.5 || ==9.4.5 || ==9.6.1 || ==9.8.2 || ==9.10.1, + GHC ==8.4.4 || ==8.6.5 || ==8.8.1 || ==8.10.7 || ==9.0.1 || ==9.2.5 || ==9.4.5 || ==9.6.1 || ==9.8.2 || ==9.10.1 || ==9.12.1, GHCJS ==8.6 || ==8.10 flag use-reflex-optimizer @@ -71,14 +71,14 @@ library hs-source-dirs: src build-depends: MemoTrie == 0.6.*, - base >= 4.11 && < 4.21, + base >= 4.11 && < 4.22, bifunctors >= 5.2 && < 5.7, comonad >= 5.0.4 && < 5.1, commutative-semigroups >= 0.1 && <0.3, constraints >= 0.10 && <0.15, constraints-extras >= 0.3 && < 0.5, containers >= 0.6 && < 0.8, - data-default >= 0.5 && < 0.8, + data-default >= 0.5 && < 0.9, dependent-map >= 0.3 && < 0.5, dependent-sum >= 0.6 && < 0.8, exceptions >= 0.10 && < 0.11, @@ -97,7 +97,7 @@ library semigroupoids >= 4.0 && < 7, stm >= 2.4 && < 2.6, syb >= 0.5 && < 0.8, - time >= 1.4 && < 1.13, + time >= 1.4 && < 1.15, transformers >= 0.5 && < 0.7, unbounded-delays >= 0.1.0.0 && < 0.2, witherable >= 0.4 && < 0.6 @@ -189,7 +189,7 @@ library build-depends: haskell-src-exts >= 1.16 && < 1.24, haskell-src-meta >= 0.6 && < 0.9, - template-haskell >= 2.9 && < 2.23 + template-haskell >= 2.9 && < 2.24 exposed-modules: Reflex.Dynamic.TH other-extensions: TemplateHaskell diff --git a/src/Reflex/BehaviorWriter/Base.hs b/src/Reflex/BehaviorWriter/Base.hs index 520d8602..ad481eba 100644 --- a/src/Reflex/BehaviorWriter/Base.hs +++ b/src/Reflex/BehaviorWriter/Base.hs @@ -10,6 +10,7 @@ Description: Implementation of BehaviorWriter {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE StandaloneDeriving #-} #ifdef USE_REFLEX_OPTIMIZER @@ -25,7 +26,6 @@ import Control.Monad import Control.Monad.Catch (MonadMask, MonadThrow, MonadCatch) import Control.Monad.Exception import Control.Monad.Fix -import Control.Monad.Identity import Control.Monad.IO.Class import Control.Monad.Morph import Control.Monad.Reader diff --git a/src/Reflex/Collection.hs b/src/Reflex/Collection.hs index 770ea4b6..de5cec13 100644 --- a/src/Reflex/Collection.hs +++ b/src/Reflex/Collection.hs @@ -36,7 +36,6 @@ import Data.Zip (Zip (..)) import Control.Monad import Control.Monad.Fix -import Control.Monad.Identity import Data.Align import Data.Functor.Misc import Data.Map (Map) diff --git a/src/Reflex/Dynamic.hs b/src/Reflex/Dynamic.hs index 30859f19..335059e4 100644 --- a/src/Reflex/Dynamic.hs +++ b/src/Reflex/Dynamic.hs @@ -96,7 +96,7 @@ import Data.Maybe import Data.These import Data.Type.Equality ((:~:) (..)) -import Debug.Trace hiding (traceEventWith) +import Debug.Trace (trace) -- | Map a sampling function over a 'Dynamic'. mapDynM :: forall t m a b. (Reflex t, MonadHold t m) => (forall m'. MonadSample t m' => a -> m' b) -> Dynamic t a -> m (Dynamic t b) diff --git a/src/Reflex/DynamicWriter/Base.hs b/src/Reflex/DynamicWriter/Base.hs index 4c3495d9..a5fc0556 100644 --- a/src/Reflex/DynamicWriter/Base.hs +++ b/src/Reflex/DynamicWriter/Base.hs @@ -8,6 +8,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE StandaloneDeriving #-} #ifdef USE_REFLEX_OPTIMIZER @@ -23,7 +24,6 @@ import Control.Monad import Control.Monad.Catch (MonadMask, MonadThrow, MonadCatch) import Control.Monad.Exception import Control.Monad.Fix -import Control.Monad.Identity import Control.Monad.IO.Class import Control.Monad.Morph import Control.Monad.Primitive diff --git a/src/Reflex/Host/Class.hs b/src/Reflex/Host/Class.hs index 4f5a5b72..4f4d57f9 100644 --- a/src/Reflex/Host/Class.hs +++ b/src/Reflex/Host/Class.hs @@ -8,6 +8,7 @@ {-# LANGUAGE RoleAnnotations #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} #ifdef USE_REFLEX_OPTIMIZER {-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-} diff --git a/src/Reflex/Host/Headless.hs b/src/Reflex/Host/Headless.hs index 13f66489..16d1893d 100644 --- a/src/Reflex/Host/Headless.hs +++ b/src/Reflex/Host/Headless.hs @@ -3,6 +3,7 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} module Reflex.Host.Headless where diff --git a/src/Reflex/NotReady/Class.hs b/src/Reflex/NotReady/Class.hs index 7d1232bd..8cff173f 100644 --- a/src/Reflex/NotReady/Class.hs +++ b/src/Reflex/NotReady/Class.hs @@ -4,6 +4,7 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} #ifdef USE_REFLEX_OPTIMIZER {-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-} diff --git a/src/Reflex/PerformEvent/Base.hs b/src/Reflex/PerformEvent/Base.hs index 9fae30ae..270c057f 100644 --- a/src/Reflex/PerformEvent/Base.hs +++ b/src/Reflex/PerformEvent/Base.hs @@ -35,7 +35,6 @@ import Control.Lens import Control.Monad.Catch (MonadMask, MonadThrow, MonadCatch) import Control.Monad.Exception import Control.Monad.Fix -import Control.Monad.Identity import Control.Monad.Primitive import Control.Monad.Reader import Control.Monad.Ref @@ -80,7 +79,7 @@ instance (Monad (HostFrame t), ReflexHost t, Ref m ~ Ref IO) => PerformEvent t ( {-# INLINABLE performEvent #-} performEvent = PerformEventT . requestingIdentity -instance (ReflexHost t, PrimMonad (HostFrame t)) => Adjustable t (PerformEventT t m) where +instance ReflexHost t => Adjustable t (PerformEventT t m) where runWithReplace outerA0 outerA' = PerformEventT $ runWithReplaceRequesterTWith f (coerce outerA0) (coerceEvent outerA') where f :: HostFrame t a -> Event t (HostFrame t b) -> RequesterT t (HostFrame t) Identity (HostFrame t) (a, Event t b) f a0 a' = do @@ -91,7 +90,7 @@ instance (ReflexHost t, PrimMonad (HostFrame t)) => Adjustable t (PerformEventT traverseDMapWithKeyWithAdjust f outerDm0 outerDm' = PerformEventT $ traverseDMapWithKeyWithAdjustRequesterTWith (defaultAdjustBase traversePatchDMapWithKey) mapPatchDMap weakenPatchDMapWith patchMapNewElementsMap mergeMapIncremental (\k v -> unPerformEventT $ f k v) (coerce outerDm0) (coerceEvent outerDm') traverseDMapWithKeyWithAdjustWithMove f outerDm0 outerDm' = PerformEventT $ traverseDMapWithKeyWithAdjustRequesterTWith (defaultAdjustBase traversePatchDMapWithMoveWithKey) mapPatchDMapWithMove weakenPatchDMapWithMoveWith patchMapWithMoveNewElementsMap mergeMapIncrementalWithMove (\k v -> unPerformEventT $ f k v) (coerce outerDm0) (coerceEvent outerDm') -defaultAdjustBase :: forall t v v2 k' p. (Monad (HostFrame t), PrimMonad (HostFrame t), Reflex t) +defaultAdjustBase :: forall t v v2 k' p. (Monad (HostFrame t), Reflex t) => ((forall a. k' a -> v a -> HostFrame t (v2 a)) -> p k' v -> HostFrame t (p k' v2)) -> (forall a. k' a -> v a -> HostFrame t (v2 a)) -> DMap k' v @@ -102,7 +101,7 @@ defaultAdjustBase traversePatchWithKey f' dm0 dm' = do result' <- requestingIdentity $ ffor dm' $ traversePatchWithKey f' return (result0, result') -defaultAdjustIntBase :: forall t v v2 p. (Monad (HostFrame t), PrimMonad (HostFrame t), Reflex t) +defaultAdjustIntBase :: forall t v v2 p. (Monad (HostFrame t), Reflex t) => ((IntMap.Key -> v -> HostFrame t v2) -> p v -> HostFrame t (p v2)) -> (IntMap.Key -> v -> HostFrame t v2) -> IntMap v @@ -124,9 +123,7 @@ instance ReflexHost t => MonadReflexCreateTrigger t (PerformEventT t m) where -- at the appropriate time. {-# INLINABLE hostPerformEventT #-} hostPerformEventT :: forall t m a. - ( Monad m - , MonadSubscribeEvent t m - , MonadReflexHost t m + ( MonadReflexHost t m , MonadRef m , Ref m ~ Ref IO ) diff --git a/src/Reflex/PerformEvent/Class.hs b/src/Reflex/PerformEvent/Class.hs index 1b72fdde..839e7aed 100644 --- a/src/Reflex/PerformEvent/Class.hs +++ b/src/Reflex/PerformEvent/Class.hs @@ -18,7 +18,6 @@ module Reflex.PerformEvent.Class ) where import Control.Monad -import Control.Monad.Fix import Control.Monad.Reader import Control.Monad.Trans.Maybe (MaybeT (..)) diff --git a/src/Reflex/PostBuild/Base.hs b/src/Reflex/PostBuild/Base.hs index a7cb69ff..eaeb4b5d 100644 --- a/src/Reflex/PostBuild/Base.hs +++ b/src/Reflex/PostBuild/Base.hs @@ -32,7 +32,6 @@ import Control.Applicative (liftA2) import Control.Monad.Catch (MonadMask, MonadThrow, MonadCatch) import Control.Monad.Exception import Control.Monad.Fix -import Control.Monad.Identity import Control.Monad.Primitive import Control.Monad.Reader import Control.Monad.Ref diff --git a/src/Reflex/Pure.hs b/src/Reflex/Pure.hs index a0ada8ba..d4f703b4 100644 --- a/src/Reflex/Pure.hs +++ b/src/Reflex/Pure.hs @@ -5,6 +5,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE PolyKinds #-} @@ -212,6 +213,3 @@ instance (Enum t, HasTrie t, Ord t) => MonadHold (Pure t) ((->) t) where headE = slowHeadE now t = Event $ guard . (t ==) - - - diff --git a/src/Reflex/Requester/Class.hs b/src/Reflex/Requester/Class.hs index f9e50757..56f55e6c 100644 --- a/src/Reflex/Requester/Class.hs +++ b/src/Reflex/Requester/Class.hs @@ -8,6 +8,7 @@ {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE RecursiveDo #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} #ifdef USE_REFLEX_OPTIMIZER {-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-} diff --git a/src/Reflex/Spider/Internal.hs b/src/Reflex/Spider/Internal.hs index 16f01e8d..1ac7fcb7 100644 --- a/src/Reflex/Spider/Internal.hs +++ b/src/Reflex/Spider/Internal.hs @@ -36,7 +36,7 @@ import Control.Monad hiding (forM, forM_, mapM, mapM_) import Control.Monad.Catch (MonadMask, MonadThrow, MonadCatch) import Control.Monad.Exception import Control.Monad.Fix -import Control.Monad.Identity hiding (forM, forM_, mapM, mapM_) +import Control.Monad.Identity import Control.Monad.Primitive import Control.Monad.Reader.Class import Control.Monad.IO.Class @@ -290,7 +290,7 @@ subscribeAndReadHead e sub = do return (subscription, occ) --TODO: Make this lazy in its input event -headE :: (MonadIO m, Defer (SomeMergeInit x) m) => Event x a -> m (Event x a) +headE :: (Defer (SomeMergeInit x) m) => Event x a -> m (Event x a) headE originalE = do parent <- liftIO $ newIORef $ Just originalE defer $ SomeMergeInit $ do --TODO: Rename SomeMergeInit appropriately @@ -315,7 +315,7 @@ nowSpiderEventM :: (HasSpiderTimeline x) => EventM x (R.Event (SpiderTimeline x) nowSpiderEventM = SpiderEvent <$> now -now :: (MonadIO m, Defer (Some Clear) m) => m (Event x ()) +now :: (Defer (Some Clear) m) => m (Event x ()) now = do nowOrNot <- liftIO $ newIORef $ Just () scheduleClear nowOrNot diff --git a/src/Reflex/Time.hs b/src/Reflex/Time.hs index 61837309..f795771f 100644 --- a/src/Reflex/Time.hs +++ b/src/Reflex/Time.hs @@ -37,7 +37,6 @@ import Data.Sequence (Seq, (|>)) import qualified Data.Sequence as Seq import Data.These import Data.Time.Clock -import Data.Typeable import GHC.Generics (Generic) import System.Random @@ -50,7 +49,7 @@ data TickInfo , _tickInfo_alreadyElapsed :: NominalDiffTime -- ^ Amount of time that has elapsed in the current tick period. } - deriving (Eq, Ord, Show, Typeable) + deriving (Eq, Ord, Show) -- | Fires an 'Event' once every time provided interval elapses, approximately. -- The provided 'UTCTime' is used bootstrap the determination of how much time has elapsed with each tick. @@ -283,13 +282,13 @@ throttle t e = do data ThrottleState b = ThrottleState_Immediate | ThrottleState_Buffered (ThrottleBuffer b) - deriving (Eq, Ord, Show, Functor, Foldable, Traversable, Generic, Data, Typeable) + deriving (Eq, Ord, Show, Functor, Foldable, Traversable, Generic, Data) data ThrottleBuffer b = ThrottleBuffer_Empty -- Empty conflicts with lens, and hiding it would require turning -- on PatternSynonyms | ThrottleBuffer_Full b - deriving (Eq, Ord, Show, Functor, Foldable, Traversable, Generic, Data, Typeable) + deriving (Eq, Ord, Show, Functor, Foldable, Traversable, Generic, Data) instance Semigroup b => Semigroup (ThrottleBuffer b) where x <> y = case x of diff --git a/src/Reflex/TriggerEvent/Base.hs b/src/Reflex/TriggerEvent/Base.hs index 7ef5a3c6..7172a004 100644 --- a/src/Reflex/TriggerEvent/Base.hs +++ b/src/Reflex/TriggerEvent/Base.hs @@ -5,6 +5,7 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} module Reflex.TriggerEvent.Base ( TriggerEventT (..) , runTriggerEventT diff --git a/src/Reflex/Workflow.hs b/src/Reflex/Workflow.hs index 71317a1e..8381faa8 100644 --- a/src/Reflex/Workflow.hs +++ b/src/Reflex/Workflow.hs @@ -30,13 +30,13 @@ import Reflex.PostBuild.Class newtype Workflow t m a = Workflow { unWorkflow :: m (a, Event t (Workflow t m a)) } -- | Runs a 'Workflow' and returns the 'Dynamic' result of the 'Workflow' (i.e., a 'Dynamic' of the value produced by the current 'Workflow' node, and whose update 'Event' fires whenever one 'Workflow' is replaced by another). -workflow :: forall t m a. (Reflex t, Adjustable t m, MonadFix m, MonadHold t m) => Workflow t m a -> m (Dynamic t a) +workflow :: forall t m a. (Adjustable t m, MonadFix m, MonadHold t m) => Workflow t m a -> m (Dynamic t a) workflow w0 = do rec eResult <- networkHold (unWorkflow w0) $ fmap unWorkflow $ switch $ snd <$> current eResult return $ fmap fst eResult -- | Similar to 'workflow', but outputs an 'Event' that fires at post-build time and whenever the current 'Workflow' is replaced by the next 'Workflow'. -workflowView :: forall t m a. (Reflex t, NotReady t m, Adjustable t m, MonadFix m, MonadHold t m, PostBuild t m) => Workflow t m a -> m (Event t a) +workflowView :: forall t m a. (NotReady t m, Adjustable t m, MonadFix m, MonadHold t m, PostBuild t m) => Workflow t m a -> m (Event t a) workflowView w0 = do rec eResult <- networkView . fmap unWorkflow =<< holdDyn w0 eReplace eReplace <- fmap switch $ hold never $ fmap snd eResult