Module for object specific helpers.
Takes a json object and returns its values as list of strings. Returns an empty list if the value isn't an object.
values (ofInt [ ( "I" ), 1, ( "II" ), 2, ( "III" ), 3 ])
== [ Number 1, Number 2, Number 3 ]Given a funcion fn : String -> Json -> Maybe a
maps a json object, removes Nothings and returns a list.
If the json value is not an object returns an empty list.
Like filterMap, but fn maps only the keys.
Like filterMap, but fn maps only the values.
Wraps a list of string pairs in a json object.
ofString [ ( "name", "value" ) ]
== Object [ ( "name", String "value" ) ]Wraps a list of pairs of string and float in a json object.
ofFloat [ ( "pi", 3.14 ), ( "e", 2.718 ) ]
== Object [ ( "pi", Number 3.14 ), ( "e", Number 2.718 ) ]Wraps a list of pairs of string and int in a json object.
ofInt [ ( "I", 1 ), ( "II", 2 ) ]
== Object [ ( "I", Number 1 ), ( "II", Number 2 ) ]
Takes a json object and returns its keys as list of strings. Returns an empty list if the value isn't an object.