Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides RequesterT
, the standard implementation of
Requester
.
Synopsis
- newtype TagMap (f :: Type -> Type) = TagMap (IntMap Any)
- newtype RequesterData f = RequesterData (TagMap (Entry f))
- emptyRequesterData :: RequesterData f
- data RequesterDataKey a where
- RequesterDataKey_Single :: !(MyTag (Single a)) -> RequesterDataKey a
- RequesterDataKey_Multi :: !(MyTag Multi) -> !Int -> !(RequesterDataKey a) -> RequesterDataKey a
- RequesterDataKey_Multi2 :: GCompare k => !(MyTag (Multi2 k)) -> !(Some k) -> !Int -> !(RequesterDataKey a) -> RequesterDataKey a
- RequesterDataKey_Multi3 :: !(MyTag Multi3) -> !Int -> !Int -> !(RequesterDataKey a) -> RequesterDataKey a
- singletonRequesterData :: RequesterDataKey a -> f a -> RequesterData f
- mergeRequesterData :: RequesterData f -> RequesterData f -> RequesterData f
- mergeTagMap :: forall f. TagMap (Entry f) -> TagMap (Entry f) -> TagMap (Entry f)
- requesterDataToList :: RequesterData f -> [DSum RequesterDataKey f]
- singletonTagMap :: forall f a. MyTag a -> f a -> TagMap f
- tagMapToList :: forall f. TagMap f -> [DSum MyTag f]
- traverseTagMapWithKey :: forall t f g. Applicative t => (forall a. MyTag a -> f a -> t (g a)) -> TagMap f -> t (TagMap g)
- traverseRequesterData :: forall m request response. Applicative m => (forall a. request a -> m (response a)) -> RequesterData request -> m (RequesterData response)
- forRequesterData :: forall request response m. Applicative m => RequesterData request -> (forall a. request a -> m (response a)) -> m (RequesterData response)
- data MyTagType :: Type -> Type where
- myKeyType :: MyTag x -> MyTagType x
- data Single a
- data Multi
- data Multi2 (k :: Type -> Type)
- data Multi3
- class MyTagTypeOffset x where
- myTagTypeOffset :: proxy x -> Int
- type family EntryContents request a where ...
- data Multi2Contents k request = Multi2Contents {
- _multi2Contents_dict :: !(Dict (GCompare k))
- _multi2Contents_values :: !(Map (Some k) (IntMap (RequesterData request)))
- newtype Entry request x = Entry {
- unEntry :: EntryContents request x
- singleEntry :: f a -> Entry f (Single a)
- multiEntry :: IntMap (RequesterData f) -> Entry f Multi
- unMultiEntry :: Entry f Multi -> IntMap (RequesterData f)
- newtype MyTag x = MyTag Int
- newtype MyTagWrap (f :: Type -> Type) x = MyTagWrap Int
- castMyTagWrap :: MyTagWrap f (Entry f x) -> MyTagWrap g (Entry g x)
- data RequesterState t (request :: Type -> Type) = RequesterState {
- _requesterState_nextMyTag :: !Int
- _requesterState_requests :: ![(Int, Event t Any)]
- newtype RequesterT t request (response :: Type -> Type) m a = RequesterT {
- unRequesterT :: StateT (RequesterState t request) (ReaderT (EventSelectorInt t Any) m) a
- runRequesterT :: (Reflex t, Monad m) => RequesterT t request response m a -> Event t (RequesterData response) -> m (a, Event t (RequesterData request))
- withRequesterT :: (Reflex t, MonadFix m) => (forall x. req x -> req' x) -> (forall x. rsp' x -> rsp x) -> RequesterT t req rsp m a -> RequesterT t req' rsp' m a
- tagRequest :: forall m x t request response. (Monad m, MyTagTypeOffset x) => Event t (Entry request x) -> RequesterT t request response m (MyTagWrap request (Entry request x))
- responseFromTag :: forall m t request response x. Monad m => MyTagWrap response (Entry response x) -> RequesterT t request response m (Event t (Entry response x))
- requesting' :: (MyTagTypeOffset x, Monad m) => Event t (Entry request x) -> RequesterT t request response m (Event t (Entry response x))
- runWithReplaceRequesterTWith :: forall m t request response a b. (Reflex t, MonadHold t m, MonadFix m) => (forall a' b'. m a' -> Event t (m b') -> RequesterT t request response m (a', Event t b')) -> RequesterT t request response m a -> Event t (RequesterT t request response m b) -> RequesterT t request response m (a, Event t b)
- traverseIntMapWithKeyWithAdjustRequesterTWith :: forall t request response m v v' p. (Reflex t, MonadHold t m, PatchTarget (p (Event t (IntMap (RequesterData request)))) ~ IntMap (Event t (IntMap (RequesterData request))), Patch (p (Event t (IntMap (RequesterData request)))), Functor p, MonadFix m) => ((Key -> (Key, v) -> m (Event t (IntMap (RequesterData request)), v')) -> IntMap (Key, v) -> Event t (p (Key, v)) -> RequesterT t request response m (IntMap (Event t (IntMap (RequesterData request)), v'), Event t (p (Event t (IntMap (RequesterData request)), v')))) -> (p (Event t (IntMap (RequesterData request))) -> IntMap (Event t (IntMap (RequesterData request)))) -> (Incremental t (p (Event t (IntMap (RequesterData request)))) -> Event t (IntMap (IntMap (RequesterData request)))) -> (Key -> v -> RequesterT t request response m v') -> IntMap v -> Event t (p v) -> RequesterT t request response m (IntMap v', Event t (p v'))
- traverseDMapWithKeyWithAdjustRequesterTWith :: forall k t request response m v v' p p'. (GCompare k, Reflex t, MonadHold t m, PatchTarget (p' (Some k) (Event t (IntMap (RequesterData request)))) ~ Map (Some k) (Event t (IntMap (RequesterData request))), Patch (p' (Some k) (Event t (IntMap (RequesterData request)))), MonadFix m) => (forall k' v1 v2. GCompare k' => (forall a. k' a -> v1 a -> m (v2 a)) -> DMap k' v1 -> Event t (p k' v1) -> RequesterT t request response m (DMap k' v2, Event t (p k' v2))) -> (forall v1 v2. (forall a. v1 a -> v2 a) -> p k v1 -> p k v2) -> (forall v1 v2. (forall a. v1 a -> v2) -> p k v1 -> p' (Some k) v2) -> (forall v2. p' (Some k) v2 -> Map (Some k) v2) -> (forall a. Incremental t (p' (Some k) (Event t a)) -> Event t (Map (Some k) a)) -> (forall a. k a -> v a -> RequesterT t request response m (v' a)) -> DMap k v -> Event t (p k v) -> RequesterT t request response m (DMap k v', Event t (p k v'))
- data Decoder rawResponse response = forall a. Decoder (RequesterDataKey a) (rawResponse -> response a)
- matchResponsesWithRequests :: forall t rawRequest rawResponse request response m. (MonadFix m, MonadHold t m, Reflex t) => (forall a. request a -> (rawRequest, rawResponse -> response a)) -> Event t (RequesterData request) -> Event t (Int, rawResponse) -> m (Event t (Map Int rawRequest), Event t (RequesterData response))
- matchResponseMapWithRequests :: forall t rawRequest rawResponse request response m. (MonadFix m, MonadHold t m, Reflex t) => (forall a. request a -> (rawRequest, rawResponse -> response a)) -> Event t (RequesterData request) -> Event t (Map Int rawResponse) -> m (Event t (Map Int rawRequest), Event t (RequesterData response))
Documentation
newtype RequesterData f Source #
RequesterData (TagMap (Entry f)) |
data RequesterDataKey a where Source #
RequesterDataKey_Single :: !(MyTag (Single a)) -> RequesterDataKey a | |
RequesterDataKey_Multi :: !(MyTag Multi) -> !Int -> !(RequesterDataKey a) -> RequesterDataKey a | |
RequesterDataKey_Multi2 :: GCompare k => !(MyTag (Multi2 k)) -> !(Some k) -> !Int -> !(RequesterDataKey a) -> RequesterDataKey a | |
RequesterDataKey_Multi3 :: !(MyTag Multi3) -> !Int -> !Int -> !(RequesterDataKey a) -> RequesterDataKey a |
singletonRequesterData :: RequesterDataKey a -> f a -> RequesterData f Source #
mergeRequesterData :: RequesterData f -> RequesterData f -> RequesterData f Source #
requesterDataToList :: RequesterData f -> [DSum RequesterDataKey f] Source #
singletonTagMap :: forall f a. MyTag a -> f a -> TagMap f Source #
traverseTagMapWithKey :: forall t f g. Applicative t => (forall a. MyTag a -> f a -> t (g a)) -> TagMap f -> t (TagMap g) Source #
traverseRequesterData :: forall m request response. Applicative m => (forall a. request a -> m (response a)) -> RequesterData request -> m (RequesterData response) Source #
Runs in reverse to accommodate for the fact that we accumulate it in reverse
forRequesterData :: forall request response m. Applicative m => RequesterData request -> (forall a. request a -> m (response a)) -> m (RequesterData response) Source #
traverseRequesterData
with its arguments flipped
data MyTagType :: Type -> Type where Source #
MyTagType_Single :: MyTagType (Single a) | |
MyTagType_Multi :: MyTagType Multi | |
MyTagType_Multi2 :: MyTagType (Multi2 k) | |
MyTagType_Multi3 :: MyTagType Multi3 |
Instances
MyTagTypeOffset (Single a) Source # | |
Defined in Reflex.Requester.Base.Internal myTagTypeOffset :: proxy (Single a) -> Int Source # |
Instances
MyTagTypeOffset Multi Source # | |
Defined in Reflex.Requester.Base.Internal myTagTypeOffset :: proxy Multi -> Int Source # |
data Multi2 (k :: Type -> Type) Source #
Instances
MyTagTypeOffset (Multi2 k) Source # | |
Defined in Reflex.Requester.Base.Internal myTagTypeOffset :: proxy (Multi2 k) -> Int Source # |
Instances
MyTagTypeOffset Multi3 Source # | |
Defined in Reflex.Requester.Base.Internal myTagTypeOffset :: proxy Multi3 -> Int Source # |
class MyTagTypeOffset x where Source #
myTagTypeOffset :: proxy x -> Int Source #
Instances
MyTagTypeOffset Multi Source # | |
Defined in Reflex.Requester.Base.Internal myTagTypeOffset :: proxy Multi -> Int Source # | |
MyTagTypeOffset Multi3 Source # | |
Defined in Reflex.Requester.Base.Internal myTagTypeOffset :: proxy Multi3 -> Int Source # | |
MyTagTypeOffset (Multi2 k) Source # | |
Defined in Reflex.Requester.Base.Internal myTagTypeOffset :: proxy (Multi2 k) -> Int Source # | |
MyTagTypeOffset (Single a) Source # | |
Defined in Reflex.Requester.Base.Internal myTagTypeOffset :: proxy (Single a) -> Int Source # |
type family EntryContents request a where ... Source #
EntryContents request (Single a) = request a | |
EntryContents request Multi = IntMap (RequesterData request) | |
EntryContents request (Multi2 k) = Multi2Contents k request | |
EntryContents request Multi3 = IntMap (IntMap (RequesterData request)) |
data Multi2Contents k request Source #
Multi2Contents | |
|
singleEntry :: f a -> Entry f (Single a) Source #
multiEntry :: IntMap (RequesterData f) -> Entry f Multi Source #
unMultiEntry :: Entry f Multi -> IntMap (RequesterData f) Source #
We use a hack here to pretend we have x ~ request a; we don't want to use a GADT, because GADTs (even with zero-size existential contexts) can't be newtypes 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
Instances
GCompare MyTag Source # | |
GEq MyTag Source # | |
Enum (MyTag x) Source # | |
Show (MyTag x) Source # | |
Eq (MyTag x) Source # | |
Ord (MyTag x) Source # | |
Defined in Reflex.Requester.Base.Internal |
newtype MyTagWrap (f :: Type -> Type) x Source #
Instances
GCompare (MyTagWrap f :: Type -> Type) Source # | |
GEq (MyTagWrap f :: Type -> Type) Source # | |
Enum (MyTagWrap f x) Source # | |
Defined in Reflex.Requester.Base.Internal succ :: MyTagWrap f x -> MyTagWrap f x # pred :: MyTagWrap f x -> MyTagWrap f x # toEnum :: Int -> MyTagWrap f x # fromEnum :: MyTagWrap f x -> Int # enumFrom :: MyTagWrap f x -> [MyTagWrap f x] # enumFromThen :: MyTagWrap f x -> MyTagWrap f x -> [MyTagWrap f x] # enumFromTo :: MyTagWrap f x -> MyTagWrap f x -> [MyTagWrap f x] # enumFromThenTo :: MyTagWrap f x -> MyTagWrap f x -> MyTagWrap f x -> [MyTagWrap f x] # | |
Show (MyTagWrap f x) Source # | |
Eq (MyTagWrap f x) Source # | |
Ord (MyTagWrap f x) Source # | |
Defined in Reflex.Requester.Base.Internal compare :: MyTagWrap f x -> MyTagWrap f x -> Ordering # (<) :: MyTagWrap f x -> MyTagWrap f x -> Bool # (<=) :: MyTagWrap f x -> MyTagWrap f x -> Bool # (>) :: MyTagWrap f x -> MyTagWrap f x -> Bool # (>=) :: MyTagWrap f x -> MyTagWrap f x -> Bool # |
data RequesterState t (request :: Type -> Type) Source #
RequesterState | |
|
newtype RequesterT t request (response :: Type -> Type) m a Source #
A basic implementation of Requester
.
RequesterT | |
|
Instances
MonadHold t m => MonadHold (t :: Type) (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal hold :: a -> Event t a -> RequesterT t request response m (Behavior t a) Source # holdDyn :: a -> Event t a -> RequesterT t request response m (Dynamic t a) Source # holdIncremental :: Patch p => PatchTarget p -> Event t p -> RequesterT t request response m (Incremental t p) Source # buildDynamic :: PushM t a -> Event t a -> RequesterT t request response m (Dynamic t a) Source # headE :: Event t a -> RequesterT t request response m (Event t a) Source # now :: RequesterT t request response m (Event t ()) Source # | |
MonadSample t m => MonadSample (t :: Type) (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal sample :: Behavior t a -> RequesterT t request response m a Source # | |
EventWriter t w m => EventWriter t w (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal tellEvent :: Event t w -> RequesterT t request response m () Source # | |
MFunctor (RequesterT t request response :: (Type -> Type) -> Type -> Type) Source # | |
Defined in Reflex.Requester.Base.Internal hoist :: forall m n (b :: k). Monad m => (forall a. m a -> n a) -> RequesterT t request response m b -> RequesterT t request response n b # | |
MonadReader r m => MonadReader r (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal ask :: RequesterT t request response m r # local :: (r -> r) -> RequesterT t request response m a -> RequesterT t request response m a # reader :: (r -> a) -> RequesterT t request response m a # | |
(Reflex t, Adjustable t m, MonadHold t m, MonadFix m) => Adjustable t (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal runWithReplace :: RequesterT t request response m a -> Event t (RequesterT t request response m b) -> RequesterT t request response m (a, Event t b) Source # traverseIntMapWithKeyWithAdjust :: (Key -> v -> RequesterT t request response m v') -> IntMap v -> Event t (PatchIntMap v) -> RequesterT t request response m (IntMap v', Event t (PatchIntMap v')) Source # traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> RequesterT t request response m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> RequesterT t request response m (DMap k v', Event t (PatchDMap k v')) Source # traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> RequesterT t request response m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> RequesterT t request response m (DMap k v', Event t (PatchDMapWithMove k v')) Source # | |
MonadReflexCreateTrigger t m => MonadReflexCreateTrigger t (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal newEventWithTrigger :: (EventTrigger t a -> IO (IO ())) -> RequesterT t request response m (Event t a) Source # newFanEventWithTrigger :: GCompare k => (forall a. k a -> EventTrigger t a -> IO (IO ())) -> RequesterT t request response m (EventSelector t k) Source # | |
NotReady t m => NotReady t (RequesterT t request response m) Source # | |
Defined in Reflex.NotReady.Class notReadyUntil :: Event t a -> RequesterT t request response m () Source # notReady :: RequesterT t request response m () Source # | |
PerformEvent t m => PerformEvent t (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal type Performable (RequesterT t request response m) :: Type -> Type Source # performEvent :: Event t (Performable (RequesterT t request response m) a) -> RequesterT t request response m (Event t a) Source # performEvent_ :: Event t (Performable (RequesterT t request response m) ()) -> RequesterT t request response m () Source # | |
PostBuild t m => PostBuild t (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal getPostBuild :: RequesterT t request response m (Event t ()) Source # | |
(Reflex t, Monad m) => Requester t (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal type Request (RequesterT t request response m) :: Type -> Type Source # type Response (RequesterT t request response m) :: Type -> Type Source # requesting :: Event t (Request (RequesterT t request response m) a) -> RequesterT t request response m (Event t (Response (RequesterT t request response m) a)) Source # requesting_ :: Event t (Request (RequesterT t request response m) a) -> RequesterT t request response m () Source # | |
TriggerEvent t m => TriggerEvent t (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal newTriggerEvent :: RequesterT t request response m (Event t a, a -> IO ()) Source # newTriggerEventWithOnComplete :: RequesterT t request response m (Event t a, a -> IO () -> IO ()) Source # newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> RequesterT t request response m (Event t a) Source # | |
MonadTrans (RequesterT t request response) Source # | |
Defined in Reflex.Requester.Base.Internal lift :: Monad m => m a -> RequesterT t request response m a # | |
MonadFix m => MonadFix (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal mfix :: (a -> RequesterT t request response m a) -> RequesterT t request response m a # | |
MonadIO m => MonadIO (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal liftIO :: IO a -> RequesterT t request response m a # | |
Monad m => Applicative (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal pure :: a -> RequesterT t request response m a # (<*>) :: RequesterT t request response m (a -> b) -> RequesterT t request response m a -> RequesterT t request response m b # liftA2 :: (a -> b -> c) -> RequesterT t request response m a -> RequesterT t request response m b -> RequesterT t request response m c # (*>) :: RequesterT t request response m a -> RequesterT t request response m b -> RequesterT t request response m b # (<*) :: RequesterT t request response m a -> RequesterT t request response m b -> RequesterT t request response m a # | |
Functor m => Functor (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal fmap :: (a -> b) -> RequesterT t request response m a -> RequesterT t request response m b # (<$) :: a -> RequesterT t request response m b -> RequesterT t request response m a # | |
Monad m => Monad (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal (>>=) :: RequesterT t request response m a -> (a -> RequesterT t request response m b) -> RequesterT t request response m b # (>>) :: RequesterT t request response m a -> RequesterT t request response m b -> RequesterT t request response m b # return :: a -> RequesterT t request response m a # | |
MonadAsyncException m => MonadAsyncException (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal mask :: ((forall a. RequesterT t request response m a -> RequesterT t request response m a) -> RequesterT t request response m b) -> RequesterT t request response m b # | |
MonadException m => MonadException (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal throw :: Exception e => e -> RequesterT t request response m a # catch :: Exception e => RequesterT t request response m a -> (e -> RequesterT t request response m a) -> RequesterT t request response m a # finally :: RequesterT t request response m a -> RequesterT t request response m b -> RequesterT t request response m a # | |
PrimMonad m => PrimMonad (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal type PrimState (RequesterT t request response m) # primitive :: (State# (PrimState (RequesterT t request response m)) -> (# State# (PrimState (RequesterT t request response m)), a #)) -> RequesterT t request response m a # | |
MonadRef m => MonadRef (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal type Ref (RequesterT t request response m) :: Type -> Type # newRef :: a -> RequesterT t request response m (Ref (RequesterT t request response m) a) # readRef :: Ref (RequesterT t request response m) a -> RequesterT t request response m a # writeRef :: Ref (RequesterT t request response m) a -> a -> RequesterT t request response m () # modifyRef :: Ref (RequesterT t request response m) a -> (a -> a) -> RequesterT t request response m () # modifyRef' :: Ref (RequesterT t request response m) a -> (a -> a) -> RequesterT t request response m () # | |
(Monoid a, Monad m) => Monoid (RequesterT t request response m a) Source # | |
Defined in Reflex.Requester.Base.Internal mempty :: RequesterT t request response m a # mappend :: RequesterT t request response m a -> RequesterT t request response m a -> RequesterT t request response m a # mconcat :: [RequesterT t request response m a] -> RequesterT t request response m a # | |
(Semigroup a, Monad m) => Semigroup (RequesterT t request response m a) Source # | |
Defined in Reflex.Requester.Base.Internal (<>) :: RequesterT t request response m a -> RequesterT t request response m a -> RequesterT t request response m a # sconcat :: NonEmpty (RequesterT t request response m a) -> RequesterT t request response m a # stimes :: Integral b => b -> RequesterT t request response m a -> RequesterT t request response m a # | |
type PrimState (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal | |
type Ref (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal | |
type Performable (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal | |
type Request (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal | |
type Response (RequesterT t request response m) Source # | |
Defined in Reflex.Requester.Base.Internal |
runRequesterT :: (Reflex t, Monad m) => RequesterT t request response m a -> Event t (RequesterData response) -> m (a, Event t (RequesterData request)) Source #
Run a RequesterT
action. The resulting Event
will fire whenever
requests are made, and responses should be provided in the input Event
.
The Tag
keys will be used to return the responses to the same place the
requests were issued.
:: (Reflex t, MonadFix m) | |
=> (forall x. req x -> req' x) | The function to map over the request |
-> (forall x. rsp' x -> rsp x) | The function to map over the response |
-> RequesterT t req rsp m a | The internal |
-> RequesterT t req' rsp' m a | The resulting |
Map a function over the request and response of a RequesterT
tagRequest :: forall m x t request response. (Monad m, MyTagTypeOffset x) => Event t (Entry request x) -> RequesterT t request response m (MyTagWrap request (Entry request x)) Source #
responseFromTag :: forall m t request response x. Monad m => MyTagWrap response (Entry response x) -> RequesterT t request response m (Event t (Entry response x)) Source #
requesting' :: (MyTagTypeOffset x, Monad m) => Event t (Entry request x) -> RequesterT t request response m (Event t (Entry response x)) Source #
runWithReplaceRequesterTWith :: forall m t request response a b. (Reflex t, MonadHold t m, MonadFix m) => (forall a' b'. m a' -> Event t (m b') -> RequesterT t request response m (a', Event t b')) -> RequesterT t request response m a -> Event t (RequesterT t request response m b) -> RequesterT t request response m (a, Event t b) Source #
traverseIntMapWithKeyWithAdjustRequesterTWith :: forall t request response m v v' p. (Reflex t, MonadHold t m, PatchTarget (p (Event t (IntMap (RequesterData request)))) ~ IntMap (Event t (IntMap (RequesterData request))), Patch (p (Event t (IntMap (RequesterData request)))), Functor p, MonadFix m) => ((Key -> (Key, v) -> m (Event t (IntMap (RequesterData request)), v')) -> IntMap (Key, v) -> Event t (p (Key, v)) -> RequesterT t request response m (IntMap (Event t (IntMap (RequesterData request)), v'), Event t (p (Event t (IntMap (RequesterData request)), v')))) -> (p (Event t (IntMap (RequesterData request))) -> IntMap (Event t (IntMap (RequesterData request)))) -> (Incremental t (p (Event t (IntMap (RequesterData request)))) -> Event t (IntMap (IntMap (RequesterData request)))) -> (Key -> v -> RequesterT t request response m v') -> IntMap v -> Event t (p v) -> RequesterT t request response m (IntMap v', Event t (p v')) Source #
traverseDMapWithKeyWithAdjustRequesterTWith :: forall k t request response m v v' p p'. (GCompare k, Reflex t, MonadHold t m, PatchTarget (p' (Some k) (Event t (IntMap (RequesterData request)))) ~ Map (Some k) (Event t (IntMap (RequesterData request))), Patch (p' (Some k) (Event t (IntMap (RequesterData request)))), MonadFix m) => (forall k' v1 v2. GCompare k' => (forall a. k' a -> v1 a -> m (v2 a)) -> DMap k' v1 -> Event t (p k' v1) -> RequesterT t request response m (DMap k' v2, Event t (p k' v2))) -> (forall v1 v2. (forall a. v1 a -> v2 a) -> p k v1 -> p k v2) -> (forall v1 v2. (forall a. v1 a -> v2) -> p k v1 -> p' (Some k) v2) -> (forall v2. p' (Some k) v2 -> Map (Some k) v2) -> (forall a. Incremental t (p' (Some k) (Event t a)) -> Event t (Map (Some k) a)) -> (forall a. k a -> v a -> RequesterT t request response m (v' a)) -> DMap k v -> Event t (p k v) -> RequesterT t request response m (DMap k v', Event t (p k v')) Source #
data Decoder rawResponse response Source #
forall a. Decoder (RequesterDataKey a) (rawResponse -> response a) |
matchResponsesWithRequests Source #
:: forall t rawRequest rawResponse request response m. (MonadFix m, MonadHold t m, Reflex t) | |
=> (forall a. request a -> (rawRequest, rawResponse -> response a)) | Given a request (from |
-> Event t (RequesterData request) | The outgoing requests |
-> Event t (Int, rawResponse) | The incoming responses, tagged by an identifying key |
-> m (Event t (Map Int rawRequest), Event t (RequesterData response)) | A map of outgoing wire-format requests and an event of responses keyed
by the |
matchResponseMapWithRequests Source #
:: forall t rawRequest rawResponse request response m. (MonadFix m, MonadHold t m, Reflex t) | |
=> (forall a. request a -> (rawRequest, rawResponse -> response a)) | Given a request (from |
-> Event t (RequesterData request) | The outgoing requests |
-> Event t (Map Int rawResponse) | A map of incoming responses, tagged by an identifying key |
-> m (Event t (Map Int rawRequest), Event t (RequesterData response)) | A map of outgoing wire-format requests and an event of responses keyed
by the |
Matches incoming responses with previously-sent requests and uses the provided request "decoder" function to process incoming responses.