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 40c3568005c0b54e415232beb884e5e43035be51 (commit)
from f742b95c202f0f6247edabb39b313474fb278d97 (commit)
Summary of changes:
src/Snap/StarterTH.hs | 10 +++++-----
1 files changed, 5 insertions(+), 5 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 40c3568005c0b54e415232beb884e5e43035be51
Author: Carl Howells <[email protected]>
Date: Mon Jun 21 23:12:06 2010 -0700
Refactor adding type sigs in buildData
diff --git a/src/Snap/StarterTH.hs b/src/Snap/StarterTH.hs
index 6e5102b..cbda1af 100644
--- a/src/Snap/StarterTH.hs
+++ b/src/Snap/StarterTH.hs
@@ -40,7 +40,7 @@ readTree dir = do
-- Calls readTree and returns it's value in a quasiquote.
dirQ :: FilePath -> Q Exp
dirQ tplDir = do
- d <- runIO . readTree $ "project_template/"++tplDir
+ d <- runIO . readTree $ "project_template/" ++ tplDir
runQ [| d |]
@@ -51,10 +51,10 @@ buildData :: String -> FilePath -> Q [Dec]
buildData dirName tplDir = do
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]]
+ typ = tup2 (listOf str) (listOf $ tup2 str str)
+ tup2 x y = foldl AppT (TupleT 2) [x, y]
+ listOf = AppT ListT
+ str = ConT ''String
v <- valD (varP dir) (normalB $ dirQ tplDir) []
return [typeSig, v]
-----------------------------------------------------------------------
hooks/post-receive
--
snap
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap