slack-web-1.5.0.0: Bindings for the Slack web API
Safe HaskellSafe-Inferred
LanguageHaskell2010

Web.Slack.Pager

Synopsis

Documentation

type LoadPage m a = m (Response [a]) Source #

Represents an action which returns a paginated response from Slack. Every time calling the action, it performs a request with a new cursor to get the next page. If there is no more response, the action returns an empty list.

loadingPage :: (Monad m, Monoid n) => LoadPage m a -> (Response [a] -> m n) -> m n Source #

Utility function for LoadPage. Perform the LoadPage action to call the function with the loaded page, until an empty page is loaded.

fetchAllBy :: (MonadIO m, PagedRequest req, PagedResponse resp) => (req -> m (Response resp)) -> req -> m (LoadPage m (ResponseObject resp)) Source #