aeson 0.5

This commit is contained in:
Michael Snoyman 2011-12-24 22:31:27 +02:00
parent 675f5b1ea9
commit 2e6681986f
2 changed files with 13 additions and 1 deletions

View File

@ -33,9 +33,20 @@ import qualified Data.Vector as V
import Text.Julius (ToJavascript (..))
import Data.Text.Lazy.Builder (fromLazyText)
import Data.Text.Lazy.Encoding (decodeUtf8)
#if MIN_VERSION_aeson(0, 5, 0)
import Data.Text.Lazy.Builder (toLazyText)
import qualified Blaze.ByteString.Builder.Char.Utf8 as Blaze
#endif
instance ToContent J.Value where
#if MIN_VERSION_aeson(0, 5, 0)
toContent = flip ContentBuilder Nothing
. Blaze.fromLazyText
. toLazyText
. fromValue
#else
toContent = flip ContentBuilder Nothing . fromValue
#endif
-- | Provide both an HTML and JSON representation for a piece of data, using
-- the default layout for the HTML output ('defaultLayout').

View File

@ -1,5 +1,5 @@
name: yesod-json
version: 0.2.2.1
version: 0.2.2.2
license: BSD3
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
@ -21,6 +21,7 @@ library
, vector >= 0.9
, containers >= 0.2 && < 0.5
, unordered-containers
, blaze-builder
exposed-modules: Yesod.Json
ghc-options: -Wall