packages feed

reflex 0.9.3.3 → 0.9.3.4

raw patch · 25 files changed

+27/−60 lines, 25 filesdep ~random

Dependency ranges changed: random

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for reflex +## 0.9.3.4++* Support random 1.3+ ## 0.9.3.3  * Add support for GHC 9.12
bench/Main.hs view
@@ -29,11 +29,6 @@ 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 () 
reflex.cabal view
@@ -1,5 +1,5 @@ Name: reflex-Version: 0.9.3.3+Version: 0.9.3.4 Synopsis: Higher-order Functional Reactive Programming Description:   Interactive programs without callbacks or side-effects.@@ -91,7 +91,7 @@     prim-uniq >= 0.1.0.1 && < 0.3,     primitive >= 0.5 && < 0.10,     profunctors >= 5.3 && < 5.7,-    random >= 1.1 && < 1.3,+    random >= 1.1 && < 1.4,     ref-tf >= 0.4 && < 0.6,     reflection == 2.1.*,     semigroupoids >= 4.0 && < 7,
src/Control/Monad/ReaderIO.hs view
@@ -9,9 +9,7 @@   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 @@   {-# 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
src/Data/AppendMap.hs view
@@ -25,11 +25,7 @@ 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 
src/Reflex/BehaviorWriter/Base.hs view
@@ -10,6 +10,7 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE StandaloneDeriving #-} #ifdef USE_REFLEX_OPTIMIZER@@ -25,7 +26,6 @@ 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
src/Reflex/Collection.hs view
@@ -36,7 +36,6 @@  import Control.Monad import Control.Monad.Fix-import Control.Monad.Identity import Data.Align import Data.Functor.Misc import Data.Map (Map)
src/Reflex/Dynamic.hs view
@@ -96,7 +96,7 @@ 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)
src/Reflex/Dynamic/TH.hs view
@@ -90,7 +90,6 @@   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 @@                 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
src/Reflex/DynamicWriter/Base.hs view
@@ -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.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
src/Reflex/FunctorMaybe.hs view
@@ -1,8 +1,6 @@ {-# LANGUAGE CPP #-}-#if MIN_VERSION_base(4,9,0) {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE StandaloneDeriving #-}-#endif  -- | -- Module:
src/Reflex/Host/Class.hs view
@@ -8,6 +8,7 @@ {-# LANGUAGE RoleAnnotations #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} #ifdef USE_REFLEX_OPTIMIZER {-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
src/Reflex/Host/Headless.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}  module Reflex.Host.Headless where 
src/Reflex/NotReady/Class.hs view
@@ -4,6 +4,7 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} #ifdef USE_REFLEX_OPTIMIZER {-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
src/Reflex/Optimizer.hs view
@@ -21,9 +21,7 @@ import Data.String import GhcPlugins -#if MIN_VERSION_base(4,9,0) import Prelude hiding ((<>))-#endif  #endif 
src/Reflex/PerformEvent/Base.hs view
@@ -35,7 +35,6 @@ 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 @@   {-# 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 @@   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 @@   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 @@ -- 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                      )
src/Reflex/PerformEvent/Class.hs view
@@ -18,7 +18,6 @@   ) where  import Control.Monad-import Control.Monad.Fix import Control.Monad.Reader import Control.Monad.Trans.Maybe (MaybeT (..)) 
src/Reflex/PostBuild/Base.hs view
@@ -32,7 +32,6 @@ 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
src/Reflex/Pure.hs view
@@ -5,6 +5,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE PolyKinds #-} @@ -212,6 +213,3 @@    headE = slowHeadE   now t = Event $ guard . (t ==)--  -
src/Reflex/Requester/Base/Internal.hs view
@@ -272,10 +272,7 @@ -- | 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
src/Reflex/Requester/Class.hs view
@@ -8,6 +8,7 @@ {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE RecursiveDo #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} #ifdef USE_REFLEX_OPTIMIZER {-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
src/Reflex/Spider/Internal.hs view
@@ -29,16 +29,14 @@ -- 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_) 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@@ -292,7 +290,7 @@   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@@ -317,7 +315,7 @@ 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@@ -2577,9 +2575,7 @@  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
src/Reflex/Time.hs view
@@ -37,7 +37,6 @@ 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 @@              , _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 @@ 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
src/Reflex/TriggerEvent/Base.hs view
@@ -5,6 +5,7 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} module Reflex.TriggerEvent.Base   ( TriggerEventT (..)   , runTriggerEventT
src/Reflex/Workflow.hs view
@@ -30,13 +30,13 @@ 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