This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "snap".

The branch, master has been updated
       via  f742b95c202f0f6247edabb39b313474fb278d97 (commit)
       via  9a3b7d5e60ff99eff0fde7a31d44085c666b2135 (commit)
       via  03fa90d8773681f1ad89198c2422e2038d5dde7e (commit)
       via  36eef158ca8ee765e1a86fefe45b880af5128ff7 (commit)
      from  050845099571460a6844b493594256d7e8d1b357 (commit)


Summary of changes:
 TODO                    |    3 ---
 src/Snap/Loader/Hint.hs |   20 ++++++++++++--------
 src/Snap/Starter.hs     |    2 +-
 src/Snap/StarterTH.hs   |   13 +++++++++----
 4 files changed, 22 insertions(+), 16 deletions(-)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f742b95c202f0f6247edabb39b313474fb278d97
Author: Carl Howells <[email protected]>
Date:   Mon Jun 21 22:50:46 2010 -0700

    Fix compile warnings caused by buildData not emitting a type signature

diff --git a/src/Snap/Starter.hs b/src/Snap/Starter.hs
index 4ee1b2b..348df39 100644
--- a/src/Snap/Starter.hs
+++ b/src/Snap/Starter.hs
@@ -14,7 +14,7 @@ import Snap.StarterTH
 
 
 ------------------------------------------------------------------------------
--- Creates a value tDir :: ([String], [(String, ByteString)])
+-- Creates a value tDir :: ([String], [(String, String)])
 $(buildData "tDirDefault"   "default")
 $(buildData "tDirBareBones" "barebones")
 $(buildData "tDirHint"      "hint")
diff --git a/src/Snap/StarterTH.hs b/src/Snap/StarterTH.hs
index 469850b..6e5102b 100644
--- a/src/Snap/StarterTH.hs
+++ b/src/Snap/StarterTH.hs
@@ -49,7 +49,12 @@ dirQ tplDir = do
 -- dirQ.
 buildData :: String -> FilePath -> Q [Dec]
 buildData dirName tplDir = do
-    v <- valD (varP (mkName dirName))
-                    (normalB $ dirQ tplDir)
-                    []
-    return [v]
+    let dir = mkName dirName
+        typeSig = SigD dir typ
+        t2t = TupleT 2
+        st = ConT ''String
+        lst = AppT ListT st
+        typ = foldl AppT t2t [lst, AppT ListT $ foldl AppT t2t [st, st]]
+
+    v <- valD (varP dir) (normalB $ dirQ tplDir) []
+    return [typeSig, v]
commit 9a3b7d5e60ff99eff0fde7a31d44085c666b2135
Author: Carl Howells <[email protected]>
Date:   Mon Jun 21 22:19:51 2010 -0700

    Update TODO

diff --git a/TODO b/TODO
index 66319dd..c8e9d1d 100644
--- a/TODO
+++ b/TODO
@@ -6,9 +6,6 @@ want to keep/integrate.
 
 Integrate extracting ghc options from cabal.
 
-Change back to relying on relative paths for everything.  It's
-acceptable to rely on the current working directory.
-
 document EVERYTHING.
   -- low-level per-function documentation
   -- mid-level per-module documentation
commit 03fa90d8773681f1ad89198c2422e2038d5dde7e
Author: Carl Howells <[email protected]>
Date:   Mon Jun 21 22:17:47 2010 -0700

    Do a compile-time check that the initialization and action have compatible 
types when using the hint loader

diff --git a/src/Snap/Loader/Hint.hs b/src/Snap/Loader/Hint.hs
index a851e2f..43c0b28 100644
--- a/src/Snap/Loader/Hint.hs
+++ b/src/Snap/Loader/Hint.hs
@@ -25,8 +25,7 @@ import           System.Directory (getCurrentDirectory)
 
 ------------------------------------------------------------------------------
 import           Snap.Types
-
-
+import qualified Snap.Loader.Static as Static
 
 ------------------------------------------------------------------------------
 -- | XXX
@@ -60,8 +59,15 @@ loadSnapTH initialize action = do
     modulesE <- lift modules
     strE <- lift str
 
-    return $ foldl AppE hintSnapE [optsE, srcE, modulesE, strE]
+    staticE <- Static.loadSnapTH initialize action
+
+    let hintApp = foldl AppE hintSnapE [optsE, srcE, modulesE, strE]
+        nameUnused = mkName "_"
+        body = NormalB staticE
+        clause = Clause [] body []
+        staticDec = FunD nameUnused [clause]
 
+    return $ LetE [staticDec] hintApp
 
 ------------------------------------------------------------------------------
 -- | XXX
commit 36eef158ca8ee765e1a86fefe45b880af5128ff7
Author: Carl Howells <[email protected]>
Date:   Mon Jun 21 22:16:46 2010 -0700

    Don't store absolute paths in the hint loader source path

diff --git a/src/Snap/Loader/Hint.hs b/src/Snap/Loader/Hint.hs
index cb5683b..a851e2f 100644
--- a/src/Snap/Loader/Hint.hs
+++ b/src/Snap/Loader/Hint.hs
@@ -22,7 +22,6 @@ import           Language.Haskell.Interpreter.Unsafe 
(unsafeSetGhcOption)
 import           Language.Haskell.TH.Syntax
 
 import           System.Directory (getCurrentDirectory)
-import           System.FilePath ((</>))
 
 ------------------------------------------------------------------------------
 import           Snap.Types
@@ -47,10 +46,9 @@ loadSnapTH initialize action = do
 
         lf = length . loc_filename $ loc
         lm = length . loc_module $ loc
-        relSrc = if lf > lm + 4
-                 then take (lf - (lm + 4)) $ loc_filename loc
-                 else "."
-        src = cwd </> relSrc
+        src = if lf > lm + 4
+              then take (lf - (lm + 4)) $ loc_filename loc
+              else "."
         str = "liftIO " ++ initBase ++ " >>= " ++ actBase
         modules = catMaybes [initMod, actMod]
         opts = [ "-hide-package=mtl" ] :: [String]
-----------------------------------------------------------------------


hooks/post-receive
-- 
snap
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap

Reply via email to