Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- withPageLink :: (MonadHandler m, ToJSON position, FromJSON position, RenderRoute (HandlerSite m)) => Int -> (a -> position) -> (Cursor position -> m [a]) -> m [a]
- withPage :: (MonadHandler m, ToJSON position, FromJSON position, RenderRoute (HandlerSite m)) => Int -> (a -> position) -> (Cursor position -> m [a]) -> m (Page a)
- data Page a = Page {}
- data Cursor position = Cursor {
- cursorRoute :: RenderedRoute
- cursorPosition :: Position position
- cursorLimit :: Limit
- data Position position
- data Limit
- unLimit :: Limit -> Int
Documentation
:: (MonadHandler m, ToJSON position, FromJSON position, RenderRoute (HandlerSite m)) | |
=> Int | Default limit if not specified in the Must be a positive natural number. |
-> (a -> position) | How to get an item's position For example, this would be |
-> (Cursor position -> m [a]) | How to fetch one page of data at the given |
-> m [a] |
and adding pagination data to a withPage
Link
response header
:: (MonadHandler m, ToJSON position, FromJSON position, RenderRoute (HandlerSite m)) | |
=> Int | Default limit if not specified in the Must be a positive natural number. |
-> (a -> position) | How to get an item's position For example, this would be |
-> (Cursor position -> m [a]) | How to fetch one page of data at the given |
-> m (Page a) |
Page | |
|
An encoding of the position in a page
A Cursor encodes all necessary information to determine the position in a specific page.
Cursor | |
|