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  d6bfd48104026a77e13961b17e52e96857703ac2 (commit)
      from  6ae7a701339d576331630face024af5e8e019265 (commit)


Summary of changes:
 src/Snap/Heist.hs       |    7 ++++---
 src/Snap/Loader/Hint.hs |   24 +++++++-----------------
 2 files changed, 11 insertions(+), 20 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 d6bfd48104026a77e13961b17e52e96857703ac2
Author: Shane <[email protected]>
Date:   Tue Jul 13 20:44:18 2010 +0100

    Changed format in Snap.Loader.Hint to return a String instead of a 
ByteString, which is easier passed to error

diff --git a/src/Snap/Heist.hs b/src/Snap/Heist.hs
index 0a6525c..decea5d 100644
--- a/src/Snap/Heist.hs
+++ b/src/Snap/Heist.hs
@@ -3,6 +3,7 @@
 -- Heist templates from Snap.
 module Snap.Heist where
 
+import           Data.ByteString (ByteString)
 import qualified Data.ByteString.Char8 as S
 import           Snap.Types
 import           Text.Templating.Heist
@@ -11,7 +12,7 @@ import           Text.Templating.Heist
 ------------------------------------------------------------------------------
 -- | This is a convenience function.  It calls 'render' with the
 -- content type set to @text/html; charset=ut...@.
-renderHtml :: (MonadSnap m) => TemplateState m -> S.ByteString -> m ()
+renderHtml :: (MonadSnap m) => TemplateState m -> ByteString -> m ()
 renderHtml = render "text/html; charset=utf-8"
 
 
@@ -19,9 +20,9 @@ renderHtml = render "text/html; charset=utf-8"
 -- | Renders a template with the provided content type.  If the
 -- template cannot be loaded, 'pass' is called and the next handler is tried.
 render :: (MonadSnap m)
-       => S.ByteString -- ^ the content type to include in the response
+       => ByteString      -- ^ the content type to include in the response
        -> TemplateState m -- ^ the TemplateState that contains the template
-       -> S.ByteString -- ^ the name of the template
+       -> ByteString      -- ^ the name of the template
        -> m ()
 render contentType ts template = do
     bytes <- renderTemplate ts template
diff --git a/src/Snap/Loader/Hint.hs b/src/Snap/Loader/Hint.hs
index 35b0718..c160a20 100644
--- a/src/Snap/Loader/Hint.hs
+++ b/src/Snap/Loader/Hint.hs
@@ -7,9 +7,6 @@
 -- the calls to the dynamic loader.
 module Snap.Loader.Hint where
 
-------------------------------------------------------------------------------
-import qualified Data.ByteString.Char8 as S
-
 import           Data.List (groupBy, intercalate, isPrefixOf, nub)
 
 import           Control.Concurrent (forkIO, myThreadId)
@@ -152,20 +149,13 @@ hintSnap opts modules initialization cleanup handler = do
 
 
 ------------------------------------------------------------------------------
--- | Convert an InterpreterError to a ByteString for presentation
-format :: InterpreterError -> S.ByteString
-format (UnknownError e)   =
-    S.append "Unknown interpreter error:\r\n\r\n" $ S.pack e
-
-format (NotAllowed e)     =
-    S.append "Interpreter action not allowed:\r\n\r\n" $ S.pack e
-
-format (GhcException e)   =
-    S.append "GHC error:\r\n\r\n" $ S.pack e
-
-format (WontCompile errs) =
-    let formatted = S.intercalate "\r\n" . map S.pack . nub . map errMsg $ errs
-    in S.append "Compile errors:\r\n\r\n" formatted
+-- | Convert an InterpreterError to a String for presentation
+format :: InterpreterError -> String
+format (UnknownError e)   = "Unknown interpreter error:\r\n\r\n" ++ e
+format (NotAllowed e)     = "Interpreter action not allowed:\r\n\r\n" ++ e
+format (GhcException e)   = "GHC error:\r\n\r\n" ++ e
+format (WontCompile errs) = "Compile errors:\r\n\r\n" ++
+    (intercalate "\r\n" $ nub $ map errMsg errs)
 
 
 ------------------------------------------------------------------------------
-----------------------------------------------------------------------


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

Reply via email to