hw-json-1.3.2.4: Memory efficient JSON parser
Safe HaskellSafe-Inferred
LanguageHaskell2010

HaskellWorks.Data.Json.PartialValue

Synopsis

Documentation

data JsonPartialValue Source #

Partial JSON type.

This data type has an additional JsonPartialError data constructor to indicate parsing errors. This allows parsing to be more lazy because parsing errors may now be expressed anywhere in the parsed document so the parser no longer needs to make a verdict about whether there are any parsing errors in the entire document.

See jsonPartialJsonValueAt on how to parse JSON text into this datatype.

Although this data type allows for lazier parsing it doesn't allow for sub-trees to be garbage collected if a reference to an ancestor node is held. To avoid holding onto sub-trees that are no longer needed without having to drop references to ancestors use LightJson instead.

Instances

Instances details
Pretty JsonPartialValue Source # 
Instance details

Defined in HaskellWorks.Data.Json.PartialValue

Show JsonPartialValue Source # 
Instance details

Defined in HaskellWorks.Data.Json.PartialValue

Eq JsonPartialValue Source # 
Instance details

Defined in HaskellWorks.Data.Json.PartialValue

Ord JsonPartialValue Source # 
Instance details

Defined in HaskellWorks.Data.Json.PartialValue

Pretty (MQuery JsonPartialValue) Source # 
Instance details

Defined in HaskellWorks.Data.Json.PartialValue

Pretty (MQuery (Entry Text JsonPartialValue)) Source # 
Instance details

Defined in HaskellWorks.Data.Json.PartialValue

Pretty (Micro JsonPartialValue) Source # 
Instance details

Defined in HaskellWorks.Data.Json.PartialValue

Pretty (Micro (Text, JsonPartialValue)) Source # 
Instance details

Defined in HaskellWorks.Data.Json.PartialValue

Pretty (Micro (String, JsonPartialValue)) Source # 
Instance details

Defined in HaskellWorks.Data.Json.PartialValue

Pretty (Mini JsonPartialValue) Source # 
Instance details

Defined in HaskellWorks.Data.Json.PartialValue

Pretty (Mini (Text, JsonPartialValue)) Source # 
Instance details

Defined in HaskellWorks.Data.Json.PartialValue

class JsonPartialValueAt a where Source #

Methods

jsonPartialJsonValueAt :: a -> JsonPartialValue Source #

Get a JSON partial value from another type

This function can always "succeed" because the data type it returns allows for the document value to contain an arbitrary number of errors. This means errors can be reported in document nodes as parsing occurs lazily.

There are garbage collection implementations you may want to consider. If you would like to be able to hold onto ancestor nodes and still be able to garbage collect visited sub-trees, then consider using lightJsonAt instead.