-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A tiny JSON library with light dependency footprint
--
-- microaeson aims to provide a RFC 8259 compliant
-- JavaScript Object Notation (JSON) implementation. The
-- microaeson package provides a smaller subset of the
-- aeson API with less dependencies and a simpler implementation.
--
-- The API is designed in such a way to allow to easily convert client
-- code written against microaeson's API to use the full
-- aeson API.
@package microaeson
@version 0.1.0.2
-- | Minimal JavaScript Object Notation (JSON) support as per RFC
-- 8259.
--
-- This API provides a subset (with a couple of divergences; see below)
-- of aeson API but puts the emphasis on simplicity rather than
-- performance and features.
--
-- The ToJSON and FromJSON instances are intended to have
-- an encoding compatible with aeson's encoding.
--
--
Limitations and divergences from aeson's API
--
-- In order to reduce the dependency footprint and keep the code simpler,
-- the following divergences from the aeson API have to be made:
--
--
-- - There are no FromJSON/ToJSON instances for
-- Char & Value.
-- - The type synonym (& the constructor of the same name)
-- Value uses containers's Map rather than a
-- HashMap unordered-containers.
-- - Array is represented by an ordinary list rather than a
-- Vector from the vector package.
-- - Number uses Double instead of
-- Scientific
--
module Data.Aeson.Micro
-- | A JSON value represented as a Haskell value.
data Value
Object :: !Object -> Value
Array :: [Value] -> Value
String :: !Text -> Value
Number :: !Double -> Value
Bool :: !Bool -> Value
Null :: Value
-- | A JSON "object" (key/value map).
type Object = Map Text Value
-- | A key/value pair for an Value
type Pair = (Text, Value)
-- | A key-value pair for encoding a JSON object.
(.=) :: ToJSON v => Text -> v -> Pair
infixr 8 .=
-- | Create a Value from a list of name/value Pairs.
object :: [Pair] -> Value
-- | The empty JSON Array (i.e. []).
emptyArray :: Value
-- | The empty JSON Value (i.e. {}).
emptyObject :: Value
(.:) :: FromJSON a => Object -> Text -> Parser a
(.:?) :: FromJSON a => Object -> Text -> Parser (Maybe a)
(.:!) :: FromJSON a => Object -> Text -> Parser (Maybe a)
(.!=) :: Parser (Maybe a) -> a -> Parser a
-- | Serialise value as JSON/UTF-8-encoded lazy ByteString
encode :: ToJSON a => a -> ByteString
-- | Serialise value as JSON/UTF-8-encoded strict ByteString
encodeStrict :: ToJSON a => a -> ByteString
-- | Serialise value as JSON/UTF8-encoded Builder
encodeToBuilder :: ToJSON a => a -> Builder
-- | Decode a single JSON document
decodeStrict :: FromJSON a => ByteString -> Maybe a
-- | Decode a single JSON document
decode :: FromJSON a => ByteString -> Maybe a
-- | Decode multiple concatenated JSON documents
decodeStrictN :: FromJSON a => ByteString -> Maybe [a]
withObject :: String -> (Object -> Parser a) -> Value -> Parser a
withText :: String -> (Text -> Parser a) -> Value -> Parser a
withArray :: String -> ([Value] -> Parser a) -> Value -> Parser a
withNumber :: String -> (Double -> Parser a) -> Value -> Parser a
withBool :: String -> (Bool -> Parser a) -> Value -> Parser a
-- | A type that JSON can be deserialised into
class FromJSON a
-- | Decode a JSON value into a native Haskell type
parseJSON :: FromJSON a => Value -> Parser a
-- | JSON Parser Monad used by FromJSON
data Parser a
-- | Run Parser.
--
-- A common use-case is parseMaybe parseJSON.
parseMaybe :: (a -> Parser b) -> a -> Maybe b
-- | A type that can be converted to JSON.
class ToJSON a
-- | Convert a Haskell value to a JSON-friendly intermediate type.
toJSON :: ToJSON a => a -> Value
instance Data.Data.Data Data.Aeson.Micro.Value
instance GHC.Generics.Generic Data.Aeson.Micro.Value
instance GHC.Show.Show Data.Aeson.Micro.Value
instance GHC.Read.Read Data.Aeson.Micro.Value
instance GHC.Classes.Eq Data.Aeson.Micro.Value
instance Control.Monad.Fail.MonadFail Data.Aeson.Micro.Parser
instance GHC.Base.Monad Data.Aeson.Micro.Parser
instance GHC.Base.Applicative Data.Aeson.Micro.Parser
instance GHC.Base.Functor Data.Aeson.Micro.Parser
instance Data.Aeson.Micro.FromJSON Data.Aeson.Micro.Value
instance Data.Aeson.Micro.FromJSON GHC.Types.Bool
instance Data.Aeson.Micro.FromJSON Data.Text.Internal.Text
instance Data.Aeson.Micro.FromJSON Data.Text.Internal.Lazy.Text
instance Data.Aeson.Micro.FromJSON a => Data.Aeson.Micro.FromJSON [a]
instance Data.Aeson.Micro.FromJSON GHC.Types.Double
instance Data.Aeson.Micro.FromJSON GHC.Types.Float
instance Data.Aeson.Micro.FromJSON GHC.Num.Integer.Integer
instance Data.Aeson.Micro.FromJSON GHC.Types.Int
instance Data.Aeson.Micro.FromJSON GHC.Int.Int8
instance Data.Aeson.Micro.FromJSON GHC.Int.Int16
instance Data.Aeson.Micro.FromJSON GHC.Int.Int32
instance Data.Aeson.Micro.FromJSON GHC.Int.Int64
instance Data.Aeson.Micro.FromJSON GHC.Types.Word
instance Data.Aeson.Micro.FromJSON GHC.Word.Word8
instance Data.Aeson.Micro.FromJSON GHC.Word.Word16
instance Data.Aeson.Micro.FromJSON GHC.Word.Word32
instance Data.Aeson.Micro.FromJSON GHC.Word.Word64
instance Data.Aeson.Micro.FromJSON ()
instance (Data.Aeson.Micro.FromJSON a, Data.Aeson.Micro.FromJSON b) => Data.Aeson.Micro.FromJSON (a, b)
instance (Data.Aeson.Micro.FromJSON a, Data.Aeson.Micro.FromJSON b, Data.Aeson.Micro.FromJSON c) => Data.Aeson.Micro.FromJSON (a, b, c)
instance (Data.Aeson.Micro.FromJSON a, Data.Aeson.Micro.FromJSON b, Data.Aeson.Micro.FromJSON c, Data.Aeson.Micro.FromJSON d) => Data.Aeson.Micro.FromJSON (a, b, c, d)
instance Data.Aeson.Micro.FromJSON a => Data.Aeson.Micro.FromJSON (GHC.Maybe.Maybe a)
instance Data.Aeson.Micro.FromJSON GHC.Types.Ordering
instance Data.Aeson.Micro.FromJSON v => Data.Aeson.Micro.FromJSON (Data.Map.Internal.Map Data.Text.Internal.Text v)
instance Data.Aeson.Micro.ToJSON ()
instance Data.Aeson.Micro.ToJSON Data.Aeson.Micro.Value
instance Data.Aeson.Micro.ToJSON GHC.Types.Bool
instance Data.Aeson.Micro.ToJSON a => Data.Aeson.Micro.ToJSON [a]
instance Data.Aeson.Micro.ToJSON v => Data.Aeson.Micro.ToJSON (Data.Map.Internal.Map Data.Text.Internal.Text v)
instance Data.Aeson.Micro.ToJSON a => Data.Aeson.Micro.ToJSON (GHC.Maybe.Maybe a)
instance (Data.Aeson.Micro.ToJSON a, Data.Aeson.Micro.ToJSON b) => Data.Aeson.Micro.ToJSON (a, b)
instance (Data.Aeson.Micro.ToJSON a, Data.Aeson.Micro.ToJSON b, Data.Aeson.Micro.ToJSON c) => Data.Aeson.Micro.ToJSON (a, b, c)
instance (Data.Aeson.Micro.ToJSON a, Data.Aeson.Micro.ToJSON b, Data.Aeson.Micro.ToJSON c, Data.Aeson.Micro.ToJSON d) => Data.Aeson.Micro.ToJSON (a, b, c, d)
instance Data.Aeson.Micro.ToJSON Data.Text.Internal.Text
instance Data.Aeson.Micro.ToJSON Data.Text.Internal.Lazy.Text
instance Data.Aeson.Micro.ToJSON GHC.Types.Float
instance Data.Aeson.Micro.ToJSON GHC.Types.Double
instance Data.Aeson.Micro.ToJSON GHC.Types.Int
instance Data.Aeson.Micro.ToJSON GHC.Int.Int8
instance Data.Aeson.Micro.ToJSON GHC.Int.Int16
instance Data.Aeson.Micro.ToJSON GHC.Int.Int32
instance Data.Aeson.Micro.ToJSON GHC.Types.Word
instance Data.Aeson.Micro.ToJSON GHC.Word.Word8
instance Data.Aeson.Micro.ToJSON GHC.Word.Word16
instance Data.Aeson.Micro.ToJSON GHC.Word.Word32
instance Data.Aeson.Micro.ToJSON GHC.Int.Int64
instance Data.Aeson.Micro.ToJSON GHC.Word.Word64
instance Data.Aeson.Micro.ToJSON GHC.Num.Integer.Integer
instance Control.DeepSeq.NFData Data.Aeson.Micro.Value
instance Data.String.IsString Data.Aeson.Micro.Value