packages feed

yesod-fay 0.4.0 → 0.4.0.1

raw patch · 3 files changed

+20/−19 lines, 3 filesPVP: minor bump suggested

API additions: PVP suggests at least a minor version bump

API changes (from Hackage documentation)

+ Language.Fay.Yesod: instance Eq (Returns a)

Files

Language/Fay/Yesod.hs view
@@ -41,7 +41,7 @@ -- | A proxy type for specifying what type a command should return. The final -- field for each data constructor in a command datatype should be @Returns@. data Returns a = Returns-    deriving (Show, Read, Data, Typeable)+    deriving (Eq, Show, Read, Data, Typeable)  -- | Call a command. call :: (Returns a -> command)
Yesod/Fay.hs view
@@ -319,24 +319,25 @@         Right s -> do             s' <- qRunIO $ yfsPostProcess settings s             let contents = fromText (pack s') <> jsMainCall (not exportRuntime) name-            external <--                case yfsExternal settings of-                    Nothing -> return [|Nothing|]-                    Just (fp', exp') -> do-                        let name' = concat ["faygen-", hash, ".js"]-                            hash = base64md5 contents'-                            contents' = TLE.encodeUtf8 $ toLazyText contents-                        qRunIO $ L.writeFile (concat [fp', "/", name']) contents'-                        return [| Just ($(return exp'), name') |] -            [| do-                maybeRequireJQuery needJQuery-                $(requireFayRuntime settings)-                case $external of-                    Nothing -> toWidget $ const $ Javascript $ fromText $ pack-                               $(return $ LitE $ StringL $ TL.unpack $ toLazyText contents)-                    Just (constructor, name') -> addScript $ constructor $ StaticRoute [name'] []-                |]+            case yfsExternal settings of+                Nothing ->+                    [| do+                        maybeRequireJQuery needJQuery+                        $(requireFayRuntime settings)+                        toWidget $ const $ Javascript $ fromText $ pack+                          $(return $ LitE $ StringL $ TL.unpack $ toLazyText contents)+                    |]+                Just (fp', exp') -> do+                    let name' = concat ["faygen-", hash, ".js"]+                        hash = base64md5 contents'+                        contents' = TLE.encodeUtf8 $ toLazyText contents+                    qRunIO $ L.writeFile (concat [fp', "/", name']) contents'+                    [| do+                        maybeRequireJQuery needJQuery+                        $(requireFayRuntime settings)+                        addScript $ $(return exp') $ StaticRoute [pack name'] []+                        |]   where     name = yfsModuleName settings     exportRuntime = isNothing (yfsSeparateRuntime settings)
yesod-fay.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                yesod-fay-version:             0.4.0+version:             0.4.0.1 synopsis:            Utilities for using the Fay Haskell-to-JS compiler with Yesod. description:         For initial discussion, see <http://www.yesodweb.com/blog/2012/10/yesod-fay-js>. This is a work-in-progress. homepage:            https://github.com/snoyberg/yesod-fay