reflex-0.5: Higher-order Functional Reactive Programming

Safe HaskellNone
LanguageHaskell98

Reflex.Requester.Base

Description

This module provides RequesterT, the standard implementation of Requester.

Synopsis

Documentation

newtype RequesterT t request (response :: * -> *) m a Source #

A basic implementation of Requester.

Constructors

RequesterT 

Fields

Instances
MonadReader r m => MonadReader r (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

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 #

MonadReflexCreateTrigger t m => MonadReflexCreateTrigger t (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

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 #

(Reflex t, Adjustable t m, MonadHold t m, MonadFix m) => Adjustable t (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

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 #

PostBuild t m => PostBuild t (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

getPostBuild :: RequesterT t request response m (Event t ()) Source #

(Reflex t, Monad m) => Requester t (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Associated Types

type Request (RequesterT t request response m) :: * -> * Source #

type Response (RequesterT t request response m) :: * -> * Source #

Methods

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 # 
Instance details

Defined in Reflex.Requester.Base

Methods

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 #

PerformEvent t m => PerformEvent t (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Associated Types

type Performable (RequesterT t request response m) :: * -> * Source #

Methods

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 #

NotReady t m => NotReady t (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.NotReady.Class

Methods

notReadyUntil :: Event t a -> RequesterT t request response m () Source #

notReady :: RequesterT t request response m () Source #

MonadHold t m => MonadHold (t :: *) (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

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 #

MonadSample t m => MonadSample (t :: *) (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

sample :: Behavior t a -> RequesterT t request response m a Source #

MonadTrans (RequesterT t request response) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

lift :: Monad m => m a -> RequesterT t request response m a #

Monad m => Monad (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

(>>=) :: 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 #

fail :: String -> RequesterT t request response m a #

Functor m => Functor (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

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 #

MonadFix m => MonadFix (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

mfix :: (a -> RequesterT t request response m a) -> RequesterT t request response m a #

Monad m => Applicative (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

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 #

MonadIO m => MonadIO (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

liftIO :: IO a -> RequesterT t request response m a #

MonadException m => MonadException (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

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 #

MonadAsyncException m => MonadAsyncException (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

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 #

MonadRef m => MonadRef (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Associated Types

type Ref (RequesterT t request response m) :: * -> * #

Methods

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 () #

(Semigroup a, Monad m) => Semigroup (RequesterT t request response m a) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

(<>) :: 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 #

(Monoid a, Monad m) => Monoid (RequesterT t request response m a) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

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 #

type Ref (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

type Ref (RequesterT t request response m) = Ref m
type Request (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

type Request (RequesterT t request response m) = request
type Response (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

type Response (RequesterT t request response m) = response
type Performable (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

type Performable (RequesterT t request response m) = Performable m

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.

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 #

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