Text.HJson
JSON data type
fromString :: String -> Either ParseError JsonSource
Parses JSON string
escapeJString :: String -> StringSource
Escapes string for inclusion in JSON
Type class for objects [de]serialization
Class of types that can be converted to or from JSON
Methods
Convert value to JSON representation
fromJson :: Json -> Maybe aSource
Deserialize value. Returns Nothing in case of failure. Default implementation always returns Nothing
Instances
Jsonable Bool | |
Jsonable Double | |
Jsonable Float | |
Jsonable Int | |
Jsonable Integer | |
Jsonable String | |
Jsonable IntSet | |
Jsonable Json | |
Jsonable a => Jsonable (Maybe a) | |
Jsonable a => Jsonable (Seq a) | |
Jsonable a => Jsonable (IntMap a) | |
(Jsonable a, Ord a) => Jsonable (Set a) | |
Jsonable a => Jsonable (LaxObject a) | |
Jsonable a => Jsonable (Object a) | |
Jsonable a => Jsonable (List a) | |
(Jsonable a, Jsonable b) => Jsonable (Either a b) | |
(Jsonable a, Jsonable b) => Jsonable (a, b) | |
(Jsonable a, Ord a, Jsonable b) => Jsonable (Map a b) | |
(Jsonable a, Jsonable b, Jsonable c) => Jsonable (a, b, c) | |
(Jsonable a, Jsonable b, Jsonable c, Jsonable d) => Jsonable (a, b, c, d) | |
(Jsonable a, Jsonable b, Jsonable c, Jsonable d, Jsonable e) => Jsonable (a, b, c, d, e) |
Newtype wrapper for list. It's user to avoid overlapping instances for string
Newtype wrapper for Map String a. Similarly it's used to avoid overlapping instances for more generic Map a b instance.
Jsonable instance for this type require that every JSON value in map should be properly decoded.