Safe Haskell | None |
---|
Combinators for specifying the input/output dictionaries of a
Handler
. The combinators can be combined using (
.
)
.
- someI :: Dict h p () o e -> Dict h p i o e
- stringI :: Dict h p i o e -> Dict h p String o e
- xmlTextI :: Dict h p i o e -> Dict h p Text o e
- fileI :: Dict h p i o e -> Dict h p ByteString o e
- readI :: (Info i, Read i, Show i) => Dict h p i o e -> Dict h p i o e
- xmlI :: (Typeable i, XmlPickler i) => Dict h p i o e -> Dict h p i o e
- rawXmlI :: Dict h p i o e -> Dict h p ByteString o e
- jsonI :: (Typeable i, FromJSON i, JSONSchema i) => Dict h p i o e -> Dict h p i o e
- someO :: Dict h p i () e -> Dict h p i o e
- stringO :: Dict h p i () e -> Dict h p i String e
- fileO :: Dict h p i o e -> Dict h p i (ByteString, String) e
- xmlO :: (Typeable o, XmlPickler o) => Dict h p i o e -> Dict h p i o e
- rawXmlO :: Dict h p i () e -> Dict h p i ByteString e
- jsonO :: (Typeable o, ToJSON o, JSONSchema o) => Dict h p i o e -> Dict h p i o e
- multipartO :: Dict h p i () e -> Dict h p i [BodyPart] e
- someE :: (Typeable e, ToJSON e, JSONSchema e) => Dict h p i o () -> Dict h p i o e
- jsonE :: (ToResponseCode e, Typeable e, ToJSON e, JSONSchema e) => Dict h p i o e -> Dict h p i o e
- xmlE :: (ToResponseCode e, Typeable e, XmlPickler e) => Dict h p i o e -> Dict h p i o e
- xmlJsonI :: (Typeable i, FromJSON i, JSONSchema i, XmlPickler i) => Dict h p () o e -> Dict h p i o e
- xmlJsonO :: (Typeable o, ToJSON o, JSONSchema o, XmlPickler o) => Dict h p i () e -> Dict h p i o e
- xmlJsonE :: (ToResponseCode e, Typeable e, ToJSON e, JSONSchema e, XmlPickler e) => Dict h p i o () -> Dict h p i o e
- xmlJson :: (Typeable i, FromJSON i, JSONSchema i, XmlPickler i, Typeable o, ToJSON o, JSONSchema o, XmlPickler o) => Dict h p () () e -> Dict h p i o e
- mkHeader :: Header h -> Dict x p i o e -> Dict h p i o e
- addHeader :: Header h -> Dict h' p i o e -> Dict (h, h') p i o e
- mkPar :: Param p -> Dict h x i o e -> Dict h p i o e
- addPar :: Param p -> Dict h p' i o e -> Dict h (p, p') i o e
Input dictionaries
someI :: Dict h p () o e -> Dict h p i o eSource
Open up input type for extension with custom dictionaries.
xmlTextI :: Dict h p i o e -> Dict h p Text o eSource
Allow direct usage of as input as raw Xml Text
.
fileI :: Dict h p i o e -> Dict h p ByteString o eSource
Allow usage of input as file contents, represented as a ByteString
.
readI :: (Info i, Read i, Show i) => Dict h p i o e -> Dict h p i o eSource
The input can be read into some instance of Read
. For inspection reasons
the type must also be an instance of both Info
and Show
.
xmlI :: (Typeable i, XmlPickler i) => Dict h p i o e -> Dict h p i o eSource
The input can be read into some instance of XmlPickler
.
rawXmlI :: Dict h p i o e -> Dict h p ByteString o eSource
The input can be used as an XML ByteString
.
jsonI :: (Typeable i, FromJSON i, JSONSchema i) => Dict h p i o e -> Dict h p i o eSource
The input can be read into some instance of Json
.
Output dictionaries
someO :: Dict h p i () e -> Dict h p i o eSource
Open up output type for extension with custom dictionaries.
fileO :: Dict h p i o e -> Dict h p i (ByteString, String) eSource
Allow file output using a combination of the raw data and a mime type.
xmlO :: (Typeable o, XmlPickler o) => Dict h p i o e -> Dict h p i o eSource
Allow output as XML using the XmlPickler
type class.
rawXmlO :: Dict h p i () e -> Dict h p i ByteString eSource
Allow output as raw XML represented as a ByteString
.
jsonO :: (Typeable o, ToJSON o, JSONSchema o) => Dict h p i o e -> Dict h p i o eSource
Allow output as JSON using the Json
type class.
multipartO :: Dict h p i () e -> Dict h p i [BodyPart] eSource
Allow output as multipart. Writes out the ByteStrings separated by boundaries, with content type 'multipart/mixed'.
Error dictionaries
someE :: (Typeable e, ToJSON e, JSONSchema e) => Dict h p i o () -> Dict h p i o eSource
Open up error type for extension with custom dictionaries.
jsonE :: (ToResponseCode e, Typeable e, ToJSON e, JSONSchema e) => Dict h p i o e -> Dict h p i o eSource
Allow error output as JSON using the Json
type class.
xmlE :: (ToResponseCode e, Typeable e, XmlPickler e) => Dict h p i o e -> Dict h p i o eSource
Allow error output as XML using the XmlPickler
type class.
Composed dictionaries
xmlJsonI :: (Typeable i, FromJSON i, JSONSchema i, XmlPickler i) => Dict h p () o e -> Dict h p i o eSource
The input can be read into some instance of both Json
and XmlPickler
.
xmlJsonO :: (Typeable o, ToJSON o, JSONSchema o, XmlPickler o) => Dict h p i () e -> Dict h p i o eSource
Allow output as JSON using the Json
type class and allow output as XML
using the XmlPickler
type class.
xmlJsonE :: (ToResponseCode e, Typeable e, ToJSON e, JSONSchema e, XmlPickler e) => Dict h p i o () -> Dict h p i o eSource
Allow error output as JSON using the Json
type class and allow output as
XML using the XmlPickler
type class.
xmlJson :: (Typeable i, FromJSON i, JSONSchema i, XmlPickler i, Typeable o, ToJSON o, JSONSchema o, XmlPickler o) => Dict h p () () e -> Dict h p i o eSource
The input can be read into some instance of both Json
and XmlPickler
and allow output as JSON using the Json
type class and allow output as XML
using the XmlPickler
type class.
Header dictionaries
mkHeader :: Header h -> Dict x p i o e -> Dict h p i o eSource
Set custom sub-dictionary for recognizing headers.
addHeader :: Header h -> Dict h' p i o e -> Dict (h, h') p i o eSource
Add custom sub-dictionary for recognizing headers.