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, master has been updated
via 50cac65ac119d8d913715b3ca4005d7175909007 (commit)
from d0791eb5307f01ec0a038d6ec832f53fc765d25a (commit)
Summary of changes:
src/Snap/Internal/Types.hs | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 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 50cac65ac119d8d913715b3ca4005d7175909007
Author: Carl Howells <[email protected]>
Date: Tue Jul 6 19:59:45 2010 -0700
Add an explicit warning regarding non-strictness on the write* functions
diff --git a/src/Snap/Internal/Types.hs b/src/Snap/Internal/Types.hs
index bcf3931..b856036 100644
--- a/src/Snap/Internal/Types.hs
+++ b/src/Snap/Internal/Types.hs
@@ -387,6 +387,10 @@ addToOutput enum = modifyResponse $ modifyResponseBody (>.
enum)
------------------------------------------------------------------------------
-- | Adds the given strict 'ByteString' to the body of the 'Response' stored in
-- the 'Snap' monad state.
+--
+-- Warning: This function is intentionally non-strict. If any pure
+-- exceptions are raised by the expression creating the 'ByteString',
+-- the exception won't actually be raised within the Snap handler.
writeBS :: ByteString -> Snap ()
writeBS s = addToOutput $ enumBS s
@@ -394,6 +398,10 @@ writeBS s = addToOutput $ enumBS s
------------------------------------------------------------------------------
-- | Adds the given lazy 'L.ByteString' to the body of the 'Response' stored in
-- the 'Snap' monad state.
+--
+-- Warning: This function is intentionally non-strict. If any pure
+-- exceptions are raised by the expression creating the 'ByteString',
+-- the exception won't actually be raised within the Snap handler.
writeLBS :: L.ByteString -> Snap ()
writeLBS s = addToOutput $ enumLBS s
@@ -401,6 +409,10 @@ writeLBS s = addToOutput $ enumLBS s
------------------------------------------------------------------------------
-- | Adds the given strict 'T.Text' to the body of the 'Response' stored in the
-- 'Snap' monad state.
+--
+-- Warning: This function is intentionally non-strict. If any pure
+-- exceptions are raised by the expression creating the 'ByteString',
+-- the exception won't actually be raised within the Snap handler.
writeText :: T.Text -> Snap ()
writeText s = writeBS $ T.encodeUtf8 s
@@ -408,6 +420,10 @@ writeText s = writeBS $ T.encodeUtf8 s
------------------------------------------------------------------------------
-- | Adds the given lazy 'LT.Text' to the body of the 'Response' stored in the
-- 'Snap' monad state.
+--
+-- Warning: This function is intentionally non-strict. If any pure
+-- exceptions are raised by the expression creating the 'ByteString',
+-- the exception won't actually be raised within the Snap handler.
writeLazyText :: LT.Text -> Snap ()
writeLazyText s = writeLBS $ LT.encodeUtf8 s
-----------------------------------------------------------------------
hooks/post-receive
--
snap-core
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap