{-| Module : Data.Jdh.Json.Big Description : A module for big Json Value Types License : MIT Maintainer : brunoczim@gmail.com Stability : experimental Portability : OS-Independent This module contains the big version for Json Values. Example: A JSInt is implemented as Integer. Although the module is destinated for big values (Integer, Double and String), all functions from Data.Json.Generic are avaible as generics. This module defines a type synonymous and two functions for encoding and decoding JSValue of this type. -} module Data.Jdh.Json.Big( module G, Json, encode, decode ) where import Data.Jdh.Json.Generic as G -- | A synonymous type for (JSValue Integer Double String) type Json = JSValue Integer Double String -- | A function for encoding that specifies the types of JSValue to be the same as Json type. If the first argument is passed as false, the resulting string is condensed, otherwise, it will contain whitespaces as indentation and line breaks. encode :: Bool -> Json -> String encode True = G.prettify encode False = G.stringify -- | A function for decoding that specifies the types of JSValue to be the same as Json type. decode :: String -> [(Json, String)] decode = G.parse