module Text.JSON.JSONPrint
(
JSONPrint(..)
) where
import Data.ByteString
import Text.JSONb
import qualified Text.JSON as J
import qualified Text.HJson as H
import qualified Data.Aeson.Types as A
import Data.Aeson.Generic
import Text.JSON.Pretty
import Text.HJson.Pretty
class JSONPrint j s | j -> s where
printJSON ::
j
-> s
instance JSONPrint JSON ByteString where
printJSON =
encode Compact
instance JSONPrint J.JSValue [Char] where
printJSON =
render . pp_value
instance JSONPrint H.Json [Char] where
printJSON =
toString " "
instance JSONPrint A.Value (A.Result [Char]) where
printJSON =
fromJSON