-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | JSON parsing library -- -- JSON parsing library with simple and sane API @package hjson @version 1.3.1 module Text.HJson data Json JString :: String -> Json JNumber :: Rational -> Json JObject :: (Map String Json) -> Json JBool :: Bool -> Json JNull :: Json JArray :: [Json] -> Json -- | Parses JSON string fromString :: String -> Either ParseError Json -- | Renders JSON to String toString :: Json -> String -- | Escapes string for inclusion in JSON escapeJString :: String -> String -- | Parsec parser for JSON jsonParser :: Monad m => ParsecT String s m Json -- | Class of types that can be converted to or from JSON class Jsonable a toJson :: Jsonable a => a -> Json fromJson :: Jsonable a => Json -> Maybe a -- | Newtype wrapper for list. It's user to avoid overlapping instances for -- string newtype List a List :: [a] -> List a asList :: List a -> [a] -- | 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. newtype Object a Object :: Map String a -> Object a asMap :: Object a -> Map String a -- | Another wrapper for Map String a. It have different Jsonable -- instance. Undecodable values in JObject are ignored. newtype LaxObject a LaxObject :: Map String a -> LaxObject a asLaxMap :: LaxObject a -> Map String a instance [overlap ok] Typeable Json instance [overlap ok] Show a => Show (LaxObject a) instance [overlap ok] Eq a => Eq (LaxObject a) instance [overlap ok] Show a => Show (Object a) instance [overlap ok] Eq a => Eq (Object a) instance [overlap ok] Show a => Show (List a) instance [overlap ok] Eq a => Eq (List a) instance [overlap ok] Ord a => Ord (List a) instance [overlap ok] Eq Json instance [overlap ok] Show Json instance [overlap ok] Data Json instance [overlap ok] Jsonable a => Jsonable (LaxObject a) instance [overlap ok] Jsonable a => Jsonable (Object a) instance [overlap ok] Jsonable a => Jsonable (List a) instance [overlap ok] Jsonable a => Jsonable (Seq a) instance [overlap ok] Jsonable IntSet instance [overlap ok] (Jsonable a, Ord a) => Jsonable (Set a) instance [overlap ok] Jsonable a => Jsonable (IntMap a) instance [overlap ok] (Jsonable a, Ord a, Jsonable b) => Jsonable (Map a b) instance [overlap ok] (Jsonable a, Jsonable b, Jsonable c, Jsonable d, Jsonable e) => Jsonable (a, b, c, d, e) instance [overlap ok] (Jsonable a, Jsonable b, Jsonable c, Jsonable d) => Jsonable (a, b, c, d) instance [overlap ok] (Jsonable a, Jsonable b, Jsonable c) => Jsonable (a, b, c) instance [overlap ok] (Jsonable a, Jsonable b) => Jsonable (a, b) instance [overlap ok] (Jsonable a, Jsonable b) => Jsonable (Either a b) instance [overlap ok] Jsonable a => Jsonable (Maybe a) instance [overlap ok] Jsonable String instance [overlap ok] Jsonable Float instance [overlap ok] Jsonable Double instance [overlap ok] Jsonable Int instance [overlap ok] Jsonable Integer instance [overlap ok] Jsonable Bool instance [overlap ok] Jsonable Json module Text.HJson.Pretty -- | Pretty-prints JSON with given indenter toString :: String -> Json -> String