Removed json-* deps
This commit is contained in:
parent
1d523ce8d1
commit
3a47bf948e
@ -73,8 +73,6 @@ import Data.Enumerator (Enumerator)
|
|||||||
import Blaze.ByteString.Builder (Builder, fromByteString, fromLazyByteString)
|
import Blaze.ByteString.Builder (Builder, fromByteString, fromLazyByteString)
|
||||||
import Data.Monoid (mempty)
|
import Data.Monoid (mempty)
|
||||||
|
|
||||||
import qualified Data.JSON.Types as J
|
|
||||||
import qualified Text.JSON.Enumerator as J
|
|
||||||
import Text.Hamlet (Html)
|
import Text.Hamlet (Html)
|
||||||
import Text.Blaze.Renderer.Utf8 (renderHtmlBuilder)
|
import Text.Blaze.Renderer.Utf8 (renderHtmlBuilder)
|
||||||
|
|
||||||
@ -103,8 +101,6 @@ instance ToContent Text where
|
|||||||
toContent = toContent . Data.Text.Lazy.Encoding.encodeUtf8
|
toContent = toContent . Data.Text.Lazy.Encoding.encodeUtf8
|
||||||
instance ToContent String where
|
instance ToContent String where
|
||||||
toContent = toContent . T.pack
|
toContent = toContent . T.pack
|
||||||
instance ToContent J.Value where
|
|
||||||
toContent = ContentBuilder . J.renderValue
|
|
||||||
instance ToContent Html where
|
instance ToContent Html where
|
||||||
toContent = ContentBuilder . renderHtmlBuilder
|
toContent = ContentBuilder . renderHtmlBuilder
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,6 @@ module Yesod.Core
|
|||||||
-- * Utitlities
|
-- * Utitlities
|
||||||
, maybeAuthorized
|
, maybeAuthorized
|
||||||
, widgetToPageContent
|
, widgetToPageContent
|
||||||
, defaultLayoutJson
|
|
||||||
, jsonToRepJson
|
|
||||||
, redirectToPost
|
, redirectToPost
|
||||||
-- * Defaults
|
-- * Defaults
|
||||||
, defaultErrorHandler
|
, defaultErrorHandler
|
||||||
@ -58,7 +56,6 @@ import Text.Hamlet
|
|||||||
import Text.Cassius
|
import Text.Cassius
|
||||||
import Text.Julius
|
import Text.Julius
|
||||||
import Web.Routes
|
import Web.Routes
|
||||||
import qualified Data.JSON.Types as J
|
|
||||||
import Blaze.ByteString.Builder (toLazyByteString)
|
import Blaze.ByteString.Builder (toLazyByteString)
|
||||||
|
|
||||||
#if TEST
|
#if TEST
|
||||||
@ -298,20 +295,6 @@ breadcrumbs = do
|
|||||||
(title, next) <- breadcrumb this
|
(title, next) <- breadcrumb this
|
||||||
go ((this, title) : back) next
|
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
|
applyLayout' :: Yesod master
|
||||||
=> Html -- ^ title
|
=> Html -- ^ title
|
||||||
-> Hamlet (Route master) -- ^ body
|
-> Hamlet (Route master) -- ^ body
|
||||||
|
|||||||
@ -48,8 +48,6 @@ library
|
|||||||
, monad-peel >= 0.1 && < 0.2
|
, monad-peel >= 0.1 && < 0.2
|
||||||
, enumerator >= 0.4 && < 0.5
|
, enumerator >= 0.4 && < 0.5
|
||||||
, cookie >= 0.0 && < 0.1
|
, 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
|
, blaze-html >= 0.3.0.4 && < 0.4
|
||||||
exposed-modules: Yesod.Content
|
exposed-modules: Yesod.Content
|
||||||
Yesod.Core
|
Yesod.Core
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user