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

-- | Extra goodies for aeson
--   
--   Package provides extra functionality on top of aeson and
--   aeson-compat
@package aeson-extra
@version 0.4.1.3

module Data.Aeson.Extra.CollapsedList

-- | Collapsed list, singleton is represented as the value itself in JSON
--   encoding.
--   
--   
--   λ > decode "null" :: Maybe (CollapsedList [Int] Int)
--   Just (CollapsedList [])
--   λ > decode "42" :: Maybe (CollapsedList [Int] Int)
--   Just (CollapsedList [42])
--   λ > decode "[1, 2, 3]" :: Maybe (CollapsedList [Int] Int)
--   Just (CollapsedList [1,2,3])
--   
--   
--   
--   λ > encode (CollapsedList ([] :: [Int]))
--   "null"
--   λ > encode (CollapsedList ([42] :: [Int]))
--   "42"
--   λ > encode (CollapsedList ([1, 2, 3] :: [Int]))
--   "[1,2,3]"
--   
--   
--   Documentation rely on f Alternative instance behaving
--   like lists'.
newtype CollapsedList f a
CollapsedList :: f a -> CollapsedList f a
getCollapsedList :: CollapsedList f a -> f a

-- | Parses possibly collapsed array value from the object's field.
--   
--   
--   λ > newtype V = V [Int] deriving (Show)
--   λ > instance FromJSON V where parseJSON = withObject "V" $ \obj -> V <$> parseCollapsedList obj "value"
--   λ > decode "{}" :: Maybe V
--   Just (V [])
--   λ > decode "{\"value\": null}" :: Maybe V
--   Just (V [])
--   λ > decode "{\"value\": 42}" :: Maybe V
--   Just (V [42])
--   λ > decode "{\"value\": [1, 2, 3, 4]}" :: Maybe V
--   Just (V [1,2,3,4])
--   
parseCollapsedList :: (FromJSON a, FromJSON1 f, Alternative f) => Object -> Text -> Parser (f a)
instance Data.Traversable.Traversable f => Data.Traversable.Traversable (Data.Aeson.Extra.CollapsedList.CollapsedList f)
instance Data.Foldable.Foldable f => Data.Foldable.Foldable (Data.Aeson.Extra.CollapsedList.CollapsedList f)
instance GHC.Base.Functor f => GHC.Base.Functor (Data.Aeson.Extra.CollapsedList.CollapsedList f)
instance GHC.Read.Read (f a) => GHC.Read.Read (Data.Aeson.Extra.CollapsedList.CollapsedList f a)
instance GHC.Show.Show (f a) => GHC.Show.Show (Data.Aeson.Extra.CollapsedList.CollapsedList f a)
instance GHC.Classes.Ord (f a) => GHC.Classes.Ord (Data.Aeson.Extra.CollapsedList.CollapsedList f a)
instance GHC.Classes.Eq (f a) => GHC.Classes.Eq (Data.Aeson.Extra.CollapsedList.CollapsedList f a)
instance (Data.Aeson.Types.FromJSON.FromJSON1 f, GHC.Base.Alternative f) => Data.Aeson.Types.FromJSON.FromJSON1 (Data.Aeson.Extra.CollapsedList.CollapsedList f)
instance (Data.Aeson.Types.ToJSON.ToJSON1 f, Data.Foldable.Foldable f) => Data.Aeson.Types.ToJSON.ToJSON1 (Data.Aeson.Extra.CollapsedList.CollapsedList f)
instance (Data.Aeson.Types.ToJSON.ToJSON1 f, Data.Foldable.Foldable f, Data.Aeson.Types.ToJSON.ToJSON a) => Data.Aeson.Types.ToJSON.ToJSON (Data.Aeson.Extra.CollapsedList.CollapsedList f a)
instance (Data.Aeson.Types.FromJSON.FromJSON1 f, GHC.Base.Alternative f, Data.Aeson.Types.FromJSON.FromJSON a) => Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extra.CollapsedList.CollapsedList f a)

-- | More or less useful newtypes for writing FromJSON &
--   ToJSON instances

-- | Deprecated: Use aeson-1 TOJSONKey etc functionality
module Data.Aeson.Extra.Map

-- | A wrapper type to parse arbitrary maps
--   
--   
--   λ > decode "{\"1\": 1, \"2\": 2}" :: Maybe (M (H.HashMap Int Int))
--   Just (M {getMap = fromList [(1,1),(2,2)]})
--   
newtype M a
M :: a -> M a
[getMap] :: M a -> a
class FromJSONKey a
parseJSONKey :: FromJSONKey a => Text -> Parser a
parseIntegralJSONKey :: Integral a => Text -> Parser a
class FromJSONMap m k v | m -> k v
parseJSONMap :: FromJSONMap m k v => HashMap Text Value -> Parser m
class ToJSONKey a
toJSONKey :: ToJSONKey a => a -> Text
class ToJSONMap m k v | m -> k v
toJSONMap :: ToJSONMap m k v => m -> HashMap Text Value
instance Data.Traversable.Traversable Data.Aeson.Extra.Map.M
instance Data.Foldable.Foldable Data.Aeson.Extra.Map.M
instance GHC.Base.Functor Data.Aeson.Extra.Map.M
instance GHC.Read.Read a => GHC.Read.Read (Data.Aeson.Extra.Map.M a)
instance GHC.Show.Show a => GHC.Show.Show (Data.Aeson.Extra.Map.M a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Aeson.Extra.Map.M a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Aeson.Extra.Map.M a)
instance (Data.Aeson.Extra.Map.ToJSONKey k, Data.Aeson.Types.ToJSON.ToJSON v) => Data.Aeson.Extra.Map.ToJSONMap (Data.HashMap.Base.HashMap k v) k v
instance (Data.Aeson.Extra.Map.ToJSONKey k, Data.Aeson.Types.ToJSON.ToJSON v) => Data.Aeson.Extra.Map.ToJSONMap (Data.Map.Internal.Map k v) k v
instance Data.Aeson.Extra.Map.ToJSONMap m k v => Data.Aeson.Types.ToJSON.ToJSON (Data.Aeson.Extra.Map.M m)
instance Data.Aeson.Extra.Map.ToJSONKey Data.Text.Internal.Text
instance Data.Aeson.Extra.Map.ToJSONKey Data.Text.Internal.Lazy.Text
instance Data.Aeson.Extra.Map.ToJSONKey GHC.Base.String
instance Data.Aeson.Extra.Map.ToJSONKey GHC.Types.Int
instance Data.Aeson.Extra.Map.ToJSONKey GHC.Integer.Type.Integer
instance (GHC.Classes.Eq k, Data.Hashable.Class.Hashable k, Data.Aeson.Extra.Map.FromJSONKey k, Data.Aeson.Types.FromJSON.FromJSON v) => Data.Aeson.Extra.Map.FromJSONMap (Data.HashMap.Base.HashMap k v) k v
instance (GHC.Classes.Ord k, Data.Aeson.Extra.Map.FromJSONKey k, Data.Aeson.Types.FromJSON.FromJSON v) => Data.Aeson.Extra.Map.FromJSONMap (Data.Map.Internal.Map k v) k v
instance Data.Aeson.Extra.Map.FromJSONMap m k v => Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extra.Map.M m)
instance Data.Aeson.Extra.Map.FromJSONKey Data.Text.Internal.Text
instance Data.Aeson.Extra.Map.FromJSONKey Data.Text.Internal.Lazy.Text
instance Data.Aeson.Extra.Map.FromJSONKey GHC.Base.String
instance Data.Aeson.Extra.Map.FromJSONKey GHC.Types.Int
instance Data.Aeson.Extra.Map.FromJSONKey GHC.Integer.Type.Integer

-- | Helps writing recursive algorithms on Value, for example:
--   
--   
--   stripNulls :: Value -> Value
--   stripNulls = cata (embed . f)
--    where
--      f (ObjectF a) = ObjectF $ HM.filter (== Null) a
--      f x = x
--   
module Data.Aeson.Extra.Recursive

-- | An algebra of Value
--   
--   Since: aeson-extra-0.3.1.0
data ValueF a
ObjectF :: ObjectF a -> ValueF a
ArrayF :: !ArrayF a -> ValueF a
StringF :: !Text -> ValueF a
NumberF :: !Scientific -> ValueF a
BoolF :: !Bool -> ValueF a
NullF :: ValueF a

-- | A JSON "object" (key/value map).
--   
--   Since: aeson-extra-0.3.1.0
type ObjectF a = HashMap Text a

-- | A JSON "array" (sequence).
--   
--   Since: aeson-extra-0.3.1.0
type ArrayF a = Vector a
instance Data.Traversable.Traversable Data.Aeson.Extra.Recursive.ValueF
instance Data.Foldable.Foldable Data.Aeson.Extra.Recursive.ValueF
instance GHC.Base.Functor Data.Aeson.Extra.Recursive.ValueF
instance Data.Data.Data a => Data.Data.Data (Data.Aeson.Extra.Recursive.ValueF a)
instance GHC.Show.Show a => GHC.Show.Show (Data.Aeson.Extra.Recursive.ValueF a)
instance GHC.Read.Read a => GHC.Read.Read (Data.Aeson.Extra.Recursive.ValueF a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Aeson.Extra.Recursive.ValueF a)
instance Data.Functor.Foldable.Recursive Data.Aeson.Types.Internal.Value
instance Data.Functor.Foldable.Corecursive Data.Aeson.Types.Internal.Value

module Data.Aeson.Extra.Merge

-- | Generic merge.
--   
--   For example see lodashMerge.
--   
--   Since: aeson-extra-0.3.1.0
merge :: (forall a. (a -> a -> a) -> ValueF a -> ValueF a -> ValueF a) -> Value -> Value -> Value

-- | Generic merge, in arbitrary context.
--   
--   Since: aeson-extra-0.3.1.0
mergeA :: Functor f => (forall a. (a -> a -> f a) -> ValueF a -> ValueF a -> f (ValueF a)) -> Value -> Value -> f Value

-- | Example of using merge. see
--   https://lodash.com/docs#merge:
--   
--   Note: not tested against JavaScript lodash, so may disagree in
--   the results.
lodashMerge :: Value -> Value -> Value

-- | An algebra of Value
--   
--   Since: aeson-extra-0.3.1.0
data ValueF a
ObjectF :: ObjectF a -> ValueF a
ArrayF :: !ArrayF a -> ValueF a
StringF :: !Text -> ValueF a
NumberF :: !Scientific -> ValueF a
BoolF :: !Bool -> ValueF a
NullF :: ValueF a

-- | A JSON "object" (key/value map).
--   
--   Since: aeson-extra-0.3.1.0
type ObjectF a = HashMap Text a

-- | A JSON "array" (sequence).
--   
--   Since: aeson-extra-0.3.1.0
type ArrayF a = Vector a

-- | Deprecated: Use Data.Aeson.Extra.Recursive module
module Data.Aeson.Extra.Foldable

module Data.Aeson.Extra.SingObject

-- | Singleton value object
--   
--   
--   λ > decode "{\"value\": 42 }" :: Maybe (SingObject "value" Int)
--   Just (SingObject 42)
--   
--   
--   
--   λ > encode (SingObject 42 :: SingObject "value" Int)
--   "{\"value\":42}"
--   
--   
--   Available with: base >=4.7
newtype SingObject (s :: Symbol) a
SingObject :: a -> SingObject (s :: Symbol) a
mkSingObject :: Proxy s -> a -> SingObject s a
getSingObject :: Proxy s -> SingObject s a -> a
instance Data.Traversable.Traversable (Data.Aeson.Extra.SingObject.SingObject s)
instance Data.Foldable.Foldable (Data.Aeson.Extra.SingObject.SingObject s)
instance GHC.Base.Functor (Data.Aeson.Extra.SingObject.SingObject s)
instance GHC.Read.Read a => GHC.Read.Read (Data.Aeson.Extra.SingObject.SingObject s a)
instance GHC.Show.Show a => GHC.Show.Show (Data.Aeson.Extra.SingObject.SingObject s a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Aeson.Extra.SingObject.SingObject s a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Aeson.Extra.SingObject.SingObject s a)
instance GHC.TypeLits.KnownSymbol s => Data.Aeson.Types.FromJSON.FromJSON1 (Data.Aeson.Extra.SingObject.SingObject s)
instance GHC.TypeLits.KnownSymbol s => Data.Aeson.Types.ToJSON.ToJSON1 (Data.Aeson.Extra.SingObject.SingObject s)
instance (GHC.TypeLits.KnownSymbol s, Data.Aeson.Types.FromJSON.FromJSON a) => Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extra.SingObject.SingObject s a)
instance (GHC.TypeLits.KnownSymbol s, Data.Aeson.Types.ToJSON.ToJSON a) => Data.Aeson.Types.ToJSON.ToJSON (Data.Aeson.Extra.SingObject.SingObject s a)
instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Aeson.Extra.SingObject.SingObject s a)

module Data.Aeson.Extra.Stream

-- | Lazyly parse ByteString with top-level JSON array.
--   
--   Note: inspecting result's second field will force the list!
--   
--   
--   let ~(values, err) = streamDecode bs
--   traverse_ processValue values
--   maybe (pure ()) printError err
--   
streamDecode :: forall a. FromJSON a => ByteString -> ([a], Maybe String)

module Data.Aeson.Extra.SymTag

-- | Singleton string encoded and decoded as ifself.
--   
--   
--   λ> encode (SymTag :: SymTag "foobar")
--   "\"foobar\""
--   
--   
--   
--   decode "\"foobar\"" :: Maybe (SymTag "foobar")
--   Just SymTag
--   
--   
--   
--   decode "\"foobar\"" :: Maybe (SymTag "barfoo")
--   Nothing
--   
--   
--   Available with: base >=4.7
data SymTag (s :: Symbol)
SymTag :: SymTag (s :: Symbol)
instance GHC.Enum.Bounded (Data.Aeson.Extra.SymTag.SymTag s)
instance GHC.Enum.Enum (Data.Aeson.Extra.SymTag.SymTag s)
instance GHC.Read.Read (Data.Aeson.Extra.SymTag.SymTag s)
instance GHC.Show.Show (Data.Aeson.Extra.SymTag.SymTag s)
instance GHC.Classes.Ord (Data.Aeson.Extra.SymTag.SymTag s)
instance GHC.Classes.Eq (Data.Aeson.Extra.SymTag.SymTag s)
instance GHC.TypeLits.KnownSymbol s => Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extra.SymTag.SymTag s)
instance GHC.TypeLits.KnownSymbol s => Data.Aeson.Types.ToJSON.ToJSON (Data.Aeson.Extra.SymTag.SymTag s)
instance Control.DeepSeq.NFData (Data.Aeson.Extra.SymTag.SymTag s)

-- | In addition to mkValue and mkValue' helpers, this module
--   exports Lift Value orphan instance for aeson <0.11
module Data.Aeson.Extra.TH

-- | Create a Value from string representation.
--   
--   This is useful in tests.
--   
--   Since: aeson-extra-0.3.1.0
mkValue :: String -> Q Exp

-- | Like mkValue, but replace single quotes with double quotes
--   before.
--   
--   
--   > $(mkValue' "{'a': 2 }")
--   Object (fromList [("a",Number 2.0)])
--   
--   
--   Since: aeson-extra-0.3.1.0
mkValue' :: String -> Q Exp

-- | Time tools
module Data.Aeson.Extra.Time

-- | A type to parse UTCTime
--   
--   FromJSON instance accepts for example:
--   
--   
--   2015-09-07T08:16:40.807Z
--   2015-09-07 11:16:40.807 +03:00
--   
--   
--   Latter format is accepted by aeson staring from version
--   0.10.0.0.
--   
--   See
--   https://github.com/bos/aeson/blob/4667ef1029a373cf4510f7deca147c357c6d8947/Data/Aeson/Parser/Time.hs#L150
--   
--   Since: aeson-extra-0.2.2.0
newtype U
U :: UTCTime -> U
[getU] :: U -> UTCTime

-- | A type to parse ZonedTime
--   
--   Since: aeson-extra-0.2.2.0
newtype Z
Z :: ZonedTime -> Z
[getZ] :: Z -> ZonedTime
instance GHC.Read.Read Data.Aeson.Extra.Time.Z
instance GHC.Show.Show Data.Aeson.Extra.Time.Z
instance GHC.Read.Read Data.Aeson.Extra.Time.U
instance GHC.Show.Show Data.Aeson.Extra.Time.U
instance GHC.Classes.Ord Data.Aeson.Extra.Time.U
instance GHC.Classes.Eq Data.Aeson.Extra.Time.U
instance Data.Aeson.Types.ToJSON.ToJSON Data.Aeson.Extra.Time.Z
instance Data.Aeson.Types.FromJSON.FromJSON Data.Aeson.Extra.Time.Z
instance Data.Aeson.Types.ToJSON.ToJSON Data.Aeson.Extra.Time.U
instance Data.Aeson.Types.FromJSON.FromJSON Data.Aeson.Extra.Time.U

-- | More or less useful newtypes for writing FromJSON &
--   ToJSON instances
module Data.Aeson.Extra

-- | Like encode, but produces strict ByteString.
--   
--   Since: 0.2.3.0
encodeStrict :: ToJSON a => a -> ByteString

-- | A wrapper type to parse arbitrary maps
--   
--   
--   λ > decode "{\"1\": 1, \"2\": 2}" :: Maybe (M (H.HashMap Int Int))
--   Just (M {getMap = fromList [(1,1),(2,2)]})
--   
newtype M a
M :: a -> M a
[getMap] :: M a -> a
class FromJSONKey a
parseJSONKey :: FromJSONKey a => Text -> Parser a
parseIntegralJSONKey :: Integral a => Text -> Parser a
class FromJSONMap m k v | m -> k v
parseJSONMap :: FromJSONMap m k v => HashMap Text Value -> Parser m
class ToJSONKey a
toJSONKey :: ToJSONKey a => a -> Text
class ToJSONMap m k v | m -> k v
toJSONMap :: ToJSONMap m k v => m -> HashMap Text Value

-- | Singleton string encoded and decoded as ifself.
--   
--   
--   λ> encode (SymTag :: SymTag "foobar")
--   "\"foobar\""
--   
--   
--   
--   decode "\"foobar\"" :: Maybe (SymTag "foobar")
--   Just SymTag
--   
--   
--   
--   decode "\"foobar\"" :: Maybe (SymTag "barfoo")
--   Nothing
--   
--   
--   Available with: base >=4.7
data SymTag (s :: Symbol)
SymTag :: SymTag (s :: Symbol)

-- | Singleton value object
--   
--   
--   λ > decode "{\"value\": 42 }" :: Maybe (SingObject "value" Int)
--   Just (SingObject 42)
--   
--   
--   
--   λ > encode (SingObject 42 :: SingObject "value" Int)
--   "{\"value\":42}"
--   
--   
--   Available with: base >=4.7
newtype SingObject (s :: Symbol) a
SingObject :: a -> SingObject (s :: Symbol) a
mkSingObject :: Proxy s -> a -> SingObject s a
getSingObject :: Proxy s -> SingObject s a -> a

-- | Collapsed list, singleton is represented as the value itself in JSON
--   encoding.
--   
--   
--   λ > decode "null" :: Maybe (CollapsedList [Int] Int)
--   Just (CollapsedList [])
--   λ > decode "42" :: Maybe (CollapsedList [Int] Int)
--   Just (CollapsedList [42])
--   λ > decode "[1, 2, 3]" :: Maybe (CollapsedList [Int] Int)
--   Just (CollapsedList [1,2,3])
--   
--   
--   
--   λ > encode (CollapsedList ([] :: [Int]))
--   "null"
--   λ > encode (CollapsedList ([42] :: [Int]))
--   "42"
--   λ > encode (CollapsedList ([1, 2, 3] :: [Int]))
--   "[1,2,3]"
--   
--   
--   Documentation rely on f Alternative instance behaving
--   like lists'.
newtype CollapsedList f a
CollapsedList :: f a -> CollapsedList f a
getCollapsedList :: CollapsedList f a -> f a

-- | Parses possibly collapsed array value from the object's field.
--   
--   
--   λ > newtype V = V [Int] deriving (Show)
--   λ > instance FromJSON V where parseJSON = withObject "V" $ \obj -> V <$> parseCollapsedList obj "value"
--   λ > decode "{}" :: Maybe V
--   Just (V [])
--   λ > decode "{\"value\": null}" :: Maybe V
--   Just (V [])
--   λ > decode "{\"value\": 42}" :: Maybe V
--   Just (V [42])
--   λ > decode "{\"value\": [1, 2, 3, 4]}" :: Maybe V
--   Just (V [1,2,3,4])
--   
parseCollapsedList :: (FromJSON a, FromJSON1 f, Alternative f) => Object -> Text -> Parser (f a)

-- | A type to parse UTCTime
--   
--   FromJSON instance accepts for example:
--   
--   
--   2015-09-07T08:16:40.807Z
--   2015-09-07 11:16:40.807 +03:00
--   
--   
--   Latter format is accepted by aeson staring from version
--   0.10.0.0.
--   
--   See
--   https://github.com/bos/aeson/blob/4667ef1029a373cf4510f7deca147c357c6d8947/Data/Aeson/Parser/Time.hs#L150
--   
--   Since: aeson-extra-0.2.2.0
newtype U
U :: UTCTime -> U
[getU] :: U -> UTCTime

-- | A type to parse ZonedTime
--   
--   Since: aeson-extra-0.2.2.0
newtype Z
Z :: ZonedTime -> Z
[getZ] :: Z -> ZonedTime

-- | An algebra of Value
--   
--   Since: aeson-extra-0.3.1.0
data ValueF a
ObjectF :: ObjectF a -> ValueF a
ArrayF :: !ArrayF a -> ValueF a
StringF :: !Text -> ValueF a
NumberF :: !Scientific -> ValueF a
BoolF :: !Bool -> ValueF a
NullF :: ValueF a

-- | A JSON "object" (key/value map).
--   
--   Since: aeson-extra-0.3.1.0
type ObjectF a = HashMap Text a

-- | A JSON "array" (sequence).
--   
--   Since: aeson-extra-0.3.1.0
type ArrayF a = Vector a

-- | Generic merge.
--   
--   For example see lodashMerge.
--   
--   Since: aeson-extra-0.3.1.0
merge :: (forall a. (a -> a -> a) -> ValueF a -> ValueF a -> ValueF a) -> Value -> Value -> Value

-- | Example of using merge. see
--   https://lodash.com/docs#merge:
--   
--   Note: not tested against JavaScript lodash, so may disagree in
--   the results.
lodashMerge :: Value -> Value -> Value

-- | Lazyly parse ByteString with top-level JSON array.
--   
--   Note: inspecting result's second field will force the list!
--   
--   
--   let ~(values, err) = streamDecode bs
--   traverse_ processValue values
--   maybe (pure ()) printError err
--   
streamDecode :: forall a. FromJSON a => ByteString -> ([a], Maybe String)

-- | Create a Value from string representation.
--   
--   This is useful in tests.
--   
--   Since: aeson-extra-0.3.1.0
mkValue :: String -> Q Exp

-- | Like mkValue, but replace single quotes with double quotes
--   before.
--   
--   
--   > $(mkValue' "{'a': 2 }")
--   Object (fromList [("a",Number 2.0)])
--   
--   
--   Since: aeson-extra-0.3.1.0
mkValue' :: String -> Q Exp
