cabal-install-3.10.1.0: The command-line interface for Cabal and Hackage.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.Client.Utils.Json

Description

Minimal JSON / RFC 7159 support

The API is heavily inspired by aeson's API but puts emphasis on simplicity rather than performance. The ToJSON instances are intended to have an encoding compatible with aeson's encoding.

Synopsis

Documentation

data Value Source #

A JSON value represented as a Haskell value.

Instances

Instances details
IsString Value Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

fromString :: String -> Value #

Read Value Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Show Value Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #

ToJSON Value Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Value -> Value Source #

Eq Value Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

(==) :: Value -> Value -> Bool #

(/=) :: Value -> Value -> Bool #

type Object = [Pair] Source #

A JSON "object" (key/value map).

object :: [Pair] -> Value Source #

Create a Value from a list of name/value Pairs.

type Pair = (String, Value) Source #

A key/value pair for an Value

(.=) :: ToJSON v => String -> v -> Pair infixr 8 Source #

A key-value pair for encoding a JSON object.

encodeToString :: ToJSON a => a -> String Source #

Serialise value as JSON-encoded Unicode Value

encodeToBuilder :: ToJSON a => a -> Builder Source #

Serialise value as JSON/UTF8-encoded Builder

class ToJSON a where Source #

A type that can be converted to JSON.

Methods

toJSON :: a -> Value Source #

Convert a Haskell value to a JSON-friendly intermediate type.

Instances

Instances details
ToJSON Int16 Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Int16 -> Value Source #

ToJSON Int32 Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Int32 -> Value Source #

ToJSON Int64 Source #

Possibly lossy due to conversion to Double

Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Int64 -> Value Source #

ToJSON Int8 Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Int8 -> Value Source #

ToJSON Word16 Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Word16 -> Value Source #

ToJSON Word32 Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Word32 -> Value Source #

ToJSON Word64 Source #

Possibly lossy due to conversion to Double

Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Word64 -> Value Source #

ToJSON Word8 Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Word8 -> Value Source #

ToJSON Value Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Value -> Value Source #

ToJSON Integer Source #

Possibly lossy due to conversion to Double

Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Integer -> Value Source #

ToJSON () Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: () -> Value Source #

ToJSON Bool Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Bool -> Value Source #

ToJSON Double Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Double -> Value Source #

ToJSON Float Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Float -> Value Source #

ToJSON Int Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Int -> Value Source #

ToJSON Word Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Word -> Value Source #

ToJSON a => ToJSON (Maybe a) Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: Maybe a -> Value Source #

ToJSON a => ToJSON [a] Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: [a] -> Value Source #

(ToJSON a, ToJSON b) => ToJSON (a, b) Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: (a, b) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c) => ToJSON (a, b, c) Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: (a, b, c) -> Value Source #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d) => ToJSON (a, b, c, d) Source # 
Instance details

Defined in Distribution.Client.Utils.Json

Methods

toJSON :: (a, b, c, d) -> Value Source #