Safe Haskell | None |
---|---|
Language | Haskell2010 |
Network.JSONApi.Pagination
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.
Constructors
Pagination | |
Constructors
PageIndex | |
Fields
|
We can specify limits on the number of rows we would like back from the database
Constructors
PageSize | |
Fields
|
newtype ResourceCount Source #
Constructors
ResourceCount | |
Fields |
Instances
Show ResourceCount Source # | |
Defined in Network.JSONApi.Pagination Methods 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.
Constructors
PageStrategy | |
OffsetStrategy |
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.