-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Compatibility layer for aeson
--   
--   Compatibility layer for <tt>aeson</tt>
@package aeson-compat
@version 0.3.10


-- | Compatibility notices
--   
--   <ul>
--   <li><a>decode</a> etc. work as in <tt>aeson &gt;=0.9</tt></li>
--   <li>but it is generalised to work in any <a>MonadThrow</a> (that is
--   extra)</li>
--   <li><a>.:?</a> works as in <tt>aeson <a>||</a>=0.11</tt></li>
--   <li><a>.:!</a> works as in <tt>aeson <a>||</a>=0.11</tt> and as
--   <a>.:?</a> did in <tt>aeson ==0.10.*</tt></li>
--   <li>Orphan instances <a>FromJSON</a> <tt>Day</tt> and <a>FromJSON</a>
--   <tt>LocalTime</tt> for <tt>aeson &lt;0.10</tt></li>
--   <li><a>Encoding</a> related functionality is not added. It's present
--   only with <tt>aeson &gt;=0.10</tt></li>
--   </ul>
module Data.Aeson.Compat

-- | Like original <a>decode</a> but in arbitrary <a>MonadThrow</a>.
--   
--   Parse a top-level JSON value, i.e. also strings, numbers etc.
decode :: (FromJSON a, MonadThrow m) => ByteString -> m a

-- | Like original <a>decode'</a> but in arbitrary <a>MonadThrow</a>.
decode' :: (FromJSON a, MonadThrow m) => ByteString -> m a

-- | Exception thrown by <a>decode</a> - family of functions in this
--   module.
newtype AesonException
AesonException :: String -> AesonException
eitherDecode :: FromJSON a => ByteString -> Either String a
eitherDecode' :: FromJSON a => ByteString -> Either String a
encode :: ToJSON a => a -> ByteString

-- | Like original <a>decodeStrict</a> but in arbitrary <a>MonadThrow</a>.
decodeStrict :: (FromJSON a, MonadThrow m) => ByteString -> m a

-- | Like original <a>decodeStrict'</a> but in arbitrary <a>MonadThrow</a>.
decodeStrict' :: (FromJSON a, MonadThrow m) => ByteString -> m a
eitherDecodeStrict :: FromJSON a => ByteString -> Either String a
eitherDecodeStrict' :: FromJSON a => ByteString -> Either String a
data () => Value
Object :: !Object -> Value
Array :: !Array -> Value
String :: !Text -> Value
Number :: !Scientific -> Value
Bool :: !Bool -> Value
Null :: Value
type Encoding = Encoding' Value
fromEncoding :: Encoding' tag -> Builder
type Array = Vector Value
type Object = KeyMap Value
newtype () => DotNetTime
DotNetTime :: UTCTime -> DotNetTime
[fromDotNetTime] :: DotNetTime -> UTCTime
class () => FromJSON a
parseJSON :: FromJSON a => Value -> Parser a
parseJSONList :: FromJSON a => Value -> Parser [a]
data () => Result a
Error :: String -> Result a
Success :: a -> Result a
fromJSON :: FromJSON a => Value -> Result a
class () => ToJSON a
toJSON :: ToJSON a => a -> Value
toEncoding :: ToJSON a => a -> Encoding
toJSONList :: ToJSON a => [a] -> Value
toEncodingList :: ToJSON a => [a] -> Encoding
class () => KeyValue kv
(.=) :: (KeyValue kv, ToJSON v) => Key -> v -> kv
class () => GFromJSON arity (f :: Type -> Type)
type GToJSON = GToJSON' Value
type GToEncoding = GToJSON' Encoding
genericToJSON :: (Generic a, GToJSON' Value Zero (Rep a)) => Options -> a -> Value
genericToEncoding :: (Generic a, GToJSON' Encoding Zero (Rep a)) => Options -> a -> Encoding
genericParseJSON :: (Generic a, GFromJSON Zero (Rep a)) => Options -> Value -> Parser a
defaultOptions :: Options
withObject :: String -> (Object -> Parser a) -> Value -> Parser a
withText :: String -> (Text -> Parser a) -> Value -> Parser a
withArray :: String -> (Array -> Parser a) -> Value -> Parser a

-- | <tt><a>withNumber</a> expected f value</tt> applies <tt>f</tt> to the
--   <a>Number</a> when <tt>value</tt> is a <a>Number</a> and fails using
--   <tt><a>typeMismatch</a> expected</tt> otherwise.

-- | <i>Deprecated: Use withScientific instead</i>
withNumber :: String -> (Number -> Parser a) -> Value -> Parser a
withScientific :: String -> (Scientific -> Parser a) -> Value -> Parser a
withBool :: String -> (Bool -> Parser a) -> Value -> Parser a
withEmbeddedJSON :: String -> (Value -> Parser a) -> Value -> Parser a
data () => Series
pairs :: Series -> Encoding
foldable :: (Foldable t, ToJSON a) => t a -> Encoding
(.:) :: FromJSON a => Object -> Text -> Parser a

-- | Retrieve the value associated with the given key of an <a>Value</a>.
--   The result is <a>Nothing</a> if the key is not present, or
--   <a>empty</a> if the value cannot be converted to the desired type.
--   
--   This accessor is most useful if the key and value can be absent from
--   an object without affecting its validity. If the key and value are
--   mandatory, use <a>.:</a> instead.
--   
--   This operator is consistent in <tt>aeson &gt;=0.7 &amp;&amp;
--   &lt;0.11</tt>
(.:?) :: FromJSON a => Object -> Text -> Parser (Maybe a)

-- | Like <a>.:?</a>, but the resulting parser will fail, if the key is
--   present but is <a>Null</a>.
(.:!) :: FromJSON a => Object -> Text -> Parser (Maybe a)
(.!=) :: Parser (Maybe a) -> a -> Parser a
object :: [Pair] -> Value
json :: Parser Value
json' :: Parser Value
value :: Parser Value
value' :: Parser Value
data () => Parser a
instance GHC.Show.Show Data.Aeson.Compat.AesonException
instance GHC.Exception.Type.Exception Data.Aeson.Compat.AesonException
