@@ -63,6 +63,16 @@ data Request = Request
6363 }
6464 deriving (Typeable)
6565
66+-- | The strange structure of the third field or ResponseSource is to allow for
67+-- exception-safe resource allocation. As an example:
68+--
69+-- > app :: Application
70+-- > app _ = return $ ResponseSource status200 [] $ \f -> bracket
71+-- > (putStrLn "Allocation" >> return 5)
72+-- > (\i -> putStrLn $ "Cleaning up: " ++ show i)
73+-- > (\_ -> f $ do
74+-- > yield $ Chunk $ fromByteString "Hello "
75+-- > yield $ Chunk $ fromByteString "World!")
6676data Response
6777 = ResponseFile H.Status H.ResponseHeaders FilePath (Maybe FilePart)
6878 | ResponseBuilder H.Status H.ResponseHeaders Builder