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, 0.3 has been updated
via 39d6c07898c19474bbfca0d8306d93e4c74c716f (commit)
from 4e5e8eb4cb744dc48b7888bcd8609e30b76688e3 (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 39d6c07898c19474bbfca0d8306d93e4c74c716f
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 10a7a71..1135dda 100644
--- a/src/Snap/Internal/Types.hs
+++ b/src/Snap/Internal/Types.hs
@@ -428,6 +428,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 :: MonadSnap m => ByteString -> m ()
writeBS s = addToOutput $ enumBS s
@@ -435,6 +439,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 :: MonadSnap m => L.ByteString -> m ()
writeLBS s = addToOutput $ enumLBS s
@@ -442,6 +450,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 :: MonadSnap m => T.Text -> m ()
writeText s = writeBS $ T.encodeUtf8 s
@@ -449,6 +461,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 :: MonadSnap m => LT.Text -> m ()
writeLazyText s = writeLBS $ LT.encodeUtf8 s
-----------------------------------------------------------------------
hooks/post-receive
--
snap-core
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap