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

The branch, enumerator has been updated
       via  49198147f4feed738b08cf962ecc30dacd636d23 (commit)
      from  c48295fbf49827e0b65b66d7c7048651b0193edc (commit)


Summary of changes:
 src/Snap/Internal/Iteratee/Debug.hs |   35 +++++++++++++++++++++++------------
 src/Snap/Iteratee.hs                |    2 --
 2 files changed, 23 insertions(+), 14 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 49198147f4feed738b08cf962ecc30dacd636d23
Author: Gregory Collins <[email protected]>
Date:   Tue Nov 23 21:40:06 2010 +0100

    Fix iterateeDebugWrapper

diff --git a/src/Snap/Internal/Iteratee/Debug.hs 
b/src/Snap/Internal/Iteratee/Debug.hs
index 9429314..0a18e45 100644
--- a/src/Snap/Internal/Iteratee/Debug.hs
+++ b/src/Snap/Internal/Iteratee/Debug.hs
@@ -42,23 +42,34 @@ debugIteratee = continue f
 
 #ifndef NODEBUG
 
-iterateeDebugWrapper :: String
-                     -> Iteratee ByteString IO a
-                     -> Iteratee ByteString IO a
-iterateeDebugWrapper name iter = Iteratee $ do
-    step <- runIteratee iter
-    return $ Continue $ f step
+iterateeDebugWrapper :: (MonadIO m) =>
+                        String
+                     -> Iteratee ByteString m a
+                     -> Iteratee ByteString m a
+iterateeDebugWrapper name iter = do
+    debug $ name ++ ": BEGIN"
+    step <- lift $ runIteratee iter
+    whatWasReturn step
+    check step
 
   where
-    f step EOF = do
+    whatWasReturn (Continue _) = debug $ name ++ ": continue"
+    whatWasReturn (Yield _ z)  = debug $ name ++ ": yield, with remainder " ++ 
show z
+    whatWasReturn (Error e)    = debug $ name ++ ": error, with " ++ show e
+
+    check (Continue k) = continue $ f k
+    check st           = returnI st
+
+
+    f k EOF = do
         debug $ name ++ ": got EOF"
-        step' <- checkDone (\k -> lift $ runIteratee $ k EOF) step
-        returnI step'
+        k EOF
 
-    f step ch@(Chunks xs) = do
+    f k ch@(Chunks xs) = do
         debug $ name ++ ": got chunk: " ++ show xs
-        step' <- checkDone (\k -> lift $ runIteratee $ k ch) step
-        continue $ f step'
+        step <- lift $ runIteratee $ k ch
+        whatWasReturn step
+        check step
 
 
 #else
diff --git a/src/Snap/Iteratee.hs b/src/Snap/Iteratee.hs
index 36f5e3d..fa02896 100644
--- a/src/Snap/Iteratee.hs
+++ b/src/Snap/Iteratee.hs
@@ -130,8 +130,6 @@ import           System.PosixCompat.Types
 #endif
 
 
-
-
 ------------------------------------------------------------------------------
 instance (Functor m, MonadCatchIO m) =>
          MonadCatchIO (Iteratee s m) where
-----------------------------------------------------------------------


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

Reply via email to