/usr/share/doc/libghc-happstack-server-doc/html/Happstack-Server-Internal-Compression.html is in libghc-happstack-server-doc 7.3.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Happstack.Server.Internal.Compression</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Happstack-Server-Internal-Compression.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Happstack-Server-Internal-Compression.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">happstack-server-7.3.7: Web related tools and services.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Happstack.Server.Internal.Compression</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Filter for compressing the <code><a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></code> body.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:compressedResponseFilter">compressedResponseFilter</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m, <a href="Happstack-Server-Internal-Monads.html#t:WebMonad">WebMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m) => m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:compressWithFilter">compressWithFilter</a> :: <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m => (<a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a> -> m ()</li><li class="src short"><a href="#v:gzipFilter">gzipFilter</a> :: <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a> -> m ()</li><li class="src short"><a href="#v:deflateFilter">deflateFilter</a> :: <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a> -> m ()</li><li class="src short"><a href="#v:encodings">encodings</a> :: GenParser <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Char.html#t:Char">Char</a> st [(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Double">Double</a>)]</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:compressedResponseFilter" class="def">compressedResponseFilter</a><a href="src/Happstack-Server-Internal-Compression.html#compressedResponseFilter" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m, <a href="Happstack-Server-Internal-Monads.html#t:WebMonad">WebMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>name of the encoding chosen
</p></td></tr></table></div><div class="doc"><p>reads the <code>Accept-Encoding</code> header. Then, if possible
will compress the response body with methods <code>gzip</code> or <code>deflate</code>.
</p><pre> main =
simpleHTTP nullConf $
do str <- compressedResponseFilter
return $ toResponse ("This response compressed using: " ++ str)
</pre></div></div><div class="top"><p class="src"><a name="v:compressWithFilter" class="def">compressWithFilter</a><a href="src/Happstack-Server-Internal-Compression.html#compressWithFilter" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m</td><td class="doc empty"> </td></tr><tr><td class="src">=> (<a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>)</td><td class="doc"><p>function to compress the body
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>encoding to use for Content-Encoding header
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></td><td class="doc"><p>fallback to identity for SendFile
</p></td></tr><tr><td class="src">-> m ()</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Ignore the <code>Accept-Encoding</code> header in the <code><a href="Happstack-Server-Internal-Types.html#t:Request">Request</a></code> and attempt to compress the body of the response using the supplied compressor.
</p><p>We can not compress files being transfered using <code><a href="Happstack-Server-Internal-Types.html#v:SendFile">SendFile</a></code>. If
<code>identity</code> is an allowed encoding, then just return the <code><a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></code>
unmodified. Otherwise we return <a href="406 Not Acceptable.html">406 Not Acceptable</a>.
</p><p>see also: <code><a href="Happstack-Server-Internal-Compression.html#v:gzipFilter">gzipFilter</a></code> and <code>defaultFilter</code>
</p></div></div><div class="top"><p class="src"><a name="v:gzipFilter" class="def">gzipFilter</a><a href="src/Happstack-Server-Internal-Compression.html#gzipFilter" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m</td><td class="doc empty"> </td></tr><tr><td class="src">=> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>encoding to use for Content-Encoding header
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></td><td class="doc"><p>fallback to identity for SendFile
</p></td></tr><tr><td class="src">-> m ()</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Ignore the <code>Accept-Encoding</code> header in the <code><a href="Happstack-Server-Internal-Types.html#t:Request">Request</a></code> and attempt to compress the body of the response with <code>gzip</code>.
</p><p>calls <code><a href="Happstack-Server-Internal-Compression.html#v:compressWithFilter">compressWithFilter</a></code> using <code><a href="/usr/share/doc/libghc-zlib-doc/html/Codec-Compression-GZip.html#v:compress">compress</a></code>.
</p><p>see also: <code><a href="Happstack-Server-Internal-Compression.html#v:compressedResponseFilter">compressedResponseFilter</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:deflateFilter" class="def">deflateFilter</a><a href="src/Happstack-Server-Internal-Compression.html#deflateFilter" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m</td><td class="doc empty"> </td></tr><tr><td class="src">=> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>encoding to use for Content-Encoding header
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></td><td class="doc"><p>fallback to identity for SendFile
</p></td></tr><tr><td class="src">-> m ()</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Ignore the <code>Accept-Encoding</code> header in the <code><a href="Happstack-Server-Internal-Types.html#t:Request">Request</a></code> and attempt compress the body of the response with zlib's
<code>deflate</code> method
</p><p>calls <code><a href="Happstack-Server-Internal-Compression.html#v:compressWithFilter">compressWithFilter</a></code> using <code><a href="/usr/share/doc/libghc-zlib-doc/html/Codec-Compression-Zlib.html#v:compress">compress</a></code>.
</p><p>see also: <code><a href="Happstack-Server-Internal-Compression.html#v:compressedResponseFilter">compressedResponseFilter</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:encodings" class="def">encodings</a> :: GenParser <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Char.html#t:Char">Char</a> st [(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Double">Double</a>)]<a href="src/Happstack-Server-Internal-Compression.html#encodings" class="link">Source</a></p><div class="doc"><p>a parser for the Accept-Encoding header
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
|