Safe Haskell | None |
---|---|
Language | Haskell2010 |
Manual construction of sorting spec.
Synopsis
- data SortingRequestItem (provided :: [TyNamedParam *])
- asc :: forall name provided. (KnownSymbol name, KnownTypeName provided name provided) => NameLabel name -> SortingRequestItem provided
- desc :: forall name provided. (KnownSymbol name, KnownTypeName provided name provided) => NameLabel name -> SortingRequestItem provided
- mkSortingSpec :: ReifySortingItems base => [SortingRequestItem provided] -> SortingSpec provided base
- noSorting :: ReifySortingItems base => SortingSpec provided base
Documentation
data SortingRequestItem (provided :: [TyNamedParam *]) Source #
Helper for defining custom SortingSpec
s,
contains SortingItem
corresponding to one of parameter in provided
list.
Instances
Show (SortingRequestItem provided) Source # | |
Defined in Servant.Util.Combinators.Sorting.Construction showsPrec :: Int -> SortingRequestItem provided -> ShowS # show :: SortingRequestItem provided -> String # showList :: [SortingRequestItem provided] -> ShowS # |
asc :: forall name provided. (KnownSymbol name, KnownTypeName provided name provided) => NameLabel name -> SortingRequestItem provided Source #
Ascendant sorting on a field with given name.
desc :: forall name provided. (KnownSymbol name, KnownTypeName provided name provided) => NameLabel name -> SortingRequestItem provided Source #
Ascendant sorting on a field with given name.
mkSortingSpec :: ReifySortingItems base => [SortingRequestItem provided] -> SortingSpec provided base Source #
Make a sorting specification. Specified list should contain sorting on distinct fields; we do not enforce this at type-level for convenience.
Example:
-- sortingSpec :: SortingSpec ["id" ?: Int, "desc" ?: Text] sortingSpec = mkSortingSpec [asc #id]
noSorting :: ReifySortingItems base => SortingSpec provided base Source #
Do not specify ordering.
Orphan instances
ReifySortingItems base => IsList (SortingSpec provided base) Source # | Instance for |
type Item (SortingSpec provided base) # fromList :: [Item (SortingSpec provided base)] -> SortingSpec provided base # fromListN :: Int -> [Item (SortingSpec provided base)] -> SortingSpec provided base # toList :: SortingSpec provided base -> [Item (SortingSpec provided base)] # | |
ReifySortingItems base => Default (SortingSpec provided base) Source # | By default |
def :: SortingSpec provided base # |