From 3a47bf948e8285a1c6550cf2732fb6bde2f5d068 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 25 Dec 2010 20:41:13 +0200 Subject: [PATCH] Removed json-* deps --- Yesod/Content.hs | 4 ---- Yesod/Core.hs | 17 ----------------- yesod-core.cabal | 2 -- 3 files changed, 23 deletions(-) diff --git a/Yesod/Content.hs b/Yesod/Content.hs index e0f17041..74f044ed 100644 --- a/Yesod/Content.hs +++ b/Yesod/Content.hs @@ -73,8 +73,6 @@ import Data.Enumerator (Enumerator) import Blaze.ByteString.Builder (Builder, fromByteString, fromLazyByteString) import Data.Monoid (mempty) -import qualified Data.JSON.Types as J -import qualified Text.JSON.Enumerator as J import Text.Hamlet (Html) import Text.Blaze.Renderer.Utf8 (renderHtmlBuilder) @@ -103,8 +101,6 @@ instance ToContent Text where toContent = toContent . Data.Text.Lazy.Encoding.encodeUtf8 instance ToContent String where toContent = toContent . T.pack -instance ToContent J.Value where - toContent = ContentBuilder . J.renderValue instance ToContent Html where toContent = ContentBuilder . renderHtmlBuilder diff --git a/Yesod/Core.hs b/Yesod/Core.hs index 776dfb66..2b244462 100644 --- a/Yesod/Core.hs +++ b/Yesod/Core.hs @@ -17,8 +17,6 @@ module Yesod.Core -- * Utitlities , maybeAuthorized , widgetToPageContent - , defaultLayoutJson - , jsonToRepJson , redirectToPost -- * Defaults , defaultErrorHandler @@ -58,7 +56,6 @@ import Text.Hamlet import Text.Cassius import Text.Julius import Web.Routes -import qualified Data.JSON.Types as J import Blaze.ByteString.Builder (toLazyByteString) #if TEST @@ -298,20 +295,6 @@ breadcrumbs = do (title, next) <- breadcrumb this go ((this, title) : back) next --- | Provide both an HTML and JSON representation for a piece of data, using --- the default layout for the HTML output ('defaultLayout'). -defaultLayoutJson :: Yesod master - => GWidget sub master () - -> J.Value - -> GHandler sub master RepHtmlJson -defaultLayoutJson w json = do - RepHtml html' <- defaultLayout w - return $ RepHtmlJson html' $ toContent json - --- | Wraps the 'Content' generated by 'jsonToContent' in a 'RepJson'. -jsonToRepJson :: J.Value -> GHandler sub master RepJson -jsonToRepJson = return . RepJson . toContent - applyLayout' :: Yesod master => Html -- ^ title -> Hamlet (Route master) -- ^ body diff --git a/yesod-core.cabal b/yesod-core.cabal index 56cd8fb7..03836cbb 100644 --- a/yesod-core.cabal +++ b/yesod-core.cabal @@ -48,8 +48,6 @@ library , monad-peel >= 0.1 && < 0.2 , enumerator >= 0.4 && < 0.5 , cookie >= 0.0 && < 0.1 - , json-enumerator >= 0.0 && < 0.1 - , json-types >= 0.1 && < 0.2 , blaze-html >= 0.3.0.4 && < 0.4 exposed-modules: Yesod.Content Yesod.Core