Safe Haskell | None |
---|---|
Language | Haskell2010 |
Serv.ContentType
- class HasMediaType ty where
- class HasMediaType ty => MimeEncode ty val where
- class HasMediaType ty => MimeDecode ty val where
- (//) :: ByteString -> ByteString -> MediaType
- (/:) :: MediaType -> (ByteString, ByteString) -> MediaType
- data TextPlain
- data JSON
Documentation
class HasMediaType ty => MimeEncode ty val where Source #
Minimal complete definition
Methods
mimeEncode :: Proxy ty -> val -> ByteString Source #
class HasMediaType ty => MimeDecode ty val where Source #
Minimal complete definition
Methods
mimeDecode :: Proxy ty -> ByteString -> Either String val Source #
(//) :: ByteString -> ByteString -> MediaType #
Builds a MediaType
without parameters. Can produce an error if
either type is invalid.
(/:) :: MediaType -> (ByteString, ByteString) -> MediaType #
Adds a parameter to a MediaType
. Can produce an error if either
string is invalid.