Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Pagination = Pagination {}
- newtype PageIndex = PageIndex {
- getPageIndex :: Word
- newtype PageSize = PageSize {
- getPageSize :: Word
- newtype ResourceCount = ResourceCount {}
- data Strategy
- mkPaginationLinks :: Strategy -> URL -> Pagination -> Links
Documentation
data Pagination Source #
Wrapper type for the various components of pagination being page size, page index and the number of resources in total.
We can specify limits on the number of rows we would like back from the database
newtype ResourceCount Source #
Instances
Show ResourceCount Source # | |
Defined in Network.JSONApi.Pagination showsPrec :: Int -> ResourceCount -> ShowS # show :: ResourceCount -> String # showList :: [ResourceCount] -> ShowS # |
Pagination strategies are commonly implemented by the server of which Page and Offset are commonly used.
mkPaginationLinks :: Strategy -> URL -> Pagination -> Links Source #
Helper function to build relative links for a collection of resources of type ResourceEntity.
This helper function assumes that the first page is always page 0.