json2-0.8.3: Library provides support for JSON.

Data.JSON2.Query

Contents

Description

Synopsis

Data Types

Filtering primitive types

isStr :: JFilterSource

Filter Json strings.

isStrBy :: (String -> Bool) -> JFilterSource

Predicative filter Json strings.

isNum :: JFilterSource

Filter Json numbers.

isNumBy :: Fractional a => (a -> Bool) -> JFilterSource

Predicative filter Json numbers.

isBool :: JFilterSource

Filter Json Bool.

isTrue :: JFilterSource

Filter Json True.

isFalse :: JFilterSource

Filter Json False.

isNull :: JFilterSource

Filter Json null.

isAtomic :: JFilterSource

Filter primitive types.

Filtering JSON objects

isObj :: JFilterSource

Filter Json objects.

getFromObj :: JFilterSource

Get all elements from object.

getFromKey :: String -> JFilterSource

Get elements from object with key.

getFromKeys :: [String] -> JFilterSource

Get elements from object with keys.

getFromKeyBy :: (String -> Bool) -> JFilterSource

Get elements from object with key by.

Filtering JSON arrays

isArr :: JFilterSource

Filter Json arrays.

getFromArr :: JFilterSource

Get all elements from array.

getFromIndex :: Int -> JFilterSource

Get element from array with index.

getFromIndexes :: [Int] -> JFilterSource

Get elements from array with index by.

DEPRECATED use: getFromIndexBy

getFromIndexBy :: (Int -> Bool) -> JFilterSource

Get elements from array with indexes.

Filtering JSON arrays and objects

getChildern :: JFilterSource

Get all elements from object and array.

Filter Combinators

(>>>) :: JFilter -> JFilter -> JFilterSource

(f >>> g) - Apply filter f, later filter g .

(<+>) :: JFilter -> JFilter -> JFilterSource

Concat results two filters.

orElse :: JFilter -> JFilter -> JFilterSource

(f orElse g) - Apply f, if f returned empty apply g.

when :: JFilter -> JFilter -> JFilterSource

(f when g) - When g returned not empty, apply f.

guards :: JFilter -> JFilter -> JFilterSource

(f guards g ) - If f returned empty then empty else apply g.

deep :: JFilter -> JFilterSource

Tree traversal filter for object and array.

deepObj :: JFilter -> JFilterSource

Tree traversal filter for array.