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 fac6ea0a778d3674e647806867b4fadc88b3c4d2 (commit)
from 5ed33f4a12734874e1310dbec7e9e05612901372 (commit)
Summary of changes:
.../extensions/src/{App.hs => Application.hs} | 42 ++++++++++----------
project_template/extensions/src/Main.hs | 4 +-
project_template/extensions/src/Site.hs | 8 ++--
3 files changed, 27 insertions(+), 27 deletions(-)
rename project_template/extensions/src/{App.hs => Application.hs} (52%)
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 fac6ea0a778d3674e647806867b4fadc88b3c4d2
Author: Gregory Collins <[email protected]>
Date: Wed Nov 10 14:40:39 2010 +0100
Some tweaks to project starter for extensions
diff --git a/project_template/extensions/src/App.hs
b/project_template/extensions/src/Application.hs
similarity index 52%
rename from project_template/extensions/src/App.hs
rename to project_template/extensions/src/Application.hs
index 7818fe1..be2798a 100644
--- a/project_template/extensions/src/App.hs
+++ b/project_template/extensions/src/Application.hs
@@ -5,9 +5,9 @@ information it requires.
-}
-module App
- ( App
- , appRunner
+module Application
+ ( Application
+ , applicationRunner
) where
import Snap.Extension
@@ -17,42 +17,42 @@ import Text.Templating.Heist
------------------------------------------------------------------------------
--- | 'App' is our application's monad. It uses 'SnapExtend' from
+-- | 'Application' is our application's monad. It uses 'SnapExtend' from
-- 'Snap.Extension' to provide us with an extended 'MonadSnap' making use of
-- the Heist and Timer Snap extensions.
-type App = SnapExtend AppState
+type Application = SnapExtend ApplicationState
------------------------------------------------------------------------------
--- | 'AppState' is a record which contains the state needed by the Snap
+-- | 'ApplicationState' is a record which contains the state needed by the Snap
-- extensions we're using. We're using Heist so we can easily render Heist
-- templates, and Timer simply to illustrate the config loading differences
-- between development and production modes.
-data AppState = AppState
- { heistState :: HeistState App
- , timerState :: TimerState
+data ApplicationState = ApplicationState
+ { templateState :: HeistState Application
+ , timerState :: TimerState
}
------------------------------------------------------------------------------
-instance HasHeistState AppState where
- getHeistState = heistState
- setHeistState s a = a { heistState = s }
+instance HasHeistState ApplicationState where
+ getHeistState = templateState
+ setHeistState s a = a { templateState = s }
------------------------------------------------------------------------------
-instance HasTimerState AppState where
- getTimerState = timerState
+instance HasTimerState ApplicationState where
+ getTimerState = timerState
setTimerState s a = a { timerState = s }
------------------------------------------------------------------------------
--- | The 'Runner' for AppState. For more on 'Runner's, see the README from
--- the snap-extensions package. Briefly, this is used to generate the
--- 'AppState' needed for our application and will automatically generate
--- reload\/cleanup actions for us which we don't need to worry about.
-appRunner :: Runner AppState
-appRunner = do
+-- | The 'Runner' for ApplicationState. For more on 'Runner's, see the README
+-- from the snap-extensions package. Briefly, this is used to generate the
+-- 'ApplicationState' needed for our application and will automatically
+-- generate reload\/cleanup actions for us which we don't need to worry about.
+applicationRunner :: Runner ApplicationState
+applicationRunner = do
heist <- heistRunner "resources/templates" emptyTemplateState
timer <- timerRunner
- return $ AppState heist timer
+ return $ ApplicationState heist timer
diff --git a/project_template/extensions/src/Main.hs
b/project_template/extensions/src/Main.hs
index 82d8172..38018d8 100644
--- a/project_template/extensions/src/Main.hs
+++ b/project_template/extensions/src/Main.hs
@@ -48,8 +48,8 @@ import Snap.Extension.Server
import Snap.Extension.Server.Hint
#endif
-import App
+import Application
import Site
main :: IO ()
-main = quickHttpServe appRunner site
+main = quickHttpServe applicationRunner site
diff --git a/project_template/extensions/src/Site.hs
b/project_template/extensions/src/Site.hs
index 1fc5871..65812fa 100644
--- a/project_template/extensions/src/Site.hs
+++ b/project_template/extensions/src/Site.hs
@@ -19,7 +19,7 @@ import Snap.Util.FileServe
import Snap.Types
import Text.Templating.Heist
-import App
+import Application
------------------------------------------------------------------------------
@@ -28,7 +28,7 @@ import App
-- The 'ifTop' is required to limit this to the top of a route.
-- Otherwise, the way the route table is currently set up, this action
-- would be given every request.
-index :: App ()
+index :: Application ()
index = ifTop $ heistLocal (bindSplices indexSplices) $ render "index"
where
indexSplices =
@@ -39,7 +39,7 @@ index = ifTop $ heistLocal (bindSplices indexSplices) $
render "index"
------------------------------------------------------------------------------
-- | Renders the echo page.
-echo :: App ()
+echo :: Application ()
echo = do
message <- decodedParam "stuff"
heistLocal (bindString "message" message) $ render "echo"
@@ -49,7 +49,7 @@ echo = do
------------------------------------------------------------------------------
-- | The main entry point handler.
-site :: App ()
+site :: Application ()
site = route [ ("/", index)
, ("/echo/:stuff", echo)
]
-----------------------------------------------------------------------
hooks/post-receive
--
snap
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap