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 "heist".

The branch, master has been updated
       via  8e7348b19186f2633930186d0549a4c076caf9fb (commit)
      from  92fb927447da6e5cdcbc4db9a9c6431d903db492 (commit)


Summary of changes:
 src/Text/Templating/Heist.hs          |    1 +
 src/Text/Templating/Heist/Internal.hs |   12 +++++++++++-
 2 files changed, 12 insertions(+), 1 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 8e7348b19186f2633930186d0549a4c076caf9fb
Author: Gregory Collins <[email protected]>
Date:   Fri Jun 18 00:56:56 2010 -0400

    Add a bindSplices convenience function

diff --git a/src/Text/Templating/Heist.hs b/src/Text/Templating/Heist.hs
index 07c73b6..d6a6ac9 100644
--- a/src/Text/Templating/Heist.hs
+++ b/src/Text/Templating/Heist.hs
@@ -73,6 +73,7 @@ module Text.Templating.Heist
   , addTemplate
   , emptyTemplateState
   , bindSplice
+  , bindSplices
   , lookupSplice
   , setTemplates
   , loadTemplates
diff --git a/src/Text/Templating/Heist/Internal.hs 
b/src/Text/Templating/Heist/Internal.hs
index 42acb93..4201acb 100644
--- a/src/Text/Templating/Heist/Internal.hs
+++ b/src/Text/Templating/Heist/Internal.hs
@@ -85,7 +85,7 @@ addPostRunHook hook ts = ts { _postRunHook = _postRunHook ts 
>=> hook }
 
 
 ------------------------------------------------------------------------------
--- | Bind a new splice declaration to a tag name within a 'TemplateState'.
+-- | Binds a new splice declaration to a tag name within a 'TemplateState'.
 bindSplice :: Monad m =>
               ByteString        -- ^ tag name
            -> Splice m          -- ^ splice action
@@ -95,6 +95,16 @@ bindSplice n v ts = ts {_spliceMap = Map.insert n v 
(_spliceMap ts)}
 
 
 ------------------------------------------------------------------------------
+-- | Binds a set of new splice declarations within a 'TemplateState'.
+bindSplices :: Monad m =>
+               [(ByteString, Splice m)] -- ^ splices to bind action
+            -> TemplateState m   -- ^ source state
+            -> TemplateState m
+bindSplices ss ts = foldl' (flip id) ts acts 
+  where
+    acts = map (uncurry bindSplice) ss
+
+------------------------------------------------------------------------------
 -- | Convenience function for looking up a splice.
 lookupSplice :: Monad m =>
                 ByteString
-----------------------------------------------------------------------


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

Reply via email to