/usr/share/doc/libghc-resourcet-doc/html/Control-Monad-Trans-Resource-Internal.html is in libghc-resourcet-doc 1.1.7-1build1.
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 | <!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.Monad.Trans.Resource.Internal</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Control-Monad-Trans-Resource-Internal.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Control-Monad-Trans-Resource-Internal.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">resourcet-1.1.7: Deterministic allocation and freeing of scarce resources.</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>Haskell98</td></tr></table><p class="caption">Control.Monad.Trans.Resource.Internal</p></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"><span class="keyword">data</span> <a href="#t:InvalidAccess">InvalidAccess</a> = <a href="#v:InvalidAccess">InvalidAccess</a> {<ul class="subs"><li><a href="#v:functionName">functionName</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li></ul>}</li><li class="src short"><span class="keyword">class</span> (<a href="Control-Monad-Trans-Resource.html#t:MonadThrow">MonadThrow</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> m, <a href="file:///usr/share/doc/libghc-transformers-base-doc/html/Control-Monad-Base.html#t:MonadBase">MonadBase</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> m) => <a href="#t:MonadResource">MonadResource</a> m <span class="keyword">where</span><ul class="subs"><li><a href="#v:liftResourceT">liftResourceT</a> :: <a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -> m a</li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:ReleaseKey">ReleaseKey</a> = <a href="#v:ReleaseKey">ReleaseKey</a> !(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-IORef.html#t:IORef">IORef</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseMap">ReleaseMap</a>) !<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:ReleaseMap">ReleaseMap</a><ul class="subs"><li>= <a href="#v:ReleaseMap">ReleaseMap</a> !NextKey !RefCount !(<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.6.2/Data-IntMap-Strict.html#t:IntMap">IntMap</a> (<a href="Data-Acquire.html#t:ReleaseType">ReleaseType</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()))</li><li>| <a href="#v:ReleaseMapClosed">ReleaseMapClosed</a></li></ul></li><li class="src short"><span class="keyword">type</span> <a href="#t:ResIO">ResIO</a> a = <a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><span class="keyword">newtype</span> <a href="#t:ResourceT">ResourceT</a> m a = <a href="#v:ResourceT">ResourceT</a> {<ul class="subs"><li><a href="#v:unResourceT">unResourceT</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-IORef.html#t:IORef">IORef</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseMap">ReleaseMap</a> -> m a</li></ul>}</li><li class="src short"><a href="#v:stateAlloc">stateAlloc</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-IORef.html#t:IORef">IORef</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseMap">ReleaseMap</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:stateCleanup">stateCleanup</a> :: <a href="Data-Acquire.html#t:ReleaseType">ReleaseType</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-IORef.html#t:IORef">IORef</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseMap">ReleaseMap</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:transResourceT">transResourceT</a> :: (m a -> n b) -> <a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m a -> <a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> n b</li><li class="src short"><a href="#v:register-39-">register'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-IORef.html#t:IORef">IORef</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseMap">ReleaseMap</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseKey">ReleaseKey</a></li><li class="src short"><a href="#v:registerType">registerType</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-IORef.html#t:IORef">IORef</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseMap">ReleaseMap</a> -> (<a href="Data-Acquire.html#t:ReleaseType">ReleaseType</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseKey">ReleaseKey</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:InvalidAccess" class="def">InvalidAccess</a> <a href="src/Control-Monad-Trans-Resource-Internal.html#InvalidAccess" class="link">Source</a></p><div class="doc"><p>Indicates either an error in the library, or misuse of it (e.g., a
<code>ResourceT</code>'s state is accessed after being released).</p><p>Since 0.3.0</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:InvalidAccess" class="def">InvalidAccess</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:functionName" class="def">functionName</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></dt><dd class="doc empty"> </dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:InvalidAccess" class="caption collapser" onclick="toggleSection('i:InvalidAccess')">Instances</p><div id="section.i:InvalidAccess" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Show.html#t:Show">Show</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:InvalidAccess">InvalidAccess</a></span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-213" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Exception-Base.html#t:Exception">Exception</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:InvalidAccess">InvalidAccess</a></span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-220" class="link">Source</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Control-Monad-Trans-Resource.html#t:MonadThrow">MonadThrow</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> m, <a href="file:///usr/share/doc/libghc-transformers-base-doc/html/Control-Monad-Base.html#t:MonadBase">MonadBase</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> m) => <a name="t:MonadResource" class="def">MonadResource</a> m <span class="keyword">where</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#MonadResource" class="link">Source</a></p><div class="doc"><p>A <code>Monad</code> which allows for safe resource allocation. In theory, any monad
transformer stack included a <code>ResourceT</code> can be an instance of
<code>MonadResource</code>.</p><p>Note: <code>runResourceT</code> has a requirement for a <code>MonadBaseControl IO m</code> monad,
which allows control operations to be lifted. A <code>MonadResource</code> does not
have this requirement. This means that transformers such as <code>ContT</code> can be
an instance of <code>MonadResource</code>. However, the <code>ContT</code> wrapper will need to be
unwrapped before calling <code>runResourceT</code>.</p><p>Since 0.3.0</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:liftResourceT" class="def">liftResourceT</a> :: <a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a -> m a <a href="src/Control-Monad-Trans-Resource-Internal.html#liftResourceT" class="link">Source</a></p><div class="doc"><p>Lift a <code>ResourceT IO</code> action into the current <code>Monad</code>.</p><p>Since 0.4.0</p></div></div><div class="subs instances"><p id="control.i:MonadResource" class="caption collapser" onclick="toggleSection('i:MonadResource')">Instances</p><div id="section.i:MonadResource" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> m => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-List.html#t:ListT">ListT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-290" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> m => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-Trans-Maybe.html#t:MaybeT">MaybeT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-291" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> m => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-Trans-Identity.html#t:IdentityT">IdentityT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-289" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left">(<a href="Control-Monad-Trans-Resource.html#t:MonadThrow">MonadThrow</a> m, <a href="file:///usr/share/doc/libghc-transformers-base-doc/html/Control-Monad-Base.html#t:MonadBase">MonadBase</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> m) => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-155" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> m => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Cont.html#t:ContT">ContT</a> r m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-297" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> m => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Reader.html#t:ReaderT">ReaderT</a> r m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-296" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> m => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Lazy.html#t:StateT">StateT</a> s m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-298" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> m => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Strict.html#t:StateT">StateT</a> s m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-302" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> m => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Except.html#t:ExceptT">ExceptT</a> e m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-294" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left">(<a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:Error">Error</a> e, <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> m) => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error.html#t:ErrorT">ErrorT</a> e m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-292" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left">(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> w, <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> m) => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Writer-Lazy.html#t:WriterT">WriterT</a> w m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-299" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left">(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> w, <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> m) => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Writer-Strict.html#t:WriterT">WriterT</a> w m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-303" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left">(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> w, <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> m) => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-RWS-Lazy.html#t:RWST">RWST</a> r w s m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-300" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left">(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> w, <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> m) => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-RWS-Strict.html#t:RWST">RWST</a> r w s m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-301" class="link">Source</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ReleaseKey" class="def">ReleaseKey</a> <a href="src/Control-Monad-Trans-Resource-Internal.html#ReleaseKey" class="link">Source</a></p><div class="doc"><p>A lookup key for a specific release action. This value is returned by
<code>register</code> and <code>allocate</code>, and is passed to <code>release</code>.</p><p>Since 0.3.0</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ReleaseKey" class="def">ReleaseKey</a> !(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-IORef.html#t:IORef">IORef</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseMap">ReleaseMap</a>) !<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a></td><td class="doc empty"> </td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ReleaseMap" class="def">ReleaseMap</a> <a href="src/Control-Monad-Trans-Resource-Internal.html#ReleaseMap" class="link">Source</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ReleaseMap" class="def">ReleaseMap</a> !NextKey !RefCount !(<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.6.2/Data-IntMap-Strict.html#t:IntMap">IntMap</a> (<a href="Data-Acquire.html#t:ReleaseType">ReleaseType</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()))</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:ReleaseMapClosed" class="def">ReleaseMapClosed</a></td><td class="doc empty"> </td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:ResIO" class="def">ResIO</a> a = <a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> a <a href="src/Control-Monad-Trans-Resource-Internal.html#ResIO" class="link">Source</a></p><div class="doc"><p>Convenient alias for <code>ResourceT IO</code>.</p></div></div><div class="top"><p class="src"><span class="keyword">newtype</span> <a name="t:ResourceT" class="def">ResourceT</a> m a <a href="src/Control-Monad-Trans-Resource-Internal.html#ResourceT" class="link">Source</a></p><div class="doc"><p>The Resource transformer. This transformer keeps track of all registered
actions, and calls them upon exit (via <code>runResourceT</code>). Actions may be
registered via <code>register</code>, or resources may be allocated atomically via
<code>allocate</code>. <code>allocate</code> corresponds closely to <code>bracket</code>.</p><p>Releasing may be performed before exit via the <code>release</code> function. This is a
highly recommended optimization, as it will ensure that scarce resources are
freed early. Note that calling <code>release</code> will deregister the action, so that
a release action will only ever be called once.</p><p>Since 0.3.0</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ResourceT" class="def">ResourceT</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:unResourceT" class="def">unResourceT</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-IORef.html#t:IORef">IORef</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseMap">ReleaseMap</a> -> m a</dt><dd class="doc empty"> </dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:ResourceT" class="caption collapser" onclick="toggleSection('i:ResourceT')">Instances</p><div id="section.i:ResourceT" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-mmorph-doc/html/Control-Monad-Morph.html#t:MFunctor">MFunctor</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a></span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-170" class="link">Source</a></td><td class="doc"><p>Since 0.4.7</p></td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-mmorph-doc/html/Control-Monad-Morph.html#t:MMonad">MMonad</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a></span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-173" class="link">Source</a></td><td class="doc"><p>Since 0.4.7</p></td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-mmorph-doc/html/Control-Monad-Morph.html#t:MonadTrans">MonadTrans</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a></span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-250" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:MonadTransControl">MonadTransControl</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a></span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-259" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-RWS-Class.html#t:MonadRWS">MonadRWS</a> r w s m => <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-RWS-Class.html#t:MonadRWS">MonadRWS</a> r w s (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-124" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-transformers-base-doc/html/Control-Monad-Base.html#t:MonadBase">MonadBase</a> b m => <a href="file:///usr/share/doc/libghc-transformers-base-doc/html/Control-Monad-Base.html#t:MonadBase">MonadBase</a> b (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-256" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Monad-Trans-Resource.html#t:MonadBaseControl">MonadBaseControl</a> b m => <a href="Control-Monad-Trans-Resource.html#t:MonadBaseControl">MonadBaseControl</a> b (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-272" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> e m => <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Error-Class.html#t:MonadError">MonadError</a> e (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-120" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Reader-Class.html#t:MonadReader">MonadReader</a> r m => <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Reader-Class.html#t:MonadReader">MonadReader</a> r (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-126" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a> s m => <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a> s (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-133" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Writer-Class.html#t:MonadWriter">MonadWriter</a> w m => <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Writer-Class.html#t:MonadWriter">MonadWriter</a> w (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-137" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-241" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Functor.html#t:Functor">Functor</a> m => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Functor.html#t:Functor">Functor</a> (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-223" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> m => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-226" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Alternative">Alternative</a> m => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Alternative">Alternative</a> (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-232" class="link">Source</a></td><td class="doc"><p>Since 1.1.5</p></td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> m => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-237" class="link">Source</a></td><td class="doc"><p>Since 1.1.5</p></td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Control-Monad-Trans-Resource.html#t:MonadThrow">MonadThrow</a> m => <a href="Control-Monad-Trans-Resource.html#t:MonadThrow">MonadThrow</a> (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-142" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#t:MonadCatch">MonadCatch</a> m => <a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#t:MonadCatch">MonadCatch</a> (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-144" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#t:MonadMask">MonadMask</a> m => <a href="file:///usr/share/doc/libghc-exceptions-doc/html/Control-Monad-Catch.html#t:MonadMask">MonadMask</a> (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-148" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m => <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-253" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> m => <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-Cont-Class.html#t:MonadCont">MonadCont</a> (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-117" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left">(<a href="Control-Monad-Trans-Resource.html#t:MonadThrow">MonadThrow</a> m, <a href="file:///usr/share/doc/libghc-transformers-base-doc/html/Control-Monad-Base.html#t:MonadBase">MonadBase</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> m) => <a href="Control-Monad-Trans-Resource-Internal.html#t:MonadResource">MonadResource</a> (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m)</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-155" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="file:///usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:StT">StT</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> a = a</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-261" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="file:///usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:StM">StM</a> (<a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m) a = <a href="file:///usr/share/doc/libghc-monad-control-doc/html/Control-Monad-Trans-Control.html#t:StM">StM</a> m a</span> <a href="src/Control-Monad-Trans-Resource-Internal.html#line-274" class="link">Source</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:stateAlloc" class="def">stateAlloc</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-IORef.html#t:IORef">IORef</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseMap">ReleaseMap</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () <a href="src/Control-Monad-Trans-Resource-Internal.html#stateAlloc" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:stateCleanup" class="def">stateCleanup</a> :: <a href="Data-Acquire.html#t:ReleaseType">ReleaseType</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-IORef.html#t:IORef">IORef</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseMap">ReleaseMap</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () <a href="src/Control-Monad-Trans-Resource-Internal.html#stateCleanup" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:transResourceT" class="def">transResourceT</a> :: (m a -> n b) -> <a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> m a -> <a href="Control-Monad-Trans-Resource-Internal.html#t:ResourceT">ResourceT</a> n b <a href="src/Control-Monad-Trans-Resource-Internal.html#transResourceT" class="link">Source</a></p><div class="doc"><p>Transform the monad a <code>ResourceT</code> lives in. This is most often used to
strip or add new transformers to a stack, e.g. to run a <code>ReaderT</code>.</p><p>Note that this function is a slight generalization of <code><a href="file:///usr/share/doc/libghc-mmorph-doc/html/Control-Monad-Morph.html#v:hoist">hoist</a></code>.</p><p>Since 0.3.0</p></div></div><div class="top"><p class="src"><a name="v:register-39-" class="def">register'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-IORef.html#t:IORef">IORef</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseMap">ReleaseMap</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> () -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseKey">ReleaseKey</a> <a href="src/Control-Monad-Trans-Resource-Internal.html#register%27" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:registerType" class="def">registerType</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-IORef.html#t:IORef">IORef</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseMap">ReleaseMap</a> -> (<a href="Data-Acquire.html#t:ReleaseType">ReleaseType</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> ()) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="Control-Monad-Trans-Resource-Internal.html#t:ReleaseKey">ReleaseKey</a> <a href="src/Control-Monad-Trans-Resource-Internal.html#registerType" class="link">Source</a></p><div class="doc"><p>Since 1.1.2</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>
|