-- 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.6


-- | 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 &lt;0.10</tt></li>
--   <li><a>.:!</a> works as <a>.:?</a> 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
data Encoding :: *
fromEncoding :: Encoding -> Builder
type Array = Vector Value
type Object = HashMap Text Value
newtype DotNetTime :: *
DotNetTime :: UTCTime -> DotNetTime
[fromDotNetTime] :: DotNetTime -> UTCTime
class FromJSON a
parseJSON :: 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
class KeyValue kv
(.=) :: (KeyValue kv, ToJSON v) => Text -> v -> kv
class GFromJSON (f :: * -> *)
gParseJSON :: GFromJSON f => Options -> Value -> Parser (f a)
class GToJSON (f :: * -> *)
gToJSON :: GToJSON f => Options -> f a -> Value
class GToEncoding (f :: * -> *)
gToEncoding :: GToEncoding f => Options -> f a -> Encoding
genericToJSON :: (Generic a, GToJSON (Rep a)) => Options -> a -> Value
genericToEncoding :: (Generic a, GToEncoding (Rep a)) => Options -> a -> Encoding
genericParseJSON :: (Generic a, GFromJSON (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
withNumber :: String -> (Number -> Parser a) -> Value -> Parser a
withScientific :: String -> (Scientific -> Parser a) -> Value -> Parser a
withBool :: String -> (Bool -> 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>Object</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)
(.:!) :: 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.Exception Data.Aeson.Compat.AesonException
