help-esb-0.1.3: A Haskell client for the Help.com team's ESB.

Safe HaskellNone
LanguageHaskell98

JSON.Login.Response

Synopsis

Documentation

data Meta Source

Constructors

Meta 

Fields

h_type :: Text
 
h_id :: [Char]
 
h_source :: Text
 
h_replyTo :: Text
 
h_result :: Text
 

data Data Source

Constructors

Data 

data Message Source

Constructors

Message 

Fields

h_meta :: Meta
 
h_data :: Data
 

Instances

encode :: ToJSON a => a -> ByteString

Efficiently serialize a JSON value as a lazy ByteString.

decode :: FromJSON a => ByteString -> Maybe a

Efficiently deserialize a JSON value from a lazy ByteString. If this fails due to incomplete or invalid input, Nothing is returned.

The input must consist solely of a JSON document, with no trailing data except for whitespace. This restriction is necessary to ensure that if data is being lazily read from a file handle, the file handle will be closed in a timely fashion once the document has been parsed.

This function parses immediately, but defers conversion. See json for details.

eitherDecode :: FromJSON a => ByteString -> Either String a

Like decode but returns an error message when decoding fails.