diff --git a/Yesod/Helpers/Auth.hs b/Yesod/Helpers/Auth.hs index 286c0403..7dbd039c 100644 --- a/Yesod/Helpers/Auth.hs +++ b/Yesod/Helpers/Auth.hs @@ -170,8 +170,8 @@ getCheck = do %dd $snd$ |] json (ident, dn) = - jsonMap [ (jsonScalar $ cs "ident", jsonScalar ident) - , (jsonScalar $ cs "displayName", jsonScalar dn) + jsonMap [ ("ident", jsonScalar ident) + , ("displayName", jsonScalar dn) ] getLogout :: GHandler Auth master () diff --git a/Yesod/Helpers/Static.hs b/Yesod/Helpers/Static.hs index e7ce3f76..40c50657 100644 --- a/Yesod/Helpers/Static.hs +++ b/Yesod/Helpers/Static.hs @@ -23,6 +23,7 @@ module Yesod.Helpers.Static , fileLookupDir , siteStatic , StaticRoutes + , toStaticRoute , staticArgs , Static ) where @@ -80,3 +81,6 @@ getStaticRoute :: [String] -> GHandler Static master [(ContentType, Content)] getStaticRoute fp = do Static fl <- getYesod getStatic fl fp + +toStaticRoute :: [String] -> StaticRoutes +toStaticRoute = StaticRoute diff --git a/Yesod/Json.hs b/Yesod/Json.hs index d848cec2..860d00e3 100644 --- a/Yesod/Json.hs +++ b/Yesod/Json.hs @@ -18,7 +18,7 @@ module Yesod.Json import Text.Hamlet.Monad import Control.Applicative -import Data.Text (Text) +import Data.Text (Text, pack) import Web.Encodings import Yesod.Hamlet import Yesod.Definitions @@ -66,10 +66,10 @@ jsonList' (Enumerator enum) = do () <- j return $ Right True -jsonMap :: [(Json url (), Json url ())] -> Json url () +jsonMap :: [(String, Json url ())] -> Json url () jsonMap = jsonMap' . fromList -jsonMap' :: Enumerator (Json url (), Json url ()) (Json url) -> Json url () -- FIXME simplify type +jsonMap' :: Enumerator (String, Json url ()) (Json url) -> Json url () -- FIXME simplify type jsonMap' (Enumerator enum) = do Json $ outputString "{" _ <- enum go False @@ -77,7 +77,7 @@ jsonMap' (Enumerator enum) = do where go putComma (k, v) = do when putComma $ Json $ outputString "," - () <- k + jsonScalar $ Unencoded $ pack k Json $ outputString ":" () <- v return $ Right True diff --git a/yesod.cabal b/yesod.cabal index 6ff0c69c..6728e1e1 100644 --- a/yesod.cabal +++ b/yesod.cabal @@ -53,7 +53,7 @@ library template-haskell, web-routes >= 0.22 && < 0.23, web-routes-quasi >= 0.0 && < 0.1, - hamlet >= 0.0 && < 0.1 + hamlet >= 0.0.1 && < 0.1 if flag(transformers_02) build-depends: transformers >= 0.2 && < 0.3 CPP-OPTIONS: -DTRANSFORMERS_02