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 33616e467ed6617442dcb716a71582368f827e95 (commit)
from fa9b9ad27a4a8d6512f11ecd58cfd6f1c886b846 (commit)
Summary of changes:
snap.cabal | 1 -
src/Snap/Extension/Loader/Hint.hs | 11 +++++++++--
src/Snap/Extension/Loader/Static.hs | 33 ---------------------------------
3 files changed, 9 insertions(+), 36 deletions(-)
delete mode 100644 src/Snap/Extension/Loader/Static.hs
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 33616e467ed6617442dcb716a71582368f827e95
Author: Gregory Collins <[email protected]>
Date: Sun Dec 19 10:35:51 2010 +0100
Remove the Snap.Extension.Loader.Static module, model doesn't quite fit
anymore. May reintroduce it again in the future.
diff --git a/snap.cabal b/snap.cabal
index 80e447b..90f0842 100644
--- a/snap.cabal
+++ b/snap.cabal
@@ -47,7 +47,6 @@ Library
Snap.Extension.Heist,
Snap.Extension.Heist.Impl,
Snap.Extension.Loader.Hint,
- Snap.Extension.Loader.Static,
Snap.Extension.Server.Hint,
Snap.Extension.Server,
Snap.Extension,
diff --git a/src/Snap/Extension/Loader/Hint.hs
b/src/Snap/Extension/Loader/Hint.hs
index f0edd0b..db8c832 100644
--- a/src/Snap/Extension/Loader/Hint.hs
+++ b/src/Snap/Extension/Loader/Hint.hs
@@ -31,7 +31,7 @@ import System.Environment (getArgs)
------------------------------------------------------------------------------
import Snap.Types
-import qualified Snap.Extension.Loader.Static as Static
+import Snap.Extension (runInitializerHint)
import Snap.Extension.Loader.Hint.Helper
------------------------------------------------------------------------------
@@ -65,7 +65,7 @@ loadSnapTH initializer action = do
modules = catMaybes [initMod, actMod]
opts = getHintOpts args
- let static = Static.loadSnapTH initializer action
+ let static = typecheck initializer action
-- The let in this block causes the static expression to be
-- pattern-matched, providing an extra check that the types were
@@ -74,6 +74,13 @@ loadSnapTH initializer action = do
in hintSnap opts modules initBase actBase |]
+-- Used to typecheck the initializer & action splices.
+typecheck :: Name -> Name -> Q Exp
+typecheck initializer action = do
+ let [initE, actE] = map varE [initializer, action]
+ [| return (runInitializerHint $initE $actE) |]
+
+
------------------------------------------------------------------------------
-- | Convert the command-line arguments passed in to options for the
-- hint interpreter. This is somewhat brittle code, based on a few
diff --git a/src/Snap/Extension/Loader/Static.hs
b/src/Snap/Extension/Loader/Static.hs
deleted file mode 100644
index f9f9732..0000000
--- a/src/Snap/Extension/Loader/Static.hs
+++ /dev/null
@@ -1,33 +0,0 @@
-{-# LANGUAGE TemplateHaskell #-}
--- | This module is a source-compatible replacement for
--- "Snap.Loader.Hint". It does not import the GHC api, directly or
--- transitively, resulting in a greatly decreased binary size, as
--- compared to the Hint loader.
---
--- This module results in the same code as using the actions in the
--- obvious, straight-forward manner. It is present *only* as a
--- source-level replacement for the Hint loader, to enable quickly
--- switching the Hint loader off with only a changed import.
-module Snap.Extension.Loader.Static where
-
-import Language.Haskell.TH
-
-import Snap.Extension
-
-------------------------------------------------------------------------------
--- | This function is a shim for source compatibility with loadSnapTH
--- in "Snap.Loader.Hint". This function is a TH wrapper around a
--- hypothetical function:
---
--- > loadSnap :: IO a -> (a -> IO ()) -> (a -> Snap ()) -> IO (IO (), Snap ())
--- > loadSnap initialize cleanup action = do
--- > i <- initialize
--- > return (cleanup i, action i)
-
--- FIXME: change docs to match two arguments. In particular "initializer" is
--- now an "Initializer s" and "action" is a "SnapExtend s ()"
-loadSnapTH :: Name -> Name -> Q Exp
-loadSnapTH initializer action = do
- let [initE, actE] = map varE [initializer, action]
- -- FIXME: rename runInitializerHint2
- [| return (runInitializerHint $initE $actE) |]
-----------------------------------------------------------------------
hooks/post-receive
--
snap
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap