Safe Haskell | None |
---|---|
Language | Haskell2010 |
Classes for encoding and decoding
class URIEncode a where Source
Determines a Text
serialization of a type with URI segment
representation.
class URIDecode a where Source
Parses a Text
serialization of a for some type from a representation
as a URI segment.
Extra serialization utilities
uriDecodeBS :: URIDecode a => ByteString -> Either String a Source
Since URIDecode
assumes a Text
-like representation but we may read
a ByteString
off the wire, this helper function first tries to
decode the ByteString
as UTF-8 Text
then decodes according to
URIDecode
.