reflex 0.8.2.0 → 0.8.2.1
raw patch · 17 files changed
+99/−72 lines, 17 filesdep +commutative-semigroupsdep ~basedep ~lensdep ~patch
Dependencies added: commutative-semigroups
Dependency ranges changed: base, lens, patch, template-haskell, time
Files
- ChangeLog.md +5/−0
- reflex.cabal +14/−12
- src/Reflex/Class.hs +7/−6
- src/Reflex/Dynamic.hs +6/−5
- src/Reflex/Dynamic/TH.hs +9/−3
- src/Reflex/FunctorMaybe.hs +2/−2
- src/Reflex/Host/Class.hs +5/−4
- src/Reflex/PerformEvent/Class.hs +7/−5
- src/Reflex/Profiled.hs +2/−1
- src/Reflex/Query/Base.hs +9/−7
- src/Reflex/Query/Class.hs +7/−5
- src/Reflex/Requester/Base.hs +7/−6
- src/Reflex/Requester/Class.hs +3/−2
- src/Reflex/Spider/Internal.hs +1/−1
- src/Reflex/Workflow.hs +1/−0
- test/QueryT.hs +3/−2
- test/RequesterT.hs +11/−11
ChangeLog.md view
@@ -1,5 +1,10 @@ # Revision history for reflex +## Unreleased++* Fix build for GHC 9.2+* Require patch >= 0.0.7.0+ ## 0.8.2.0 * Add `matchResponseMapWithRequests`, which it similar to `matchResponsesWithRequests` but allows processing of multiple responses at once.
reflex.cabal view
@@ -1,5 +1,5 @@ Name: reflex-Version: 0.8.2.0+Version: 0.8.2.1 Synopsis: Higher-order Functional Reactive Programming Description: Interactive programs without callbacks or side-effects.@@ -28,7 +28,7 @@ ChangeLog.md tested-with:- GHC ==8.4.4 || ==8.6.5 || ==8.8.1 || ==8.10.2,+ GHC ==8.4.4 || ==8.6.5 || ==8.8.1 || ==8.10.2 || ==9.0.1 || ==9.2.2, GHCJS ==8.6 flag use-reflex-optimizer@@ -71,37 +71,38 @@ hs-source-dirs: src build-depends: MemoTrie == 0.6.*,- base >= 4.11 && < 4.15,+ base >= 4.11 && < 4.17, bifunctors >= 5.2 && < 5.6, comonad >= 5.0.4 && < 5.1,+ commutative-semigroups >= 0.1 && <0.2, constraints >= 0.10 && <0.14, constraints-extras >= 0.3 && < 0.4, containers >= 0.6 && < 0.7, data-default >= 0.5 && < 0.8, dependent-map >= 0.3 && < 0.5, exception-transformers == 0.4.*,- lens >= 4.7 && < 5,+ lens >= 4.7 && < 5.2, mmorph >= 1.0 && < 1.2, monad-control >= 1.0.1 && < 1.1, mtl >= 2.1 && < 2.3,- patch >= 0.0.1 && < 0.1,+ patch >= 0.0.7 && < 0.1, prim-uniq >= 0.1.0.1 && < 0.3, primitive >= 0.5 && < 0.8, profunctors >= 5.3 && < 5.7,- random == 1.1.*,- ref-tf == 0.4.*,+ random >= 1.1 && < 1.3,+ ref-tf >= 0.4 && < 0.6, reflection == 2.1.*, semigroupoids >= 4.0 && < 6, stm >= 2.4 && < 2.6, syb >= 0.5 && < 0.8,- time >= 1.4 && < 1.10,+ time >= 1.4 && < 1.12, transformers >= 0.5.6.0 && < 0.6, unbounded-delays >= 0.1.0.0 && < 0.2,- witherable >= 0.3 && < 0.4+ witherable >= 0.3 && < 0.5 if flag(split-these)- build-depends: these >= 1 && <1.2,- semialign >=1 && <1.2,+ build-depends: these >= 1 && <1.3,+ semialign >=1 && <1.3, monoidal-containers >= 0.6 && < 0.7 else build-depends: these >= 0.4 && <0.9,@@ -186,7 +187,7 @@ dependent-sum >= 0.6 && < 0.8, haskell-src-exts >= 1.16 && < 1.24, haskell-src-meta >= 0.6 && < 0.9,- template-haskell >= 2.9 && < 2.17+ template-haskell >= 2.9 && < 2.19 exposed-modules: Reflex.Dynamic.TH other-extensions: TemplateHaskell@@ -375,6 +376,7 @@ main-is: QueryT.hs hs-source-dirs: test build-depends: base+ , commutative-semigroups , containers , dependent-map , dependent-sum
src/Reflex/Class.hs view
@@ -209,6 +209,7 @@ import Data.Functor.Plus import Data.IntMap.Strict (IntMap) import qualified Data.IntMap.Strict as IntMap+import Data.Kind (Type) import Data.List.NonEmpty (NonEmpty (..)) import Data.Map (Map) import Data.Semigroup (Semigroup (..))@@ -240,25 +241,25 @@ ) => Reflex t where -- | A container for a value that can change over time. 'Behavior's can be -- sampled at will, but it is not possible to be notified when they change- data Behavior t :: * -> *+ data Behavior t :: Type -> Type -- | A stream of occurrences. During any given frame, an 'Event' is either -- occurring or not occurring; if it is occurring, it will contain a value of -- the given type (its "occurrence type")- data Event t :: * -> *+ data Event t :: Type -> Type -- | A container for a value that can change over time and allows -- notifications on changes. Basically a combination of a 'Behavior' and an -- 'Event', with a rule that the 'Behavior' will change if and only if the -- 'Event' fires.- data Dynamic t :: * -> *+ data Dynamic t :: Type -> Type -- | An 'Incremental' is a more general form of a 'Dynamic'. -- Instead of always fully replacing the value, only parts of it can be patched. -- This is only needed for performance critical code via `mergeIncremental` to make small -- changes to large values.- data Incremental t :: * -> *+ data Incremental t :: Type -> Type -- | A monad for doing complex push-based calculations efficiently- type PushM t :: * -> *+ type PushM t :: Type -> Type -- | A monad for doing complex pull-based calculations efficiently- type PullM t :: * -> *+ type PullM t :: Type -> Type -- | An 'Event' with no occurrences never :: Event t a -- | Create a 'Behavior' that always has the given value
src/Reflex/Dynamic.hs view
@@ -92,6 +92,7 @@ import Data.GADT.Compare (GCompare (..), GEq (..), GOrdering (..)) import Data.IntMap (IntMap) import qualified Data.IntMap as IntMap+import Data.Kind (Type) import Data.Map (Map) import Data.Maybe import Data.Monoid ((<>))@@ -381,7 +382,7 @@ -- | A heterogeneous list whose type and length are fixed statically. This is -- reproduced from the 'HList' package due to integration issues, and because -- very little other functionality from that library is needed.-data HList (l::[*]) where+data HList (l::[Type]) where HNil :: HList '[] HCons :: e -> HList l -> HList (e ': l) @@ -437,7 +438,7 @@ deriving instance Eq (HListPtr l a) deriving instance Ord (HListPtr l a) -fhlistToDMap :: forall (f :: * -> *) l. FHList f l -> DMap (HListPtr l) f+fhlistToDMap :: forall (f :: Type -> Type) l. FHList f l -> DMap (HListPtr l) f fhlistToDMap = DMap.fromList . go where go :: forall l'. FHList f l' -> [DSum (HListPtr l') f] go = \case@@ -477,8 +478,8 @@ -- | Indicates that all elements in a type-level list are applications of the -- same functor.-class AllAreFunctors (f :: a -> *) (l :: [a]) where- type FunctorList f l :: [*]+class AllAreFunctors (f :: a -> Type) (l :: [a]) where+ type FunctorList f l :: [Type] toFHList :: HList (FunctorList f l) -> FHList f l fromFHList :: FHList f l -> HList (FunctorList f l) @@ -513,7 +514,7 @@ -- | Poor man's 'Generic's for product types only. class IsHList a where- type HListElems a :: [*]+ type HListElems a :: [Type] toHList :: a -> HList (HListElems a) fromHList :: HList (HListElems a) -> a
src/Reflex/Dynamic/TH.hs view
@@ -44,9 +44,15 @@ _ -> gmapM f d (e', exprsReversed) <- runStateT (gmapM f e) [] let exprs = reverse exprsReversed- arg = foldr (\a b -> ConE 'FHCons `AppE` snd a `AppE` b) (ConE 'FHNil) exprs- param = foldr (\a b -> ConP 'HCons [VarP (fst a), b]) (ConP 'HNil []) exprs- [| $(return $ LamE [param] e') <$> distributeFHListOverDynPure $(return arg) |]+ arg = foldr+ (\(_, expr) rest -> [e| FHCons $(pure expr) $rest |])+ [e| FHNil |]+ exprs+ param = foldr+ (\(name, _) rest -> [p| HCons $(pure $ VarP name) $rest |])+ [p| HNil |]+ exprs+ [| (\ $param -> $(pure e')) <$> distributeFHListOverDynPure $arg |] -- | Antiquote a 'Dynamic' expression. This can /only/ be used inside of a -- 'qDyn' quotation.
src/Reflex/FunctorMaybe.hs view
@@ -16,7 +16,7 @@ import Data.IntMap (IntMap) import Data.Map (Map)-#if MIN_VERSION_base(4,9,0)+#if !MIN_VERSION_base(4,16,0) import Data.Semigroup (Option(..)) #endif import Data.Witherable@@ -33,7 +33,7 @@ instance FunctorMaybe Maybe where fmapMaybe = mapMaybe -#if MIN_VERSION_base(4,9,0)+#if !MIN_VERSION_base(4,16,0) deriving instance FunctorMaybe Option #endif
src/Reflex/Host/Class.hs view
@@ -42,6 +42,7 @@ import Control.Monad.Trans.Writer (WriterT) import Data.Dependent.Sum (DSum (..)) import Data.GADT.Compare+import Data.Kind (Type) -- | Framework implementation support class for the reflex implementation -- represented by @t@.@@ -52,9 +53,9 @@ , MonadFix (HostFrame t) , MonadSubscribeEvent t (HostFrame t) ) => ReflexHost t where- type EventTrigger t :: * -> *- type EventHandle t :: * -> *- type HostFrame t :: * -> *+ type EventTrigger t :: Type -> Type+ type EventHandle t :: Type -> Type+ type HostFrame t :: Type -> Type -- | Monad in which Events can be 'subscribed'. This forces all underlying -- event sources to be initialized, so that the event will fire whenever it@@ -114,7 +115,7 @@ , MonadSample t (ReadPhase m) , MonadHold t (ReadPhase m) ) => MonadReflexHost t m | m -> t where- type ReadPhase m :: * -> *+ type ReadPhase m :: Type -> Type -- | Propagate some events firings and read the values of events afterwards. -- -- This function will create a new frame to fire the given events. It will
src/Reflex/PerformEvent/Class.hs view
@@ -1,4 +1,4 @@--- | This module defines 'PerformEvent' and 'TriggerEvent', which mediate the+-- | This module defines 'PerformEvent', which mediates the -- interaction between a "Reflex"-based program and the external side-effecting -- actions such as 'IO'. {-# LANGUAGE CPP #-}@@ -17,18 +17,20 @@ , performEventAsync ) where -import Reflex.Class-import Reflex.TriggerEvent.Class- import Control.Monad.Reader import Control.Monad.Trans.Maybe (MaybeT (..)) +import Data.Kind (Type)++import Reflex.Class+import Reflex.TriggerEvent.Class+ -- | 'PerformEvent' represents actions that can trigger other actions based on -- 'Event's. class (Reflex t, Monad (Performable m), Monad m) => PerformEvent t m | m -> t where -- | The type of action to be triggered; this is often not the same type as -- the triggering action.- type Performable m :: * -> *+ type Performable m :: Type -> Type -- | Perform the action contained in the given 'Event' whenever the 'Event' -- fires. Return the result in another 'Event'. Note that the output 'Event' -- will generally occur later than the input 'Event', since most 'Performable'
src/Reflex/Profiled.hs view
@@ -33,6 +33,7 @@ import Data.FastMutableIntMap import Data.IORef import Data.List+import Data.Kind (Type) import Data.Map (Map) import qualified Data.Map.Strict as Map import Data.Monoid ((<>))@@ -147,7 +148,7 @@ pushCheap f (Event_Profiled e) = coerce $ pushCheap (coerce f) $ profileEvent e pull = Behavior_Profiled . pull . coerce fanG (Event_Profiled e) = EventSelectorG $ coerce $ selectG (fanG $ profileEvent e)- mergeG :: forall z (k :: z -> *) q v. GCompare k+ mergeG :: forall z (k :: z -> Type) q v. GCompare k => (forall a. q a -> Event (ProfiledTimeline t) (v a)) -> DMap k q -> Event (ProfiledTimeline t) (DMap k v) mergeG nt = Event_Profiled #. mergeG (coerce nt)
src/Reflex/Query/Base.hs view
@@ -37,10 +37,12 @@ import Data.GADT.Compare (GCompare) import Data.IntMap (IntMap) import qualified Data.IntMap as IntMap+import Data.Kind (Type) import Data.Map (Map) import qualified Data.Map as Map import Data.Monoid ((<>)) import qualified Data.Semigroup as S+import Data.Semigroup.Commutative import Data.Some (Some(Some)) import Data.These @@ -63,7 +65,7 @@ deriving instance MonadHold t m => MonadHold t (QueryT t q m) deriving instance MonadSample t m => MonadSample t (QueryT t q m) -runQueryT :: (MonadFix m, Additive q, Group q, Reflex t) => QueryT t q m a -> Dynamic t (QueryResult q) -> m (a, Incremental t (AdditivePatch q))+runQueryT :: (MonadFix m, Commutative q, Group q, Reflex t) => QueryT t q m a -> Dynamic t (QueryResult q) -> m (a, Incremental t (AdditivePatch q)) runQueryT (QueryT a) qr = do ((r, bs), es) <- runReaderT (runEventWriterT (runStateT a mempty)) qr return (r, unsafeBuildIncremental (foldlM (\b c -> (b <>) <$> sample c) mempty bs) (fmapCheap AdditivePatch es))@@ -79,7 +81,7 @@ maskMempty :: (Eq a, Monoid a) => a -> Maybe a maskMempty x = if x == mempty then Nothing else Just x -instance (Reflex t, MonadFix m, Group q, Additive q, Query q, Eq q, MonadHold t m, Adjustable t m) => Adjustable t (QueryT t q m) where+instance (Reflex t, MonadFix m, Group q, Commutative q, Query q, Eq q, MonadHold t m, Adjustable t m) => Adjustable t (QueryT t q m) where runWithReplace (QueryT a0) a' = do ((r0, bs0), r') <- QueryT $ lift $ runWithReplace (runStateT a0 []) $ fmapCheap (flip runStateT [] . unQueryT) a' let sampleBs :: forall m'. MonadSample t m' => [Behavior t q] -> m' q@@ -138,7 +140,7 @@ tellQueryIncremental $ unsafeBuildIncremental (fold <$> mapM sampleBs liftedBs0) qpatch return (liftedResult0, liftedResult') - traverseDMapWithKeyWithAdjust :: forall (k :: * -> *) v v'. (GCompare k) => (forall a. k a -> v a -> QueryT t q m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> QueryT t q m (DMap k v', Event t (PatchDMap k v'))+ traverseDMapWithKeyWithAdjust :: forall (k :: Type -> Type) v v'. (GCompare k) => (forall a. k a -> v a -> QueryT t q m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> QueryT t q m (DMap k v', Event t (PatchDMap k v')) traverseDMapWithKeyWithAdjust f dm0 dm' = do let f' :: forall a. k a -> v a -> EventWriterT t q (ReaderT (Dynamic t (QueryResult q)) m) (Compose (QueryTLoweredResult t q) v' a) f' k v = fmap (Compose . QueryTLoweredResult) $ flip runStateT [] $ unQueryT $ f k v@@ -183,7 +185,7 @@ tellQueryIncremental $ unsafeBuildIncremental (fold <$> mapM sampleBs liftedBs0) qpatch return (liftedResult0, liftedResult') - traverseDMapWithKeyWithAdjustWithMove :: forall (k :: * -> *) v v'. (GCompare k) => (forall a. k a -> v a -> QueryT t q m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> QueryT t q m (DMap k v', Event t (PatchDMapWithMove k v'))+ traverseDMapWithKeyWithAdjustWithMove :: forall (k :: Type -> Type) v v'. (GCompare k) => (forall a. k a -> v a -> QueryT t q m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> QueryT t q m (DMap k v', Event t (PatchDMapWithMove k v')) traverseDMapWithKeyWithAdjustWithMove f dm0 dm' = do let f' :: forall a. k a -> v a -> EventWriterT t q (ReaderT (Dynamic t (QueryResult q)) m) (Compose (QueryTLoweredResult t q) v' a) f' k v = fmap (Compose . QueryTLoweredResult) $ flip runStateT [] $ unQueryT $ f k v@@ -282,7 +284,7 @@ (<>) = liftA2 (S.<>) -- | withQueryT's QueryMorphism argument needs to be a group homomorphism in order to behave correctly-withQueryT :: (MonadFix m, PostBuild t m, Group q, Group q', Additive q, Additive q', Query q')+withQueryT :: (MonadFix m, PostBuild t m, Group q, Group q', Commutative q, Commutative q', Query q') => QueryMorphism q q' -> QueryT t q m a -> QueryT t q' m a@@ -299,7 +301,7 @@ mapQueryT f (QueryT a) = QueryT $ mapStateT (mapEventWriterT (mapReaderT f)) a -- | dynWithQueryT's (Dynamic t QueryMorphism) argument needs to be a group homomorphism at all times in order to behave correctly-dynWithQueryT :: (MonadFix m, PostBuild t m, Group q, Additive q, Group q', Additive q', Query q')+dynWithQueryT :: (MonadFix m, PostBuild t m, Group q, Commutative q, Group q', Commutative q', Query q') => Dynamic t (QueryMorphism q q') -> QueryT t q m a -> QueryT t q' m a@@ -324,7 +326,7 @@ return $ Just $ AdditivePatch $ mconcat [ g a bOld, negateG (g aOld bOld), g a b] in unsafeBuildIncremental (g <$> sample (current da) <*> sample (currentIncremental ib)) ec -instance (Monad m, Group q, Additive q, Query q, Reflex t) => MonadQuery t q (QueryT t q m) where+instance (Monad m, Group q, Commutative q, Query q, Reflex t) => MonadQuery t q (QueryT t q m) where tellQueryIncremental q = do QueryT (modify (currentIncremental q:)) QueryT (lift (tellEvent (fmapCheap unAdditivePatch (updatedIncremental q))))
src/Reflex/Query/Class.hs view
@@ -27,19 +27,21 @@ , mapQueryResult ) where +import Control.Applicative import Control.Category (Category) import qualified Control.Category as Cat import Control.Monad.Reader import Data.Bits import Data.Data import Data.Ix+import Data.Kind (Type) import Data.Map.Monoidal (MonoidalMap) import qualified Data.Map.Monoidal as MonoidalMap import Data.Semigroup (Semigroup(..))-import Foreign.Storable+import Data.Semigroup.Commutative import Data.Void import Data.Monoid hiding ((<>))-import Control.Applicative+import Foreign.Storable import Reflex.Class @@ -48,7 +50,7 @@ -- The @crop@ function provides a way to determine what part of a given 'QueryResult' -- is relevant to a given 'Query'. class (Monoid (QueryResult a), Semigroup (QueryResult a)) => Query a where- type QueryResult a :: *+ type QueryResult a :: Type crop :: a -> QueryResult a -> QueryResult a instance (Ord k, Query v) => Query (MonoidalMap k v) where@@ -123,7 +125,7 @@ instance Group SelectedCount where negateG (SelectedCount a) = SelectedCount (negate a) -instance Additive SelectedCount+instance Commutative SelectedCount -- | The Semigroup\/Monoid\/Group instances for a Query containing 'SelectedCount's should use -- this function which returns Nothing if the result is 0. This allows the pruning of leaves@@ -133,7 +135,7 @@ -- | A class that allows sending of 'Query's and retrieval of 'QueryResult's. See 'queryDyn' for a commonly -- used interface.-class (Group q, Additive q, Query q, Monad m) => MonadQuery t q m | m -> q t where+class (Group q, Commutative q, Query q, Monad m) => MonadQuery t q m | m -> q t where tellQueryIncremental :: Incremental t (AdditivePatch q) -> m () askQueryResult :: m (Dynamic t (QueryResult q)) queryIncremental :: Incremental t (AdditivePatch q) -> m (Dynamic t (QueryResult q))
src/Reflex/Requester/Base.hs view
@@ -66,6 +66,7 @@ import Data.Functor.Misc import Data.IntMap.Strict (IntMap) import qualified Data.IntMap.Strict as IntMap+import Data.Kind (Type) import Data.Map (Map) import qualified Data.Map as Map import Data.Monoid ((<>))@@ -80,7 +81,7 @@ --TODO: Make this module type-safe -newtype TagMap (f :: * -> *) = TagMap (IntMap Any)+newtype TagMap (f :: Type -> Type) = TagMap (IntMap Any) newtype RequesterData f = RequesterData (TagMap (Entry f)) @@ -184,7 +185,7 @@ forRequesterData :: forall request response m. Applicative m => RequesterData request -> (forall a. request a -> m (response a)) -> m (RequesterData response) forRequesterData r f = traverseRequesterData f r -data MyTagType :: * -> * where+data MyTagType :: Type -> Type where MyTagType_Single :: MyTagType (Single a) MyTagType_Multi :: MyTagType Multi MyTagType_Multi2 :: MyTagType (Multi2 k)@@ -200,7 +201,7 @@ data Single a data Multi-data Multi2 (k :: * -> *)+data Multi2 (k :: Type -> Type) data Multi3 class MyTagTypeOffset x where@@ -247,7 +248,7 @@ -- WARNING: This type should never be exposed. In particular, this is extremely unsound if a MyTag from one run of runRequesterT is ever compared against a MyTag from another newtype MyTag x = MyTag Int deriving (Show, Eq, Ord, Enum) -newtype MyTagWrap (f :: * -> *) x = MyTagWrap Int deriving (Show, Eq, Ord, Enum)+newtype MyTagWrap (f :: Type -> Type) x = MyTagWrap Int deriving (Show, Eq, Ord, Enum) {-# INLINE castMyTagWrap #-} castMyTagWrap :: MyTagWrap f (Entry f x) -> MyTagWrap g (Entry g x)@@ -279,13 +280,13 @@ EQ -> unsafeCoerce GEQ GT -> GGT -data RequesterState t (request :: * -> *) = RequesterState+data RequesterState t (request :: Type -> Type) = RequesterState { _requesterState_nextMyTag :: {-# UNPACK #-} !Int -- Starts at -4 and goes down by 4 each time, to accommodate two 'type' bits at the bottom , _requesterState_requests :: ![(Int, Event t Any)] } -- | A basic implementation of 'Requester'.-newtype RequesterT t request (response :: * -> *) m a = RequesterT { unRequesterT :: StateT (RequesterState t request) (ReaderT (EventSelectorInt t Any) m) a }+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)
src/Reflex/Requester/Class.hs view
@@ -22,6 +22,7 @@ import Control.Monad.Reader import qualified Control.Monad.State.Lazy as Lazy import Control.Monad.State.Strict+import Data.Kind (Type) import Reflex.Class -- | A 'Requester' action can trigger requests of type @Request m a@ based on@@ -32,9 +33,9 @@ -- 'Reflex.PerformEvent.Class.performEvent'. class (Reflex t, Monad m) => Requester t m | m -> t where -- | The type of requests that this 'Requester' can emit- type Request m :: * -> *+ type Request m :: Type -> Type -- | The type of responses that this 'Requester' can receive- type Response m :: * -> *+ type Response m :: Type -> Type -- | Emit a request whenever the given 'Event' fires, and return responses in -- the resulting 'Event'. requesting :: Event t (Request m a) -> m (Event t (Response m a))
src/Reflex/Spider/Internal.hs view
@@ -2775,7 +2775,7 @@ fanG e = R.EventSelectorG $ SpiderEvent . selectG (fanG (unSpiderEvent e)) {-# INLINABLE mergeG #-} mergeG- :: forall k2 (k :: k2 -> *) q (v :: k2 -> *). GCompare k+ :: forall k2 (k :: k2 -> Type) q (v :: k2 -> Type). GCompare k => (forall a. q a -> R.Event (SpiderTimeline x) (v a)) -> DMap k q -> R.Event (SpiderTimeline x) (DMap k v)
src/Reflex/Workflow.hs view
@@ -25,6 +25,7 @@ import Reflex.PostBuild.Class -- | A widget in a workflow+-- -- When the 'Event' returned by a 'Workflow' fires, the current 'Workflow' is replaced by the one inside the firing 'Event'. A series of 'Workflow's must share the same return type. newtype Workflow t m a = Workflow { unWorkflow :: m (a, Event t (Workflow t m a)) }
test/QueryT.hs view
@@ -17,6 +17,7 @@ import qualified Data.Map as Map import Data.Map.Monoidal (MonoidalMap) import Data.Semigroup+import Data.Semigroup.Commutative import Data.These #if defined(MIN_VERSION_these_lens) || (MIN_VERSION_these(0,8,0) && !MIN_VERSION_these(0,9,0))@@ -28,7 +29,7 @@ import Test.Run newtype MyQuery = MyQuery SelectedCount- deriving (Show, Read, Eq, Ord, Monoid, Semigroup, Additive, Group)+ deriving (Show, Read, Eq, Ord, Monoid, Semigroup, Commutative, Group) instance Query MyQuery where type QueryResult MyQuery = ()@@ -62,7 +63,7 @@ instance (Eq a, Ord k, Group a, Align (MonoidalMap k)) => Group (Selector k a) where negateG = fmap negateG -instance (Eq a, Ord k, Group a, Align (MonoidalMap k)) => Additive (Selector k a)+instance (Eq a, Ord k, Group a, Align (MonoidalMap k)) => Commutative (Selector k a) main :: IO () main = do
test/RequesterT.hs view
@@ -44,6 +44,17 @@ data RequestInt a where RequestInt :: Int -> RequestInt Int +data TestRequest a where+ TestRequest_Reverse :: String -> TestRequest String+ TestRequest_Increment :: Int -> TestRequest Int++deriveArgDict ''TestRequest++instance Show (TestRequest a) where+ show = \case+ TestRequest_Reverse str -> "reverse " <> str+ TestRequest_Increment i -> "increment " <> show i+ main :: IO () main = do os1 <- runApp' (unwrapApp testOrdering) $@@ -196,10 +207,6 @@ (_, pulse') <- runWithReplace (pure ()) $ pure (RequestInt 1) <$ pulse requestingIdentity pulse' -data TestRequest a where- TestRequest_Reverse :: String -> TestRequest String- TestRequest_Increment :: Int -> TestRequest Int- testMatchRequestsWithResponses :: forall m t req a . ( MonadFix m@@ -226,10 +233,3 @@ ( whichever @Show @req @a $ show r , \x -> has @Read r $ readMaybe x )--deriveArgDict ''TestRequest--instance Show (TestRequest a) where- show = \case- TestRequest_Reverse str -> "reverse " <> str- TestRequest_Increment i -> "increment " <> show i