This file is indexed.

/usr/share/doc/libghc-enclosed-exceptions-doc/html/Control-Exception-Enclosed.html is in libghc-enclosed-exceptions-doc 1.0.0.2-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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!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>Control.Exception.Enclosed</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_Control-Exception-Enclosed.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Control-Exception-Enclosed.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">enclosed-exceptions-1.0.0.2: Catching all exceptions from within an enclosed computation</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">Control.Exception.Enclosed</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Exceptions
</a></li><li><a href="#g:2">Force types
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>The purpose of this module is to allow you to capture all exceptions
 originating from within the enclosed computation, while still reacting
 to asynchronous exceptions aimed at the calling thread.
</p><p>This way, you can be sure that the function that calls, for example,
 <code><code><a href="Control-Exception-Enclosed.html#v:catchAny">catchAny</a></code></code>, will still respond to <code><code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#v:ThreadKilled">ThreadKilled</a></code></code> or <code><code>Timeout</code></code>
 events raised by another thread (with <code><code><a href="/usr/share/doc/libghc-lifted-base-doc/html/Control-Exception-Lifted.html#v:throwTo">throwTo</a></code></code>), while capturing
 all exceptions, synchronous or asynchronous, resulting from the
 execution of the enclosed computation.
</p><p>One particular use case is to allow the safe execution of code from various
 libraries (which you do not control), capturing any faults that might
 occur, while remaining responsive to higher level events and control
 actions.
</p><p>This library was originally developed by Michael Snoyman for the
 <code>ClassyPrelude</code> library, and was latter 'spun-off' into a separate
 independent package.
</p><p>For a more detailed explanation of the motivation behind this functions,
 see:
</p><p><a href="https://www.fpcomplete.com/user/snoyberg/general-haskell/exceptions/catching-all-exceptions">https://www.fpcomplete.com/user/snoyberg/general-haskell/exceptions/catching-all-exceptions</a>
</p><p>and
</p><p><a href="https://groups.google.com/forum/#!topic/haskell-cafe/e9H2I-3uVJE">https://groups.google.com/forum/#!topic/haskell-cafe/e9H2I-3uVJE</a>
</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:catchAny">catchAny</a> :: <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m =&gt; m a -&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a> -&gt; m a) -&gt; m a</li><li class="src short"><a href="#v:handleAny">handleAny</a> :: <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m =&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a> -&gt; m a) -&gt; m a -&gt; m a</li><li class="src short"><a href="#v:tryAny">tryAny</a> :: <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m =&gt; m a -&gt; m (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a> a)</li><li class="src short"><a href="#v:catchAnyDeep">catchAnyDeep</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/deepseq-1.3.0.1/Control-DeepSeq.html#t:NFData">NFData</a> a, <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m) =&gt; m a -&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a> -&gt; m a) -&gt; m a</li><li class="src short"><a href="#v:handleAnyDeep">handleAnyDeep</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/deepseq-1.3.0.1/Control-DeepSeq.html#t:NFData">NFData</a> a, <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m) =&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a> -&gt; m a) -&gt; m a -&gt; m a</li><li class="src short"><a href="#v:tryAnyDeep">tryAnyDeep</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/deepseq-1.3.0.1/Control-DeepSeq.html#t:NFData">NFData</a> a, <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m) =&gt; m a -&gt; m (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a> a)</li><li class="src short"><a href="#v:catchIO">catchIO</a> :: <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m =&gt; m a -&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:IOException">IOException</a> -&gt; m a) -&gt; m a</li><li class="src short"><a href="#v:handleIO">handleIO</a> :: <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m =&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:IOException">IOException</a> -&gt; m a) -&gt; m a -&gt; m a</li><li class="src short"><a href="#v:tryIO">tryIO</a> :: <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m =&gt; m a -&gt; m (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:IOException">IOException</a> a)</li><li class="src short"><a href="#v:asIOException">asIOException</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:IOException">IOException</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:IOException">IOException</a></li><li class="src short"><a href="#v:asSomeException">asSomeException</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a></li></ul></div><div id="interface"><h2 id="g:1">Exceptions
</h2><div class="top"><p class="src"><a name="v:catchAny" class="def">catchAny</a> :: <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m =&gt; m a -&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a> -&gt; m a) -&gt; m a<a href="src/Control-Exception-Enclosed.html#catchAny" class="link">Source</a></p><div class="doc"><p>A version of <code><a href="/usr/share/doc/libghc-lifted-base-doc/html/Control-Exception-Lifted.html#v:catch">catch</a></code> which is specialized for any exception. This
 simplifies usage as no explicit type signatures are necessary.
</p><p>Note that since version 0.5.9, this function now has proper support for
 asynchronous exceptions, by only catching exceptions generated by the
 internal (enclosed) action.
</p><p>Since 0.5.6
</p></div></div><div class="top"><p class="src"><a name="v:handleAny" class="def">handleAny</a> :: <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m =&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a> -&gt; m a) -&gt; m a -&gt; m a<a href="src/Control-Exception-Enclosed.html#handleAny" class="link">Source</a></p><div class="doc"><p>A version of <code><a href="/usr/share/doc/libghc-lifted-base-doc/html/Control-Exception-Lifted.html#v:handle">handle</a></code> which is specialized for any exception.  This
 simplifies usage as no explicit type signatures are necessary.
</p><p>Note that since version 0.5.9, this function now has proper support for
 asynchronous exceptions, by only catching exceptions generated by the
 internal (enclosed) action.
</p><p>Since 0.5.6
</p></div></div><div class="top"><p class="src"><a name="v:tryAny" class="def">tryAny</a> :: <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m =&gt; m a -&gt; m (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a> a)<a href="src/Control-Exception-Enclosed.html#tryAny" class="link">Source</a></p><div class="doc"><p>A version of <code><a href="/usr/share/doc/libghc-lifted-base-doc/html/Control-Exception-Lifted.html#v:try">try</a></code> which is specialized for any exception.
 This simplifies usage as no explicit type signatures are necessary.
</p><p>Note that since version 0.5.9, this function now has proper support for
 asynchronous exceptions, by only catching exceptions generated by the
 internal (enclosed) action.
</p><p>Since 0.5.6
</p></div></div><div class="top"><p class="src"><a name="v:catchAnyDeep" class="def">catchAnyDeep</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/deepseq-1.3.0.1/Control-DeepSeq.html#t:NFData">NFData</a> a, <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m) =&gt; m a -&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a> -&gt; m a) -&gt; m a<a href="src/Control-Exception-Enclosed.html#catchAnyDeep" class="link">Source</a></p><div class="doc"><p>An extension to <code>catchAny</code> which ensures that the return value is fully
 evaluated. See <code>tryAnyDeep</code>.
</p><p>Since 0.5.9
</p></div></div><div class="top"><p class="src"><a name="v:handleAnyDeep" class="def">handleAnyDeep</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/deepseq-1.3.0.1/Control-DeepSeq.html#t:NFData">NFData</a> a, <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m) =&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a> -&gt; m a) -&gt; m a -&gt; m a<a href="src/Control-Exception-Enclosed.html#handleAnyDeep" class="link">Source</a></p><div class="doc"><pre>flip catchAnyDeep</pre><p>Since 0.5.6
</p></div></div><div class="top"><p class="src"><a name="v:tryAnyDeep" class="def">tryAnyDeep</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/deepseq-1.3.0.1/Control-DeepSeq.html#t:NFData">NFData</a> a, <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m) =&gt; m a -&gt; m (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a> a)<a href="src/Control-Exception-Enclosed.html#tryAnyDeep" class="link">Source</a></p><div class="doc"><p>An extension to <code>tryAny</code> which ensures that the return value is fully
 evaluated. In other words, if you get a <code>Right</code> response here, you can be
 confident that using it will not result in another exception.
</p><p>Since 0.5.9
</p></div></div><div class="top"><p class="src"><a name="v:catchIO" class="def">catchIO</a> :: <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m =&gt; m a -&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:IOException">IOException</a> -&gt; m a) -&gt; m a<a href="src/Control-Exception-Enclosed.html#catchIO" class="link">Source</a></p><div class="doc"><p>A version of <code><a href="/usr/share/doc/libghc-lifted-base-doc/html/Control-Exception-Lifted.html#v:catch">catch</a></code> which is specialized for IO exceptions. This
 simplifies usage as no explicit type signatures are necessary.
</p><p>Since 0.5.6
</p></div></div><div class="top"><p class="src"><a name="v:handleIO" class="def">handleIO</a> :: <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m =&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:IOException">IOException</a> -&gt; m a) -&gt; m a -&gt; m a<a href="src/Control-Exception-Enclosed.html#handleIO" class="link">Source</a></p><div class="doc"><p>A version of <code><a href="/usr/share/doc/libghc-lifted-base-doc/html/Control-Exception-Lifted.html#v:handle">handle</a></code> which is specialized for IO exceptions.  This
 simplifies usage as no explicit type signatures are necessary.
</p><p>Since 0.5.6
</p></div></div><div class="top"><p class="src"><a name="v:tryIO" class="def">tryIO</a> :: <a href="/usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl">MonadBaseControl</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> m =&gt; m a -&gt; m (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:IOException">IOException</a> a)<a href="src/Control-Exception-Enclosed.html#tryIO" class="link">Source</a></p><div class="doc"><p>A version of <code><a href="/usr/share/doc/libghc-lifted-base-doc/html/Control-Exception-Lifted.html#v:try">try</a></code> which is specialized for IO exceptions.
 This simplifies usage as no explicit type signatures are necessary.
</p><p>Since 0.5.6
</p></div></div><h2 id="g:2">Force types
</h2><div class="doc"><p>Helper functions for situations where type inferer gets confused.
</p></div><div class="top"><p class="src"><a name="v:asIOException" class="def">asIOException</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:IOException">IOException</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:IOException">IOException</a><a href="src/Control-Exception-Enclosed.html#asIOException" class="link">Source</a></p><div class="doc"><p>Since 0.5.6
</p></div></div><div class="top"><p class="src"><a name="v:asSomeException" class="def">asSomeException</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Exception-Base.html#t:SomeException">SomeException</a><a href="src/Control-Exception-Enclosed.html#asSomeException" class="link">Source</a></p><div class="doc"><p>Since 0.5.6
</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>