json5hs-0.1.3.0: Serialising to and from JSON5
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.JSON5.String

Description

Basic support for working with JSON5 values.

Synopsis

Parsing

data GetJSON a Source #

Parsing JSON5

The type of JSON5 parsers for String

Instances

Instances details
Monad GetJSON Source # 
Instance details

Defined in Text.JSON5.String

Methods

(>>=) :: GetJSON a -> (a -> GetJSON b) -> GetJSON b #

(>>) :: GetJSON a -> GetJSON b -> GetJSON b #

return :: a -> GetJSON a #

Functor GetJSON Source # 
Instance details

Defined in Text.JSON5.String

Methods

fmap :: (a -> b) -> GetJSON a -> GetJSON b #

(<$) :: a -> GetJSON b -> GetJSON a #

MonadFail GetJSON Source # 
Instance details

Defined in Text.JSON5.String

Methods

fail :: String -> GetJSON a #

Applicative GetJSON Source # 
Instance details

Defined in Text.JSON5.String

Methods

pure :: a -> GetJSON a #

(<*>) :: GetJSON (a -> b) -> GetJSON a -> GetJSON b #

liftA2 :: (a -> b -> c) -> GetJSON a -> GetJSON b -> GetJSON c #

(*>) :: GetJSON a -> GetJSON b -> GetJSON b #

(<*) :: GetJSON a -> GetJSON b -> GetJSON a #

runGetJSON :: GetJSON a -> String -> Either String a Source #

Run a JSON5 reader on an input String, returning some Haskell value. All input will be consumed.

Reading JSON5

readJSNull :: GetJSON JSValue Source #

Read the JSON5 null type

readJSBool :: GetJSON JSValue Source #

Read the JSON5 Bool type

readJSString :: Char -> GetJSON JSValue Source #

Strings

Read the JSON5 String type

readJSRational :: GetJSON Rational Source #

Numbers

Read an Integer or Double in JSON5 format, returning a Rational

readJSInfNaN :: GetJSON Float Source #

Read an Infinity or NaN in JSON5 format, returning a Float

readJSArray :: GetJSON JSValue Source #

Objects & Arrays

Read a list in JSON5 format

readJSObject :: GetJSON JSValue Source #

Read an object in JSON5 format

readJSValue :: GetJSON JSValue Source #

Read one of several possible JS types

readJSTopType :: GetJSON JSValue Source #

Top level JSON5 can only be Arrays or Objects

Writing JSON5

showJSNull :: ShowS Source #

Write the JSON5 null type

showJSBool :: Bool -> ShowS Source #

Write the JSON5 Bool type

showJSArray :: [JSValue] -> ShowS Source #

Show a list in JSON format

showJSObject :: JSObject JSValue -> ShowS Source #

Show an association list in JSON format

showJSRational :: Rational -> ShowS Source #

Show a Rational in JSON5 format

showJSInfNaN :: Float -> ShowS Source #

Show a Infinity or NaN in JSON5 format

showJSValue :: JSValue -> ShowS Source #

Show JSON5 values

showJSTopType :: JSValue -> ShowS Source #

Writing JSON5

Show strict JSON5 top level types. Values not permitted at the top level are wrapped in a singleton array.