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  b96c4bb62b533bcab9872403700a0d05bf183af4 (commit)
       via  6efe0a6824cee2dc2c8d01f47a6880e8402a3947 (commit)
      from  7649d6ee745499a4b481f33dc91454c44d3fc3d3 (commit)


Summary of changes:
 TODO                               |   17 ---------
 src/Snap/Extension/Loader/Devel.hs |   69 ++++++++++++++++++++++-------------
 2 files changed, 43 insertions(+), 43 deletions(-)
 delete mode 100644 TODO

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 b96c4bb62b533bcab9872403700a0d05bf183af4
Author: Carl Howells <[email protected]>
Date:   Tue Feb 8 01:24:50 2011 -0800

    Refactor the Devel loader and export a second helper function

diff --git a/src/Snap/Extension/Loader/Devel.hs 
b/src/Snap/Extension/Loader/Devel.hs
index 1afd29b..5a87d0d 100644
--- a/src/Snap/Extension/Loader/Devel.hs
+++ b/src/Snap/Extension/Loader/Devel.hs
@@ -7,6 +7,7 @@
 -- the calls to the dynamic loader.
 module Snap.Extension.Loader.Devel
   ( loadSnapTH
+  , loadSnapTH'
   ) where
 
 import           Control.Monad (liftM2)
@@ -24,7 +25,6 @@ import           System.Environment (getArgs)
 
 ------------------------------------------------------------------------------
 import           Snap.Types
-import           Snap.Extension (runInitializerWithoutReloadAction)
 import           Snap.Extension.Loader.Devel.Signal
 import           Snap.Extension.Loader.Devel.Evaluator
 import           Snap.Extension.Loader.Devel.TreeWatcher
@@ -44,23 +44,43 @@ import           Snap.Extension.Loader.Devel.TreeWatcher
 -- during development unless your .cabal file changes, or the code
 -- that uses this splice changes.
 loadSnapTH :: Name -> Name -> [String] -> Q Exp
-loadSnapTH initializer action additionalWatchDirs = do
-    args <- runIO getArgs
+loadSnapTH initializer action additionalWatchDirs =
+    loadSnapTH' modules imports additionalWatchDirs loadStr
+  where
+    initMod = nameModule initializer
+    initBase = nameBase initializer
+    actMod = nameModule action
+    actBase = nameBase action
+
+    modules = catMaybes [initMod, actMod]
+    imports = ["Snap.Extension"]
+
+    loadStr = intercalate " " [ "runInitializerWithoutReloadAction"
+                              , initBase
+                              , actBase
+                              ]
 
-    let initMod = nameModule initializer
-        initBase = nameBase initializer
-        actMod = nameModule action
-        actBase = nameBase action
 
-        opts = getHintOpts args
-        modules = catMaybes [initMod, actMod]
+------------------------------------------------------------------------------
+-- | This is the backing implementation for 'loadSnapTH'.  This
+-- interface can be used when the types involved don't include a
+-- SnapExtend and an Initializer.
+loadSnapTH' :: [String] -- ^ the list of modules to interpret
+            -> [String] -- ^ the list of modules to import in addition
+                        -- to those being interpreted
+            -> [String] -- ^ additional directories to watch for
+                        -- changes to trigger to recompile/reload
+            -> String   -- ^ the expression to interpret in the
+                        -- context of the loaded modules and imports.
+                        -- It should have the type 'HintLoadable'
+            -> Q Exp
+loadSnapTH' modules imports additionalWatchDirs loadStr = do
+    args <- runIO getArgs
+
+    let opts = getHintOpts args
         srcPaths = additionalWatchDirs ++ getSrcPaths args
 
-    -- The let in this block causes an extra static type check that the
-    -- types of the names passed in were correct at compile time.
-    [| let _ = runInitializerWithoutReloadAction $(varE initializer)
-                                                 $(varE action)
-       in hintSnap opts modules srcPaths initBase actBase |]
+    [| hintSnap opts modules imports srcPaths loadStr |]
 
 
 ------------------------------------------------------------------------------
@@ -113,24 +133,21 @@ hintSnap :: [String] -- ^ A list of command-line options 
for the interpreter
                      -- modules which contain the initialization,
                      -- cleanup, and handler actions.  Everything else
                      -- they require will be loaded transitively.
+         -> [String] -- ^ A list of modules that need to be be
+                     -- imported, in addition to the ones that need to
+                     -- be interpreted.  This only needs to contain
+                     -- modules that aren't being interpreted, such as
+                     -- those from other libraries, that are used in
+                     -- the expression passed in.
          -> [String] -- ^ A list of paths to watch for updates
-         -> String   -- ^ The name of the initializer action
-         -> String   -- ^ The name of the SnapExtend action
+         -> String   -- ^ The string to execute
          -> IO (Snap ())
-hintSnap opts modules srcPaths initialization handler =
+hintSnap opts modules imports srcPaths action =
     protectedHintEvaluator initialize test loader
   where
-    action = intercalate " " [ "runInitializerWithoutReloadAction"
-                             , initialization
-                             , handler
-                             ]
     interpreter = do
         loadModules . nub $ modules
-        let imports = "Prelude" :
-                      "Snap.Extension" :
-                      "Snap.Types" :
-                      modules
-        setImports . nub $ imports
+        setImports . nub $ "Prelude" : "Snap.Types" : imports ++ modules
 
         interpret action (as :: HintLoadable)
 
commit 6efe0a6824cee2dc2c8d01f47a6880e8402a3947
Author: Carl Howells <[email protected]>
Date:   Tue Feb 8 01:09:47 2011 -0800

    Remove outdated TODO file

diff --git a/TODO b/TODO
deleted file mode 100644
index f1d2f9c..0000000
--- a/TODO
+++ /dev/null
@@ -1,17 +0,0 @@
-TODO
-----
-
-Check for space issues in development vs production modes
-  -- last thing before release
-
-document EVERYTHING.
-  -- low-level per-function documentation
-  -- mid-level per-module documentation
-  -- high-level design documentation
-
-Extract ghc options via TH to include in hint configuration.
-  -- wait for new release of hint
-
-Fix broken SIGINT handler installed by the ghc api via hint.
-  -- patch submitted for hint
-  -- I can work around this in my code if needed
-----------------------------------------------------------------------


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

Reply via email to