slack-web-0.3.0.1: Bindings for the Slack web API
Safe HaskellNone
LanguageHaskell2010

Web.Slack.Pager

Synopsis

Documentation

conversationsHistoryAllBy Source #

Arguments

:: MonadIO m 
=> (HistoryReq -> m (Response HistoryRsp))

Response generator

-> HistoryReq

The first request to send. _NOTE_: historyReqCursor is silently ignored.

-> m (LoadPage m Message)

An action which returns a new page of messages every time called. If there are no pages anymore, it returns an empty list.

Public only for testing.

repliesFetchAllBy Source #

Arguments

:: MonadIO m 
=> (RepliesReq -> m (Response HistoryRsp))

Response generator

-> RepliesReq

The first request to send. _NOTE_: historyReqCursor is silently ignored.

-> m (LoadPage m Message)

An action which returns a new page of messages every time called. If there are no pages anymore, it returns an empty list.

Public only for testing.

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.