/usr/share/doc/libghc-safe-exceptions-doc/html/Control-Exception-Safe.html is in libghc-safe-exceptions-doc 0.1.4.0-4.
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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | <!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.Safe</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Control-Exception-Safe.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Control-Exception-Safe.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">safe-exceptions-0.1.4.0: Safe, consistent, and easy exception handling</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>Safe</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Control.Exception.Safe</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Throwing</a></li><li><a href="#g:2">Catching (with recovery)</a></li><li><a href="#g:3">Cleanup (no recovery)</a></li><li><a href="#g:4">Coercion to sync and async</a></li><li><a href="#g:5">Check exception type</a></li><li><a href="#g:6">Reexports</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Please see the README.md file in the safe-exceptions repo for
information on how to use this module. Relevant links:</p><ul><li><a href="https://github.com/fpco/safe-exceptions#readme">https://github.com/fpco/safe-exceptions#readme</a></li><li><a href="https://www.stackage.org/package/safe-exceptions">https://www.stackage.org/package/safe-exceptions</a></li></ul></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:throw">throw</a> :: (<a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => e -> m a</li><li class="src short"><a href="#v:throwIO">throwIO</a> :: (<a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => e -> m a</li><li class="src short"><a href="#v:throwM">throwM</a> :: (<a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => e -> m a</li><li class="src short"><a href="#v:throwTo">throwTo</a> :: (<a href="Control-Exception-Safe.html#t:Exception">Exception</a> e, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m) => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Concurrent.html#t:ThreadId">ThreadId</a> -> e -> m ()</li><li class="src short"><a href="#v:impureThrow">impureThrow</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> a</li><li class="src short"><a href="#v:catch">catch</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => m a -> (e -> m a) -> m a</li><li class="src short"><a href="#v:catchIO">catchIO</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => m a -> (<a href="Control-Exception-Safe.html#t:IOException">IOException</a> -> m a) -> m a</li><li class="src short"><a href="#v:catchAny">catchAny</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => m a -> (<a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> m a) -> m a</li><li class="src short"><a href="#v:catchDeep">catchDeep</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> a) => m a -> (e -> m a) -> m a</li><li class="src short"><a href="#v:catchAnyDeep">catchAnyDeep</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> a) => m a -> (<a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> m a) -> m a</li><li class="src short"><a href="#v:catchAsync">catchAsync</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => m a -> (e -> m a) -> m a</li><li class="src short"><a href="#v:catchJust">catchJust</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> b) -> m a -> (b -> m a) -> m a</li><li class="src short"><a href="#v:handle">handle</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => (e -> m a) -> m a -> m a</li><li class="src short"><a href="#v:handleIO">handleIO</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => (<a href="Control-Exception-Safe.html#t:IOException">IOException</a> -> m a) -> m a -> m a</li><li class="src short"><a href="#v:handleAny">handleAny</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => (<a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> m a) -> m a -> m a</li><li class="src short"><a href="#v:handleDeep">handleDeep</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> a) => (e -> m a) -> m a -> m a</li><li class="src short"><a href="#v:handleAnyDeep">handleAnyDeep</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> a) => (<a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> m a) -> m a -> m a</li><li class="src short"><a href="#v:handleAsync">handleAsync</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => (e -> m a) -> m a -> m a</li><li class="src short"><a href="#v:handleJust">handleJust</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> b) -> (b -> m a) -> m a -> m a</li><li class="src short"><a href="#v:try">try</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => m a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e a)</li><li class="src short"><a href="#v:tryIO">tryIO</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => m a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> <a href="Control-Exception-Safe.html#t:IOException">IOException</a> a)</li><li class="src short"><a href="#v:tryAny">tryAny</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => m a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> a)</li><li class="src short"><a href="#v:tryDeep">tryDeep</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> a) => m a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e a)</li><li class="src short"><a href="#v:tryAnyDeep">tryAnyDeep</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> a) => m a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> a)</li><li class="src short"><a href="#v:tryAsync">tryAsync</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => m a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e a)</li><li class="src short"><a href="#v:tryJust">tryJust</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> b) -> m a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> b a)</li><li class="src short"><span class="keyword">data</span> <a href="#t:Handler">Handler</a> m a = <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="#v:Handler">Handler</a> (e -> m a)</li><li class="src short"><a href="#v:catches">catches</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m) => m a -> [<a href="Control-Exception-Safe.html#t:Handler">Handler</a> m a] -> m a</li><li class="src short"><a href="#v:catchesDeep">catchesDeep</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> a) => m a -> [<a href="Control-Exception-Safe.html#t:Handler">Handler</a> m a] -> m a</li><li class="src short"><a href="#v:catchesAsync">catchesAsync</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m) => m a -> [<a href="Control-Exception-Safe.html#t:Handler">Handler</a> m a] -> m a</li><li class="src short"><a href="#v:onException">onException</a> :: <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> m b -> m a</li><li class="src short"><a href="#v:bracket">bracket</a> :: <span class="keyword">forall</span> m a b c. <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> (a -> m b) -> (a -> m c) -> m c</li><li class="src short"><a href="#v:bracket_">bracket_</a> :: <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> m b -> m c -> m c</li><li class="src short"><a href="#v:finally">finally</a> :: <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> m b -> m a</li><li class="src short"><a href="#v:withException">withException</a> :: (<a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => m a -> (e -> m b) -> m a</li><li class="src short"><a href="#v:bracketOnError">bracketOnError</a> :: <span class="keyword">forall</span> m a b c. <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> (a -> m b) -> (a -> m c) -> m c</li><li class="src short"><a href="#v:bracketOnError_">bracketOnError_</a> :: <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> m b -> m c -> m c</li><li class="src short"><span class="keyword">data</span> <a href="#t:SyncExceptionWrapper">SyncExceptionWrapper</a> = <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="#v:SyncExceptionWrapper">SyncExceptionWrapper</a> e</li><li class="src short"><a href="#v:toSyncException">toSyncException</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:AsyncExceptionWrapper">AsyncExceptionWrapper</a> = <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="#v:AsyncExceptionWrapper">AsyncExceptionWrapper</a> e</li><li class="src short"><a href="#v:toAsyncException">toAsyncException</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a></li><li class="src short"><a href="#v:isSyncException">isSyncException</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isAsyncException">isAsyncException</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><span class="keyword">class</span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="#t:MonadThrow">MonadThrow</a> m</li><li class="src short"><span class="keyword">class</span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m => <a href="#t:MonadCatch">MonadCatch</a> m</li><li class="src short"><span class="keyword">class</span> <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => <a href="#t:MonadMask">MonadMask</a> m <span class="keyword">where</span><ul class="subs"><li><a href="#v:mask">mask</a> :: ((<span class="keyword">forall</span> a. m a -> m a) -> m b) -> m b</li><li><a href="#v:uninterruptibleMask">uninterruptibleMask</a> :: ((<span class="keyword">forall</span> a. m a -> m a) -> m b) -> m b</li></ul></li><li class="src short"><a href="#v:mask_">mask_</a> :: <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> m a</li><li class="src short"><a href="#v:uninterruptibleMask_">uninterruptibleMask_</a> :: <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> m a</li><li class="src short"><a href="#v:catchIOError">catchIOError</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => m a -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO-Error.html#t:IOError">IOError</a> -> m a) -> m a</li><li class="src short"><a href="#v:handleIOError">handleIOError</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO-Error.html#t:IOError">IOError</a> -> m a) -> m a -> m a</li><li class="src short"><span class="keyword">class</span> (<a href="Control-Exception-Safe.html#t:Typeable">Typeable</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> e, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> e) => <a href="#t:Exception">Exception</a> e <span class="keyword">where</span><ul class="subs"><li><a href="#v:toException">toException</a> :: e -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a></li><li><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> e</li><li><a href="#v:displayException">displayException</a> :: e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li></ul></li><li class="src short"><span class="keyword">class</span> <a href="#t:Typeable">Typeable</a> k a</li><li class="src short"><span class="keyword">data</span> <a href="#t:SomeException">SomeException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> <span class="keyword">where</span><ul class="subs"><li><a href="#v:SomeException">SomeException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a></li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:SomeAsyncException">SomeAsyncException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> <span class="keyword">where</span><ul class="subs"><li><a href="#v:SomeAsyncException">SomeAsyncException</a> :: <a href="Control-Exception-Safe.html#t:SomeAsyncException">SomeAsyncException</a></li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:IOException">IOException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a></li></ul></div><div id="interface"><h1 id="g:1">Throwing</h1><div class="top"><p class="src"><a id="v:throw" class="def">throw</a> :: (<a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => e -> m a <a href="src/Control-Exception-Safe.html#throw" class="link">Source</a> <a href="#v:throw" class="selflink">#</a></p><div class="doc"><p>Synchronously throw the given exception</p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:throwIO" class="def">throwIO</a> :: (<a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => e -> m a <a href="src/Control-Exception-Safe.html#throwIO" class="link">Source</a> <a href="#v:throwIO" class="selflink">#</a></p><div class="doc"><p>Synonym for <code><a href="Control-Exception-Safe.html#v:throw">throw</a></code></p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:throwM" class="def">throwM</a> :: (<a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => e -> m a <a href="src/Control-Exception-Safe.html#throwM" class="link">Source</a> <a href="#v:throwM" class="selflink">#</a></p><div class="doc"><p>Synonym for <code><a href="Control-Exception-Safe.html#v:throw">throw</a></code></p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:throwTo" class="def">throwTo</a> :: (<a href="Control-Exception-Safe.html#t:Exception">Exception</a> e, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m) => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Concurrent.html#t:ThreadId">ThreadId</a> -> e -> m () <a href="src/Control-Exception-Safe.html#throwTo" class="link">Source</a> <a href="#v:throwTo" class="selflink">#</a></p><div class="doc"><p>Throw an asynchronous exception to another thread</p><p>It's usually a better idea to use the async package, see
<a href="https://github.com/fpco/safe-exceptions#quickstart">https://github.com/fpco/safe-exceptions#quickstart</a></p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:impureThrow" class="def">impureThrow</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> a <a href="src/Control-Exception-Safe.html#impureThrow" class="link">Source</a> <a href="#v:impureThrow" class="selflink">#</a></p><div class="doc"><p>Generate a pure value which, when forced, will synchronously
throw the given exception</p><p>Generally it's better to avoid using this function and instead use <code><a href="Control-Exception-Safe.html#v:throw">throw</a></code>,
see <a href="https://github.com/fpco/safe-exceptions#quickstart">https://github.com/fpco/safe-exceptions#quickstart</a></p><p><em>Since: 0.1.0.0</em></p></div></div><h1 id="g:2">Catching (with recovery)</h1><div class="top"><p class="src"><a id="v:catch" class="def">catch</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => m a -> (e -> m a) -> m a <a href="src/Control-Exception-Safe.html#catch" class="link">Source</a> <a href="#v:catch" class="selflink">#</a></p><div class="doc"><p>Same as upstream <code><a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#v:catch">catch</a></code>, but will not catch asynchronous
exceptions</p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:catchIO" class="def">catchIO</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => m a -> (<a href="Control-Exception-Safe.html#t:IOException">IOException</a> -> m a) -> m a <a href="src/Control-Exception-Safe.html#catchIO" class="link">Source</a> <a href="#v:catchIO" class="selflink">#</a></p><div class="doc"><p><code><a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#v:catch">catch</a></code> specialized to only catching <code><a href="Control-Exception-Safe.html#t:IOException">IOException</a></code>s</p><p><em>Since: 0.1.3.0</em></p></div></div><div class="top"><p class="src"><a id="v:catchAny" class="def">catchAny</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => m a -> (<a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> m a) -> m a <a href="src/Control-Exception-Safe.html#catchAny" class="link">Source</a> <a href="#v:catchAny" class="selflink">#</a></p><div class="doc"><p><code><a href="Control-Exception-Safe.html#v:catch">catch</a></code> specialized to catch all synchronous exception</p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:catchDeep" class="def">catchDeep</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> a) => m a -> (e -> m a) -> m a <a href="src/Control-Exception-Safe.html#catchDeep" class="link">Source</a> <a href="#v:catchDeep" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Control-Exception-Safe.html#v:catch">catch</a></code>, but fully force evaluation of the result value
to find all impure exceptions.</p><p><em>Since: 0.1.1.0</em></p></div></div><div class="top"><p class="src"><a id="v:catchAnyDeep" class="def">catchAnyDeep</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> a) => m a -> (<a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> m a) -> m a <a href="src/Control-Exception-Safe.html#catchAnyDeep" class="link">Source</a> <a href="#v:catchAnyDeep" class="selflink">#</a></p><div class="doc"><p><code><a href="Control-Exception-Safe.html#v:catchDeep">catchDeep</a></code> specialized to catch all synchronous exception</p><p><em>Since: 0.1.1.0</em></p></div></div><div class="top"><p class="src"><a id="v:catchAsync" class="def">catchAsync</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => m a -> (e -> m a) -> m a <a href="src/Control-Exception-Safe.html#catchAsync" class="link">Source</a> <a href="#v:catchAsync" class="selflink">#</a></p><div class="doc"><p><code><a href="Control-Exception-Safe.html#v:catch">catch</a></code> without async exception safety</p><p>Generally it's better to avoid using this function since we do not want to
recover from async exceptions, see
<a href="https://github.com/fpco/safe-exceptions#quickstart">https://github.com/fpco/safe-exceptions#quickstart</a></p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:catchJust" class="def">catchJust</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> b) -> m a -> (b -> m a) -> m a <a href="src/Control-Exception-Safe.html#catchJust" class="link">Source</a> <a href="#v:catchJust" class="selflink">#</a></p><div class="doc"><p><code><a href="Control-Exception-Safe.html#v:catchJust">catchJust</a></code> is like <code><a href="Control-Exception-Safe.html#v:catch">catch</a></code> but it takes an extra argument which
is an exception predicate, a function which selects which type of
exceptions we're interested in.</p><p><em>Since: 0.1.4.0</em></p></div></div><div class="top"><p class="src"><a id="v:handle" class="def">handle</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => (e -> m a) -> m a -> m a <a href="src/Control-Exception-Safe.html#handle" class="link">Source</a> <a href="#v:handle" class="selflink">#</a></p><div class="doc"><p>Flipped version of <code><a href="Control-Exception-Safe.html#v:catch">catch</a></code></p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:handleIO" class="def">handleIO</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => (<a href="Control-Exception-Safe.html#t:IOException">IOException</a> -> m a) -> m a -> m a <a href="src/Control-Exception-Safe.html#handleIO" class="link">Source</a> <a href="#v:handleIO" class="selflink">#</a></p><div class="doc"><p><code><a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#v:handle">handle</a></code> specialized to only catching <code><a href="Control-Exception-Safe.html#t:IOException">IOException</a></code>s</p><p><em>Since: 0.1.3.0</em></p></div></div><div class="top"><p class="src"><a id="v:handleAny" class="def">handleAny</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => (<a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> m a) -> m a -> m a <a href="src/Control-Exception-Safe.html#handleAny" class="link">Source</a> <a href="#v:handleAny" class="selflink">#</a></p><div class="doc"><p>Flipped version of <code><a href="Control-Exception-Safe.html#v:catchAny">catchAny</a></code></p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:handleDeep" class="def">handleDeep</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> a) => (e -> m a) -> m a -> m a <a href="src/Control-Exception-Safe.html#handleDeep" class="link">Source</a> <a href="#v:handleDeep" class="selflink">#</a></p><div class="doc"><p>Flipped version of <code><a href="Control-Exception-Safe.html#v:catchDeep">catchDeep</a></code></p><p><em>Since: 0.1.1.0</em></p></div></div><div class="top"><p class="src"><a id="v:handleAnyDeep" class="def">handleAnyDeep</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> a) => (<a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> m a) -> m a -> m a <a href="src/Control-Exception-Safe.html#handleAnyDeep" class="link">Source</a> <a href="#v:handleAnyDeep" class="selflink">#</a></p><div class="doc"><p>Flipped version of <code><a href="Control-Exception-Safe.html#v:catchAnyDeep">catchAnyDeep</a></code></p><p><em>Since: 0.1.1.0</em></p></div></div><div class="top"><p class="src"><a id="v:handleAsync" class="def">handleAsync</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => (e -> m a) -> m a -> m a <a href="src/Control-Exception-Safe.html#handleAsync" class="link">Source</a> <a href="#v:handleAsync" class="selflink">#</a></p><div class="doc"><p>Flipped version of <code><a href="Control-Exception-Safe.html#v:catchAsync">catchAsync</a></code></p><p>Generally it's better to avoid using this function since we do not want to
recover from async exceptions, see
<a href="https://github.com/fpco/safe-exceptions#quickstart">https://github.com/fpco/safe-exceptions#quickstart</a></p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:handleJust" class="def">handleJust</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> b) -> (b -> m a) -> m a -> m a <a href="src/Control-Exception-Safe.html#handleJust" class="link">Source</a> <a href="#v:handleJust" class="selflink">#</a></p><div class="doc"><p>Flipped <code><a href="Control-Exception-Safe.html#v:catchJust">catchJust</a></code>.</p><p><em>Since: 0.1.4.0</em></p></div></div><div class="top"><p class="src"><a id="v:try" class="def">try</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => m a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e a) <a href="src/Control-Exception-Safe.html#try" class="link">Source</a> <a href="#v:try" class="selflink">#</a></p><div class="doc"><p>Same as upstream <code><a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#v:try">try</a></code>, but will not catch asynchronous
exceptions</p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:tryIO" class="def">tryIO</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => m a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> <a href="Control-Exception-Safe.html#t:IOException">IOException</a> a) <a href="src/Control-Exception-Safe.html#tryIO" class="link">Source</a> <a href="#v:tryIO" class="selflink">#</a></p><div class="doc"><p><code><a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#v:try">try</a></code> specialized to only catching <code><a href="Control-Exception-Safe.html#t:IOException">IOException</a></code>s</p><p><em>Since: 0.1.3.0</em></p></div></div><div class="top"><p class="src"><a id="v:tryAny" class="def">tryAny</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => m a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> a) <a href="src/Control-Exception-Safe.html#tryAny" class="link">Source</a> <a href="#v:tryAny" class="selflink">#</a></p><div class="doc"><p><code><a href="Control-Exception-Safe.html#v:try">try</a></code> specialized to catch all synchronous exceptions</p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:tryDeep" class="def">tryDeep</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> a) => m a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e a) <a href="src/Control-Exception-Safe.html#tryDeep" class="link">Source</a> <a href="#v:tryDeep" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Control-Exception-Safe.html#v:try">try</a></code>, but fully force evaluation of the result value
to find all impure exceptions.</p><p><em>Since: 0.1.1.0</em></p></div></div><div class="top"><p class="src"><a id="v:tryAnyDeep" class="def">tryAnyDeep</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> a) => m a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> a) <a href="src/Control-Exception-Safe.html#tryAnyDeep" class="link">Source</a> <a href="#v:tryAnyDeep" class="selflink">#</a></p><div class="doc"><p><code><a href="Control-Exception-Safe.html#v:tryDeep">tryDeep</a></code> specialized to catch all synchronous exceptions</p><p><em>Since: 0.1.1.0</em></p></div></div><div class="top"><p class="src"><a id="v:tryAsync" class="def">tryAsync</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => m a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e a) <a href="src/Control-Exception-Safe.html#tryAsync" class="link">Source</a> <a href="#v:tryAsync" class="selflink">#</a></p><div class="doc"><p><code><a href="Control-Exception-Safe.html#v:try">try</a></code> without async exception safety</p><p>Generally it's better to avoid using this function since we do not want to
recover from async exceptions, see
<a href="https://github.com/fpco/safe-exceptions#quickstart">https://github.com/fpco/safe-exceptions#quickstart</a></p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:tryJust" class="def">tryJust</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> b) -> m a -> m (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> b a) <a href="src/Control-Exception-Safe.html#tryJust" class="link">Source</a> <a href="#v:tryJust" class="selflink">#</a></p><div class="doc"><p>A variant of <code><a href="Control-Exception-Safe.html#v:try">try</a></code> that takes an exception predicate to select
which exceptions are caught.</p><p><em>Since: 0.1.4.0</em></p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Handler" class="def">Handler</a> m a <a href="src/Control-Exception-Safe.html#Handler" class="link">Source</a> <a href="#t:Handler" class="selflink">#</a></p><div class="doc"><p>You need this when using <code><a href="Control-Exception-Safe.html#v:catches">catches</a></code>.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a id="v:Handler" class="def">Handler</a> (e -> m a)</td><td class="doc empty"> </td></tr></table></div></div><div class="top"><p class="src"><a id="v:catches" class="def">catches</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m) => m a -> [<a href="Control-Exception-Safe.html#t:Handler">Handler</a> m a] -> m a <a href="src/Control-Exception-Safe.html#catches" class="link">Source</a> <a href="#v:catches" class="selflink">#</a></p><div class="doc"><p>Same as upstream <code><a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#v:catches">catches</a></code>, but will not catch asynchronous
exceptions</p><p><em>Since: 0.1.2.0</em></p></div></div><div class="top"><p class="src"><a id="v:catchesDeep" class="def">catchesDeep</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> a) => m a -> [<a href="Control-Exception-Safe.html#t:Handler">Handler</a> m a] -> m a <a href="src/Control-Exception-Safe.html#catchesDeep" class="link">Source</a> <a href="#v:catchesDeep" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Control-Exception-Safe.html#v:catches">catches</a></code>, but fully force evaluation of the result value
to find all impure exceptions.</p><p><em>Since: 0.1.2.0</em></p></div></div><div class="top"><p class="src"><a id="v:catchesAsync" class="def">catchesAsync</a> :: (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m) => m a -> [<a href="Control-Exception-Safe.html#t:Handler">Handler</a> m a] -> m a <a href="src/Control-Exception-Safe.html#catchesAsync" class="link">Source</a> <a href="#v:catchesAsync" class="selflink">#</a></p><div class="doc"><p><code><a href="Control-Exception-Safe.html#v:catches">catches</a></code> without async exception safety</p><p>Generally it's better to avoid using this function since we do not want to
recover from async exceptions, see
<a href="https://github.com/fpco/safe-exceptions#quickstart">https://github.com/fpco/safe-exceptions#quickstart</a></p><p><em>Since: 0.1.2.0</em></p></div></div><h1 id="g:3">Cleanup (no recovery)</h1><div class="top"><p class="src"><a id="v:onException" class="def">onException</a> :: <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> m b -> m a <a href="src/Control-Exception-Safe.html#onException" class="link">Source</a> <a href="#v:onException" class="selflink">#</a></p><div class="doc"><p>Async safe version of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#v:onException">onException</a></code></p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:bracket" class="def">bracket</a> :: <span class="keyword">forall</span> m a b c. <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> (a -> m b) -> (a -> m c) -> m c <a href="src/Control-Exception-Safe.html#bracket" class="link">Source</a> <a href="#v:bracket" class="selflink">#</a></p><div class="doc"><p>Async safe version of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#v:bracket">bracket</a></code></p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:bracket_" class="def">bracket_</a> :: <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> m b -> m c -> m c <a href="src/Control-Exception-Safe.html#bracket_" class="link">Source</a> <a href="#v:bracket_" class="selflink">#</a></p><div class="doc"><p>Async safe version of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#v:bracket_">bracket_</a></code></p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:finally" class="def">finally</a> :: <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> m b -> m a <a href="src/Control-Exception-Safe.html#finally" class="link">Source</a> <a href="#v:finally" class="selflink">#</a></p><div class="doc"><p>Async safe version of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#v:finally">finally</a></code></p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:withException" class="def">withException</a> :: (<a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m, <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e) => m a -> (e -> m b) -> m a <a href="src/Control-Exception-Safe.html#withException" class="link">Source</a> <a href="#v:withException" class="selflink">#</a></p><div class="doc"><p>Like <code><a href="Control-Exception-Safe.html#v:onException">onException</a></code>, but provides the handler the thrown
exception.</p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:bracketOnError" class="def">bracketOnError</a> :: <span class="keyword">forall</span> m a b c. <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> (a -> m b) -> (a -> m c) -> m c <a href="src/Control-Exception-Safe.html#bracketOnError" class="link">Source</a> <a href="#v:bracketOnError" class="selflink">#</a></p><div class="doc"><p>Async safe version of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#v:bracketOnError">bracketOnError</a></code></p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:bracketOnError_" class="def">bracketOnError_</a> :: <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> m b -> m c -> m c <a href="src/Control-Exception-Safe.html#bracketOnError_" class="link">Source</a> <a href="#v:bracketOnError_" class="selflink">#</a></p><div class="doc"><p>Async safe version of <code><a href="E.html#v:bracketOnError_">bracketOnError_</a></code></p><p><em>Since: 0.1.0.0</em></p></div></div><h1 id="g:4">Coercion to sync and async</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:SyncExceptionWrapper" class="def">SyncExceptionWrapper</a> <a href="src/Control-Exception-Safe.html#SyncExceptionWrapper" class="link">Source</a> <a href="#t:SyncExceptionWrapper" class="selflink">#</a></p><div class="doc"><p>Wrap up an asynchronous exception to be treated as a synchronous
exception</p><p>This is intended to be created via <code><a href="Control-Exception-Safe.html#v:toSyncException">toSyncException</a></code></p><p><em>Since: 0.1.0.0</em></p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a id="v:SyncExceptionWrapper" class="def">SyncExceptionWrapper</a> e</td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:SyncExceptionWrapper" class="caption collapser" onclick="toggleSection('i:SyncExceptionWrapper')">Instances</p><div id="section.i:SyncExceptionWrapper" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:SyncExceptionWrapper:Show:1" class="instance expander" onclick="toggleSection('i:id:SyncExceptionWrapper:Show:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> <a href="Control-Exception-Safe.html#t:SyncExceptionWrapper">SyncExceptionWrapper</a></span> <a href="src/Control-Exception-Safe.html#line-382" class="link">Source</a> <a href="#t:SyncExceptionWrapper" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:SyncExceptionWrapper:Show:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -> <a href="Control-Exception-Safe.html#t:SyncExceptionWrapper">SyncExceptionWrapper</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Control-Exception-Safe.html#t:SyncExceptionWrapper">SyncExceptionWrapper</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Control-Exception-Safe.html#t:SyncExceptionWrapper">SyncExceptionWrapper</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:SyncExceptionWrapper:Exception:2" class="instance expander" onclick="toggleSection('i:id:SyncExceptionWrapper:Exception:2')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="Control-Exception-Safe.html#t:SyncExceptionWrapper">SyncExceptionWrapper</a></span> <a href="src/Control-Exception-Safe.html#line-384" class="link">Source</a> <a href="#t:SyncExceptionWrapper" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:SyncExceptionWrapper:Exception:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="Control-Exception-Safe.html#t:SyncExceptionWrapper">SyncExceptionWrapper</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Control-Exception-Safe.html#t:SyncExceptionWrapper">SyncExceptionWrapper</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="Control-Exception-Safe.html#t:SyncExceptionWrapper">SyncExceptionWrapper</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:toSyncException" class="def">toSyncException</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="src/Control-Exception-Safe.html#toSyncException" class="link">Source</a> <a href="#v:toSyncException" class="selflink">#</a></p><div class="doc"><p>Convert an exception into a synchronous exception</p><p>For synchronous exceptions, this is the same as <code><a href="Control-Exception-Safe.html#v:toException">toException</a></code>.
For asynchronous exceptions, this will wrap up the exception with
<code><a href="Control-Exception-Safe.html#t:SyncExceptionWrapper">SyncExceptionWrapper</a></code></p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:AsyncExceptionWrapper" class="def">AsyncExceptionWrapper</a> <a href="src/Control-Exception-Safe.html#AsyncExceptionWrapper" class="link">Source</a> <a href="#t:AsyncExceptionWrapper" class="selflink">#</a></p><div class="doc"><p>Wrap up a synchronous exception to be treated as an asynchronous
exception</p><p>This is intended to be created via <code><a href="Control-Exception-Safe.html#v:toAsyncException">toAsyncException</a></code></p><p><em>Since: 0.1.0.0</em></p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a id="v:AsyncExceptionWrapper" class="def">AsyncExceptionWrapper</a> e</td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:AsyncExceptionWrapper" class="caption collapser" onclick="toggleSection('i:AsyncExceptionWrapper')">Instances</p><div id="section.i:AsyncExceptionWrapper" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:AsyncExceptionWrapper:Show:1" class="instance expander" onclick="toggleSection('i:id:AsyncExceptionWrapper:Show:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> <a href="Control-Exception-Safe.html#t:AsyncExceptionWrapper">AsyncExceptionWrapper</a></span> <a href="src/Control-Exception-Safe.html#line-412" class="link">Source</a> <a href="#t:AsyncExceptionWrapper" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:AsyncExceptionWrapper:Show:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -> <a href="Control-Exception-Safe.html#t:AsyncExceptionWrapper">AsyncExceptionWrapper</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Control-Exception-Safe.html#t:AsyncExceptionWrapper">AsyncExceptionWrapper</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Control-Exception-Safe.html#t:AsyncExceptionWrapper">AsyncExceptionWrapper</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:AsyncExceptionWrapper:Exception:2" class="instance expander" onclick="toggleSection('i:id:AsyncExceptionWrapper:Exception:2')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="Control-Exception-Safe.html#t:AsyncExceptionWrapper">AsyncExceptionWrapper</a></span> <a href="src/Control-Exception-Safe.html#line-414" class="link">Source</a> <a href="#t:AsyncExceptionWrapper" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:AsyncExceptionWrapper:Exception:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="Control-Exception-Safe.html#t:AsyncExceptionWrapper">AsyncExceptionWrapper</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Control-Exception-Safe.html#t:AsyncExceptionWrapper">AsyncExceptionWrapper</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="Control-Exception-Safe.html#t:AsyncExceptionWrapper">AsyncExceptionWrapper</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:toAsyncException" class="def">toAsyncException</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="src/Control-Exception-Safe.html#toAsyncException" class="link">Source</a> <a href="#v:toAsyncException" class="selflink">#</a></p><div class="doc"><p>Convert an exception into an asynchronous exception</p><p>For asynchronous exceptions, this is the same as <code><a href="Control-Exception-Safe.html#v:toException">toException</a></code>.
For synchronous exceptions, this will wrap up the exception with
<code><a href="Control-Exception-Safe.html#t:AsyncExceptionWrapper">AsyncExceptionWrapper</a></code></p><p><em>Since: 0.1.0.0</em></p></div></div><h1 id="g:5">Check exception type</h1><div class="top"><p class="src"><a id="v:isSyncException" class="def">isSyncException</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Control-Exception-Safe.html#isSyncException" class="link">Source</a> <a href="#v:isSyncException" class="selflink">#</a></p><div class="doc"><p>Check if the given exception is synchronous</p><p><em>Since: 0.1.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:isAsyncException" class="def">isAsyncException</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Control-Exception-Safe.html#isAsyncException" class="link">Source</a> <a href="#v:isAsyncException" class="selflink">#</a></p><div class="doc"><p>Check if the given exception is asynchronous</p><p><em>Since: 0.1.0.0</em></p></div></div><h1 id="g:6">Reexports</h1><div class="top"><p class="src"><span class="keyword">class</span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> m => <a id="t:MonadThrow" class="def">MonadThrow</a> m <a href="#t:MonadThrow" class="selflink">#</a></p><div class="doc"><p>A class for monads in which exceptions may be thrown.</p><p>Instances should obey the following law:</p><pre>throwM e >> x = throwM e</pre><p>In other words, throwing an exception short-circuits the rest of the monadic
computation.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#v:throwM">throwM</a></p></div><div class="subs instances"><p id="control.i:MonadThrow" class="caption collapser" onclick="toggleSection('i:MonadThrow')">Instances</p><div id="section.i:MonadThrow" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:1" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:1')"></span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> []</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> [a] <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:2" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:2')"></span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:3" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:3')"></span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:4" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:4')"></span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.0.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.0.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:5" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:5')"></span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/GHC-Conc.html#t:STM">STM</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/GHC-Conc.html#t:STM">STM</a> a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:6" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:6')"></span> (~) <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> e <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> => <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:7" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:7')"></span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m => <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Maybe.html#t:MaybeT">MaybeT</a> m)</span></td><td class="doc"><p>Throws exceptions into the base monad.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:7" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Maybe.html#t:MaybeT">MaybeT</a> m a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:8" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:8')"></span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m => <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-List.html#t:ListT">ListT</a> m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:8" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-List.html#t:ListT">ListT</a> m a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:9" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:9')"></span> (<a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> w) => <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:9" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:10" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:10')"></span> (<a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> w) => <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:10" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:11" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:11')"></span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m => <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:11" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:12" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:12')"></span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m => <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:12" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:13" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:13')"></span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m => <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:13" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:14" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:14')"></span> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Error.html#t:Error">Error</a> e, <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m) => <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Error.html#t:ErrorT">ErrorT</a> e m)</span></td><td class="doc"><p>Throws exceptions into the base monad.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:14" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Error.html#t:ErrorT">ErrorT</a> e m a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:15" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:15')"></span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m => <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Except.html#t:ExceptT">ExceptT</a> e m)</span></td><td class="doc"><p>Throws exceptions into the base monad.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:15" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Except.html#t:ExceptT">ExceptT</a> e m a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:16" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:16')"></span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m => <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:16" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:17" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:17')"></span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m => <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Cont.html#t:ContT">ContT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:17" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Cont.html#t:ContT">ContT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:18" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:18')"></span> (<a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> w) => <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:18" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadThrow:MonadThrow:19" class="instance expander" onclick="toggleSection('i:ic:MonadThrow:MonadThrow:19')"></span> (<a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> w) => <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadThrow:MonadThrow:19" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:throwM">throwM</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m a <a href="#v:throwM" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a href="Control-Exception-Safe.html#t:MonadThrow">MonadThrow</a> m => <a id="t:MonadCatch" class="def">MonadCatch</a> m <a href="#t:MonadCatch" class="selflink">#</a></p><div class="doc"><p>A class for monads which allow exceptions to be caught, in particular
exceptions which were thrown by <code><a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#v:throwM">throwM</a></code>.</p><p>Instances should obey the following law:</p><pre>catch (throwM e) f = f e</pre><p>Note that the ability to catch an exception does <em>not</em> guarantee that we can
deal with all possible exit points from a computation. Some monads, such as
continuation-based stacks, allow for more than just a success/failure
strategy, and therefore <code>catch</code> <em>cannot</em> be used by those monads to properly
implement a function such as <code>finally</code>. For more information, see
<code><a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a></code>.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#v:catch">catch</a></p></div><div class="subs instances"><p id="control.i:MonadCatch" class="caption collapser" onclick="toggleSection('i:MonadCatch')">Instances</p><div id="section.i:MonadCatch" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:1" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:1')"></span> <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:2" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:2')"></span> <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/GHC-Conc.html#t:STM">STM</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/GHC-Conc.html#t:STM">STM</a> a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/GHC-Conc.html#t:STM">STM</a> a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/GHC-Conc.html#t:STM">STM</a> a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:3" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:3')"></span> (~) <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> e <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> => <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e)</span></td><td class="doc"><p><em>Since: 0.8.3</em></p></td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:4" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:4')"></span> <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Maybe.html#t:MaybeT">MaybeT</a> m)</span></td><td class="doc"><p>Catches exceptions from the base monad.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Maybe.html#t:MaybeT">MaybeT</a> m a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Maybe.html#t:MaybeT">MaybeT</a> m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Maybe.html#t:MaybeT">MaybeT</a> m a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:5" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:5')"></span> <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-List.html#t:ListT">ListT</a> m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-List.html#t:ListT">ListT</a> m a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-List.html#t:ListT">ListT</a> m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-List.html#t:ListT">ListT</a> m a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:6" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:6')"></span> (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> w) => <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:7" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:7')"></span> (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> w) => <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:7" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:8" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:8')"></span> <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:8" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:9" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:9')"></span> <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:9" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:10" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:10')"></span> <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:10" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:11" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:11')"></span> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Error.html#t:Error">Error</a> e, <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m) => <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Error.html#t:ErrorT">ErrorT</a> e m)</span></td><td class="doc"><p>Catches exceptions from the base monad.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:11" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Error.html#t:ErrorT">ErrorT</a> e m a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Error.html#t:ErrorT">ErrorT</a> e m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Error.html#t:ErrorT">ErrorT</a> e m a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:12" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:12')"></span> <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Except.html#t:ExceptT">ExceptT</a> e m)</span></td><td class="doc"><p>Catches exceptions from the base monad.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:12" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Except.html#t:ExceptT">ExceptT</a> e m a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Except.html#t:ExceptT">ExceptT</a> e m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Except.html#t:ExceptT">ExceptT</a> e m a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:13" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:13')"></span> <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:13" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:14" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:14')"></span> (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> w) => <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:14" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadCatch:MonadCatch:15" class="instance expander" onclick="toggleSection('i:ic:MonadCatch:MonadCatch:15')"></span> (<a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> w) => <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadCatch:MonadCatch:15" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:catch">catch</a> :: <a href="Control-Exception-Safe.html#t:Exception">Exception</a> e => <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m a -> (e -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m a <a href="#v:catch" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => <a id="t:MonadMask" class="def">MonadMask</a> m <span class="keyword">where</span> <a href="#t:MonadMask" class="selflink">#</a></p><div class="doc"><p>A class for monads which provide for the ability to account for all
possible exit points from a computation, and to mask asynchronous
exceptions. Continuation-based monads, and stacks such as <code>ErrorT e IO</code>
which provide for multiple failure modes, are invalid instances of this
class.</p><p>Note that this package <em>does</em> provide a <code>MonadMask</code> instance for <code>CatchT</code>.
This instance is <em>only</em> valid if the base monad provides no ability to
provide multiple exit. For example, <code>IO</code> or <code>Either</code> would be invalid base
monads, but <code>Reader</code> or <code>State</code> would be acceptable.</p><p>Instances should ensure that, in the following code:</p><pre>f `finally` g</pre><p>The action <code>g</code> is called regardless of what occurs within <code>f</code>, including
async exceptions.</p></div><div class="subs instances"><p id="control.i:MonadMask" class="caption collapser" onclick="toggleSection('i:MonadMask')">Instances</p><div id="section.i:MonadMask" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadMask:MonadMask:1" class="instance expander" onclick="toggleSection('i:ic:MonadMask:MonadMask:1')"></span> <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadMask:MonadMask:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mask">mask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> b <a href="#v:mask" class="selflink">#</a></p><p class="src"><a href="#v:uninterruptibleMask">uninterruptibleMask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> b <a href="#v:uninterruptibleMask" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadMask:MonadMask:2" class="instance expander" onclick="toggleSection('i:ic:MonadMask:MonadMask:2')"></span> (~) <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> e <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> => <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e)</span></td><td class="doc"><p><em>Since: 0.8.3</em></p></td></tr><tr><td colspan="2"><div id="section.i:ic:MonadMask:MonadMask:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mask">mask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e b <a href="#v:mask" class="selflink">#</a></p><p class="src"><a href="#v:uninterruptibleMask">uninterruptibleMask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> e b <a href="#v:uninterruptibleMask" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadMask:MonadMask:3" class="instance expander" onclick="toggleSection('i:ic:MonadMask:MonadMask:3')"></span> (<a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> w) => <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadMask:MonadMask:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mask">mask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m b <a href="#v:mask" class="selflink">#</a></p><p class="src"><a href="#v:uninterruptibleMask">uninterruptibleMask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Strict.html#t:WriterT">WriterT</a> w m b <a href="#v:uninterruptibleMask" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadMask:MonadMask:4" class="instance expander" onclick="toggleSection('i:ic:MonadMask:MonadMask:4')"></span> (<a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> w) => <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadMask:MonadMask:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mask">mask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m b <a href="#v:mask" class="selflink">#</a></p><p class="src"><a href="#v:uninterruptibleMask">uninterruptibleMask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Writer-Lazy.html#t:WriterT">WriterT</a> w m b <a href="#v:uninterruptibleMask" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadMask:MonadMask:5" class="instance expander" onclick="toggleSection('i:ic:MonadMask:MonadMask:5')"></span> <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadMask:MonadMask:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mask">mask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m b <a href="#v:mask" class="selflink">#</a></p><p class="src"><a href="#v:uninterruptibleMask">uninterruptibleMask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Strict.html#t:StateT">StateT</a> s m b <a href="#v:uninterruptibleMask" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadMask:MonadMask:6" class="instance expander" onclick="toggleSection('i:ic:MonadMask:MonadMask:6')"></span> <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadMask:MonadMask:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mask">mask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m b <a href="#v:mask" class="selflink">#</a></p><p class="src"><a href="#v:uninterruptibleMask">uninterruptibleMask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-State-Lazy.html#t:StateT">StateT</a> s m b <a href="#v:uninterruptibleMask" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadMask:MonadMask:7" class="instance expander" onclick="toggleSection('i:ic:MonadMask:MonadMask:7')"></span> <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadMask:MonadMask:7" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mask">mask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m b <a href="#v:mask" class="selflink">#</a></p><p class="src"><a href="#v:uninterruptibleMask">uninterruptibleMask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> m b <a href="#v:uninterruptibleMask" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadMask:MonadMask:8" class="instance expander" onclick="toggleSection('i:ic:MonadMask:MonadMask:8')"></span> <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadMask:MonadMask:8" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mask">mask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m b <a href="#v:mask" class="selflink">#</a></p><p class="src"><a href="#v:uninterruptibleMask">uninterruptibleMask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Reader.html#t:ReaderT">ReaderT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> r m b <a href="#v:uninterruptibleMask" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadMask:MonadMask:9" class="instance expander" onclick="toggleSection('i:ic:MonadMask:MonadMask:9')"></span> (<a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> w) => <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadMask:MonadMask:9" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mask">mask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m b <a href="#v:mask" class="selflink">#</a></p><p class="src"><a href="#v:uninterruptibleMask">uninterruptibleMask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Strict.html#t:RWST">RWST</a> r w s m b <a href="#v:uninterruptibleMask" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadMask:MonadMask:10" class="instance expander" onclick="toggleSection('i:ic:MonadMask:MonadMask:10')"></span> (<a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> w) => <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:MonadMask:MonadMask:10" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mask">mask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m b <a href="#v:mask" class="selflink">#</a></p><p class="src"><a href="#v:uninterruptibleMask">uninterruptibleMask</a> :: ((<span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m b) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-RWS-Lazy.html#t:RWST">RWST</a> r w s m b <a href="#v:uninterruptibleMask" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:mask_" class="def">mask_</a> :: <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> m a <a href="#v:mask_" class="selflink">#</a></p><div class="doc"><p>Like <code><a href="Control-Exception-Safe.html#v:mask">mask</a></code>, but does not pass a <code>restore</code> action to the argument.</p></div></div><div class="top"><p class="src"><a id="v:uninterruptibleMask_" class="def">uninterruptibleMask_</a> :: <a href="Control-Exception-Safe.html#t:MonadMask">MonadMask</a> m => m a -> m a <a href="#v:uninterruptibleMask_" class="selflink">#</a></p><div class="doc"><p>Like <code><a href="Control-Exception-Safe.html#v:uninterruptibleMask">uninterruptibleMask</a></code>, but does not pass a <code>restore</code> action to the
argument.</p></div></div><div class="top"><p class="src"><a id="v:catchIOError" class="def">catchIOError</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => m a -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO-Error.html#t:IOError">IOError</a> -> m a) -> m a <a href="#v:catchIOError" class="selflink">#</a></p><div class="doc"><p>Catch all <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO-Error.html#t:IOError">IOError</a></code> (eqv. <code>IOException</code>) exceptions. Still somewhat too
general, but better than using <code><a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#v:catchAll">catchAll</a></code>. See <code><a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#v:catchIf">catchIf</a></code> for an easy way
of catching specific <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO-Error.html#t:IOError">IOError</a></code>s based on the predicates in <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO-Error.html">System.IO.Error</a>.</p></div></div><div class="top"><p class="src"><a id="v:handleIOError" class="def">handleIOError</a> :: <a href="Control-Exception-Safe.html#t:MonadCatch">MonadCatch</a> m => (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO-Error.html#t:IOError">IOError</a> -> m a) -> m a -> m a <a href="#v:handleIOError" class="selflink">#</a></p><div class="doc"><p>Flipped <code><a href="Control-Exception-Safe.html#v:catchIOError">catchIOError</a></code></p></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Control-Exception-Safe.html#t:Typeable">Typeable</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> e, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> e) => <a id="t:Exception" class="def">Exception</a> e <span class="keyword">where</span> <a href="#t:Exception" class="selflink">#</a></p><div class="doc"><p>Any type that you wish to throw or catch as an exception must be an
instance of the <code>Exception</code> class. The simplest case is a new exception
type directly below the root:</p><pre>data MyException = ThisException | ThatException
deriving (Show, Typeable)
instance Exception MyException</pre><p>The default method definitions in the <code>Exception</code> class do what we need
in this case. You can now throw and catch <code>ThisException</code> and
<code>ThatException</code> as exceptions:</p><pre>*Main> throw ThisException `catch` \e -> putStrLn ("Caught " ++ show (e :: MyException))
Caught ThisException
</pre><p>In more complicated examples, you may wish to define a whole hierarchy
of exceptions:</p><pre>---------------------------------------------------------------------
-- Make the root exception type for all the exceptions in a compiler
data SomeCompilerException = forall e . Exception e => SomeCompilerException e
deriving Typeable
instance Show SomeCompilerException where
show (SomeCompilerException e) = show e
instance Exception SomeCompilerException
compilerExceptionToException :: Exception e => e -> SomeException
compilerExceptionToException = toException . SomeCompilerException
compilerExceptionFromException :: Exception e => SomeException -> Maybe e
compilerExceptionFromException x = do
SomeCompilerException a <- fromException x
cast a
---------------------------------------------------------------------
-- Make a subhierarchy for exceptions in the frontend of the compiler
data SomeFrontendException = forall e . Exception e => SomeFrontendException e
deriving Typeable
instance Show SomeFrontendException where
show (SomeFrontendException e) = show e
instance Exception SomeFrontendException where
toException = compilerExceptionToException
fromException = compilerExceptionFromException
frontendExceptionToException :: Exception e => e -> SomeException
frontendExceptionToException = toException . SomeFrontendException
frontendExceptionFromException :: Exception e => SomeException -> Maybe e
frontendExceptionFromException x = do
SomeFrontendException a <- fromException x
cast a
---------------------------------------------------------------------
-- Make an exception type for a particular frontend compiler exception
data MismatchedParentheses = MismatchedParentheses
deriving (Typeable, Show)
instance Exception MismatchedParentheses where
toException = frontendExceptionToException
fromException = frontendExceptionFromException</pre><p>We can now catch a <code>MismatchedParentheses</code> exception as
<code>MismatchedParentheses</code>, <code>SomeFrontendException</code> or
<code>SomeCompilerException</code>, but not other types, e.g. <code>IOException</code>:</p><pre>*Main> throw MismatchedParentheses <code>catch</code> e -> putStrLn ("Caught " ++ show (e :: MismatchedParentheses))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses <code>catch</code> e -> putStrLn ("Caught " ++ show (e :: SomeFrontendException))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses <code>catch</code> e -> putStrLn ("Caught " ++ show (e :: SomeCompilerException))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses <code>catch</code> e -> putStrLn ("Caught " ++ show (e :: IOException))
*** Exception: MismatchedParentheses
</pre></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src">Nothing</p></div><div class="subs instances"><p id="control.i:Exception" class="caption collapser" onclick="toggleSection('i:Exception')">Instances</p><div id="section.i:Exception" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:1" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:1')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:BlockedIndefinitelyOnMVar">BlockedIndefinitelyOnMVar</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:BlockedIndefinitelyOnMVar">BlockedIndefinitelyOnMVar</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:BlockedIndefinitelyOnMVar">BlockedIndefinitelyOnMVar</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:BlockedIndefinitelyOnMVar">BlockedIndefinitelyOnMVar</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:2" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:2')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:BlockedIndefinitelyOnSTM">BlockedIndefinitelyOnSTM</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:BlockedIndefinitelyOnSTM">BlockedIndefinitelyOnSTM</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:BlockedIndefinitelyOnSTM">BlockedIndefinitelyOnSTM</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:BlockedIndefinitelyOnSTM">BlockedIndefinitelyOnSTM</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:3" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:3')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:Deadlock">Deadlock</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:Deadlock">Deadlock</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:Deadlock">Deadlock</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:Deadlock">Deadlock</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:4" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:4')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:AllocationLimitExceeded">AllocationLimitExceeded</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:AllocationLimitExceeded">AllocationLimitExceeded</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:AllocationLimitExceeded">AllocationLimitExceeded</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:AllocationLimitExceeded">AllocationLimitExceeded</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:5" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:5')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:AssertionFailed">AssertionFailed</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:AssertionFailed">AssertionFailed</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:AssertionFailed">AssertionFailed</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:AssertionFailed">AssertionFailed</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:6" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:6')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="Control-Exception-Safe.html#t:SomeAsyncException">SomeAsyncException</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="Control-Exception-Safe.html#t:SomeAsyncException">SomeAsyncException</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Control-Exception-Safe.html#t:SomeAsyncException">SomeAsyncException</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="Control-Exception-Safe.html#t:SomeAsyncException">SomeAsyncException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:7" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:7')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:AsyncException">AsyncException</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:7" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:AsyncException">AsyncException</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:AsyncException">AsyncException</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:AsyncException">AsyncException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:8" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:8')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:ArrayException">ArrayException</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:8" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:ArrayException">ArrayException</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:ArrayException">ArrayException</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:ArrayException">ArrayException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:9" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:9')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Exit.html#t:ExitCode">ExitCode</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:9" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Exit.html#t:ExitCode">ExitCode</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Exit.html#t:ExitCode">ExitCode</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Exit.html#t:ExitCode">ExitCode</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:10" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:10')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="Control-Exception-Safe.html#t:IOException">IOException</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:10" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="Control-Exception-Safe.html#t:IOException">IOException</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Control-Exception-Safe.html#t:IOException">IOException</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="Control-Exception-Safe.html#t:IOException">IOException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:11" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:11')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:ErrorCall">ErrorCall</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:11" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:ErrorCall">ErrorCall</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:ErrorCall">ErrorCall</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:ErrorCall">ErrorCall</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:12" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:12')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:ArithException">ArithException</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:12" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:ArithException">ArithException</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:ArithException">ArithException</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:ArithException">ArithException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:13" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:13')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:13" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:14" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:14')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="Control-Exception-Safe.html#t:AsyncExceptionWrapper">AsyncExceptionWrapper</a></span> <a href="#t:Exception" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:14" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="Control-Exception-Safe.html#t:AsyncExceptionWrapper">AsyncExceptionWrapper</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Control-Exception-Safe.html#t:AsyncExceptionWrapper">AsyncExceptionWrapper</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="Control-Exception-Safe.html#t:AsyncExceptionWrapper">AsyncExceptionWrapper</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exception:Exception:15" class="instance expander" onclick="toggleSection('i:ic:Exception:Exception:15')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="Control-Exception-Safe.html#t:SyncExceptionWrapper">SyncExceptionWrapper</a></span> <a href="#t:Exception" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Exception:Exception:15" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="Control-Exception-Safe.html#t:SyncExceptionWrapper">SyncExceptionWrapper</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Control-Exception-Safe.html#t:SyncExceptionWrapper">SyncExceptionWrapper</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="Control-Exception-Safe.html#t:SyncExceptionWrapper">SyncExceptionWrapper</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a id="t:Typeable" class="def">Typeable</a> k a <a href="#t:Typeable" class="selflink">#</a></p><div class="doc"><p>The class <code><a href="Control-Exception-Safe.html#t:Typeable">Typeable</a></code> allows a concrete representation of a type to
be calculated.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Typeable-Internal.html#v:typeRep-35-">typeRep#</a></p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:SomeException" class="def">SomeException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> <span class="keyword">where</span> <a href="#t:SomeException" class="selflink">#</a></p><div class="doc"><p>The <code>SomeException</code> type is the root of the exception type hierarchy.
When an exception of type <code>e</code> is thrown, behind the scenes it is
encapsulated in a <code>SomeException</code>.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:SomeException" class="def">SomeException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:SomeException" class="caption collapser" onclick="toggleSection('i:SomeException')">Instances</p><div id="section.i:SomeException" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:SomeException:Show:1" class="instance expander" onclick="toggleSection('i:id:SomeException:Show:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:SomeException:Show:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Control-Exception-Safe.html#t:SomeException">SomeException</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:SomeException:Exception:2" class="instance expander" onclick="toggleSection('i:id:SomeException:Exception:2')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:SomeException:Exception:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:SomeAsyncException" class="def">SomeAsyncException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> <span class="keyword">where</span> <a href="#t:SomeAsyncException" class="selflink">#</a></p><div class="doc"><p>Superclass for asynchronous exceptions.</p><p><em>Since: 4.7.0.0</em></p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:SomeAsyncException" class="def">SomeAsyncException</a> :: <a href="Control-Exception-Safe.html#t:SomeAsyncException">SomeAsyncException</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:SomeAsyncException" class="caption collapser" onclick="toggleSection('i:SomeAsyncException')">Instances</p><div id="section.i:SomeAsyncException" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:SomeAsyncException:Show:1" class="instance expander" onclick="toggleSection('i:id:SomeAsyncException:Show:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> <a href="Control-Exception-Safe.html#t:SomeAsyncException">SomeAsyncException</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:SomeAsyncException:Show:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -> <a href="Control-Exception-Safe.html#t:SomeAsyncException">SomeAsyncException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Control-Exception-Safe.html#t:SomeAsyncException">SomeAsyncException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Control-Exception-Safe.html#t:SomeAsyncException">SomeAsyncException</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:SomeAsyncException:Exception:2" class="instance expander" onclick="toggleSection('i:id:SomeAsyncException:Exception:2')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="Control-Exception-Safe.html#t:SomeAsyncException">SomeAsyncException</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:SomeAsyncException:Exception:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="Control-Exception-Safe.html#t:SomeAsyncException">SomeAsyncException</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Control-Exception-Safe.html#t:SomeAsyncException">SomeAsyncException</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="Control-Exception-Safe.html#t:SomeAsyncException">SomeAsyncException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:IOException" class="def">IOException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> <a href="#t:IOException" class="selflink">#</a></p><div class="doc"><p>Exceptions that occur in the <code>IO</code> monad.
An <code>IOException</code> records a more specific error type, a descriptive
string and maybe the handle that was used when the error was
flagged.</p></div><div class="subs instances"><p id="control.i:IOException" class="caption collapser" onclick="toggleSection('i:IOException')">Instances</p><div id="section.i:IOException" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:IOException:Eq:1" class="instance expander" onclick="toggleSection('i:id:IOException:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> <a href="Control-Exception-Safe.html#t:IOException">IOException</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:IOException:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Control-Exception-Safe.html#t:IOException">IOException</a> -> <a href="Control-Exception-Safe.html#t:IOException">IOException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Control-Exception-Safe.html#t:IOException">IOException</a> -> <a href="Control-Exception-Safe.html#t:IOException">IOException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:IOException:Show:2" class="instance expander" onclick="toggleSection('i:id:IOException:Show:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> <a href="Control-Exception-Safe.html#t:IOException">IOException</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:IOException:Show:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -> <a href="Control-Exception-Safe.html#t:IOException">IOException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Control-Exception-Safe.html#t:IOException">IOException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Control-Exception-Safe.html#t:IOException">IOException</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:IOException:Exception:3" class="instance expander" onclick="toggleSection('i:id:IOException:Exception:3')"></span> <a href="Control-Exception-Safe.html#t:Exception">Exception</a> <a href="Control-Exception-Safe.html#t:IOException">IOException</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:IOException:Exception:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="Control-Exception-Safe.html#t:IOException">IOException</a> -> <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> <a href="#v:toException" class="selflink">#</a></p><p class="src"><a href="#v:fromException">fromException</a> :: <a href="Control-Exception-Safe.html#t:SomeException">SomeException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Control-Exception-Safe.html#t:IOException">IOException</a> <a href="#v:fromException" class="selflink">#</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="Control-Exception-Safe.html#t:IOException">IOException</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:displayException" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:IOException:Error:4" class="instance expander" onclick="toggleSection('i:id:IOException:Error:4')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.5.2.0/Control-Monad-Trans-Error.html#t:Error">Error</a> <a href="Control-Exception-Safe.html#t:IOException">IOException</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:IOException:Error:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:noMsg">noMsg</a> :: <a href="Control-Exception-Safe.html#t:IOException">IOException</a> <a href="#v:noMsg" class="selflink">#</a></p><p class="src"><a href="#v:strMsg">strMsg</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -> <a href="Control-Exception-Safe.html#t:IOException">IOException</a> <a href="#v:strMsg" class="selflink">#</a></p></div></div></td></tr></table></div></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.2</p></div></body></html>
|