Safe Haskell | Safe-Infered |
---|
This module exports the Filter type used to create read and facet queries.
- type Field = String
- data Filter
- = EqualNum Field Double
- | EqualStr Field String
- | NotEqualNum Field Double
- | NotEqualStr Field String
- | InNumList Field [Double]
- | InStrList Field [String]
- | NotInNumList Field [Double]
- | NotInStrList Field [String]
- | BeginsWith Field String
- | NotBeginsWith Field String
- | BeginsWithAny Field [String]
- | NotBeginsWithAny Field [String]
- | IsBlank Field
- | IsNotBlank Field
- | And [Filter]
- | Or [Filter]
- filtersString :: [Filter] -> String
Filter type
The Filter type is used to represent various filters in a read or facets query.
EqualNum Field Double | A numeric field has to match a number exactly. |
EqualStr Field String | A string field has to match a string exactly. |
NotEqualNum Field Double | A numeric field must equal a specific number. |
NotEqualStr Field String | A string field must equal a specific string. |
InNumList Field [Double] | A numeric field must be equal to any of the numbers in a list. |
InStrList Field [String] | A string field must be equal to any of the strings in a list. |
NotInNumList Field [Double] | A numeric field must not be equal to any of the numbers in a list. |
NotInStrList Field [String] | A string field must not be equal to any of the strings in a list. |
BeginsWith Field String | A string field must begin with a specific string. |
NotBeginsWith Field String | A string field must not begin with a specific string. |
BeginsWithAny Field [String] | A string field must begin with any of the strings in a list. |
NotBeginsWithAny Field [String] | A string field must not begin with any of the strings in a list. |
IsBlank Field | A field must be blank. |
IsNotBlank Field | A field must not be blank. |
And [Filter] | Form an AND condition with the filters in the list. |
Or [Filter] | Form an OR condition with the filters in the list. |
Helper functions
filtersString :: [Filter] -> StringSource