| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Reflex.Requester.Class
Description
This module defines Requester, which indicates that an action can make
requests and receive responses to them. Typically, this is used for things
like a WebSocket, where it's desirable to collect many potential sources of
events and send them over a single channel, then distribute the results back
out efficiently to their original request sites.
Documentation
class (Reflex t, Monad m) => Requester t (m :: Type -> Type) | m -> t where Source #
A Requester action can trigger requests of type Request m a based on
Events, and receive responses of type Response m a in return. Note that
the a type can vary within the Requester action, but will be linked for a
given request. For example, if Request m is IO and Response m is
Identity, then requestingIdentity has the same type as
performEvent.
Associated Types
type Request (m :: Type -> Type) :: Type -> Type Source #
The type of requests that this Requester can emit
type Response (m :: Type -> Type) :: Type -> Type Source #
The type of responses that this Requester can receive
Methods
requesting :: Event t (Request m a) -> m (Event t (Response m a)) Source #
requesting_ :: Event t (Request m a) -> m () Source #
Emit a request whenever the given Event fires, and ignore all responses.