/usr/share/doc/libghc-unix-bytestring-doc/html/Foreign-C-Error-Safe.html is in libghc-unix-bytestring-doc 0.3.5.4-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Foreign.C.Error.Safe</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_Foreign-C-Error-Safe.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Foreign-C-Error-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">unix-bytestring-0.3.5.4: Unix/Posix-specific functions for ByteStrings.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable (H98+FFI)</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Maintainer</th><td>wren@community.haskell.org</td></tr><tr><th>Safe Haskell</th><td>Safe-Inferred</td></tr></table><p class="caption">Foreign.C.Error.Safe</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Primitive handlers
</a></li><li><a href="#g:2">Derived handlers
</a><ul><li><a href="#g:3">With predicate <code>(-1 ==)</code>
</a></li><li><a href="#g:4">With predicate <code>(nullPtr ==)</code>
</a></li></ul></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Provides a variant of the <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html">Foreign.C.Error</a> API which returns
errors explicitly, instead of throwing exceptions.
</p><p><em>Since: 0.3.5</em>
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:eitherErrnoIf">eitherErrnoIf</a> :: (a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a>) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> a)</li><li class="src short"><a href="#v:eitherErrnoIfRetry">eitherErrnoIfRetry</a> :: (a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a>) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> a)</li><li class="src short"><a href="#v:eitherErrnoIfRetryMayBlock">eitherErrnoIfRetryMayBlock</a> :: (a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a>) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> b -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> a)</li><li class="src short"><a href="#v:eitherErrnoIfMinus1">eitherErrnoIfMinus1</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> a, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> a) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> a)</li><li class="src short"><a href="#v:eitherErrnoIfMinus1Retry">eitherErrnoIfMinus1Retry</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> a, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> a) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> a)</li><li class="src short"><a href="#v:eitherErrnoIfMinus1RetryMayBlock">eitherErrnoIfMinus1RetryMayBlock</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> a, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> a) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> b -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> a)</li><li class="src short"><a href="#v:eitherErrnoIfNull">eitherErrnoIfNull</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-Ptr.html#t:Ptr">Ptr</a> a) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-Ptr.html#t:Ptr">Ptr</a> a))</li><li class="src short"><a href="#v:eitherErrnoIfNullRetry">eitherErrnoIfNullRetry</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-Ptr.html#t:Ptr">Ptr</a> a) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-Ptr.html#t:Ptr">Ptr</a> a))</li><li class="src short"><a href="#v:eitherErrnoIfNullRetryMayBlock">eitherErrnoIfNullRetryMayBlock</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-Ptr.html#t:Ptr">Ptr</a> a) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> b -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-Ptr.html#t:Ptr">Ptr</a> a))</li></ul></div><div id="interface"><h1 id="g:1">Primitive handlers
</h1><div class="top"><p class="src"><a name="v:eitherErrnoIf" class="def">eitherErrnoIf</a><a href="src/Foreign-C-Error-Safe.html#eitherErrnoIf" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a>)</td><td class="doc"><p>Predicate to apply to the result value of
the <code>IO</code> operation.
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> a</td><td class="doc"><p>The <code>IO</code> operation to be executed.
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> a)</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>A variant of <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#v:throwErrnoIf">throwErrnoIf</a></code> which returns <code>Either</code> instead
of throwing an errno error.
</p></div></div><div class="top"><p class="src"><a name="v:eitherErrnoIfRetry" class="def">eitherErrnoIfRetry</a><a href="src/Foreign-C-Error-Safe.html#eitherErrnoIfRetry" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a>)</td><td class="doc"><p>Predicate to apply to the result value of
the <code>IO</code> operation.
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> a</td><td class="doc"><p>The <code>IO</code> operation to be executed.
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> a)</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>A variant of <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#v:throwErrnoIfRetry">throwErrnoIfRetry</a></code> which returns <code>Either</code>
instead of throwing an errno error.
</p></div></div><div class="top"><p class="src"><a name="v:eitherErrnoIfRetryMayBlock" class="def">eitherErrnoIfRetryMayBlock</a><a href="src/Foreign-C-Error-Safe.html#eitherErrnoIfRetryMayBlock" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a>)</td><td class="doc"><p>Predicate to apply to the result value of
the <code>IO</code> operation.
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> a</td><td class="doc"><p>The <code>IO</code> operation to be executed.
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> b</td><td class="doc"><p>Action to execute before retrying if an
immediate retry would block.
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> a)</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>A variant of <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#v:throwErrnoIfRetryMayBlock">throwErrnoIfRetryMayBlock</a></code> which returns
<code>Either</code> instead of throwing an errno error.
</p></div></div><h1 id="g:2">Derived handlers
</h1><h2 id="g:3">With predicate <code>(-1 ==)</code>
</h2><div class="top"><p class="src"><a name="v:eitherErrnoIfMinus1" class="def">eitherErrnoIfMinus1</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> a, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> a) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> a)<a href="src/Foreign-C-Error-Safe.html#eitherErrnoIfMinus1" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:eitherErrnoIfMinus1Retry" class="def">eitherErrnoIfMinus1Retry</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> a, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> a) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> a)<a href="src/Foreign-C-Error-Safe.html#eitherErrnoIfMinus1Retry" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:eitherErrnoIfMinus1RetryMayBlock" class="def">eitherErrnoIfMinus1RetryMayBlock</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> a, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> a) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> b -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> a)<a href="src/Foreign-C-Error-Safe.html#eitherErrnoIfMinus1RetryMayBlock" class="link">Source</a></p></div><h2 id="g:4">With predicate <code>(nullPtr ==)</code>
</h2><div class="top"><p class="src"><a name="v:eitherErrnoIfNull" class="def">eitherErrnoIfNull</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-Ptr.html#t:Ptr">Ptr</a> a) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-Ptr.html#t:Ptr">Ptr</a> a))<a href="src/Foreign-C-Error-Safe.html#eitherErrnoIfNull" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:eitherErrnoIfNullRetry" class="def">eitherErrnoIfNullRetry</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-Ptr.html#t:Ptr">Ptr</a> a) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-Ptr.html#t:Ptr">Ptr</a> a))<a href="src/Foreign-C-Error-Safe.html#eitherErrnoIfNullRetry" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:eitherErrnoIfNullRetryMayBlock" class="def">eitherErrnoIfNullRetryMayBlock</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-Ptr.html#t:Ptr">Ptr</a> a) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> b -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-C-Error.html#t:Errno">Errno</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Foreign-Ptr.html#t:Ptr">Ptr</a> a))<a href="src/Foreign-C-Error-Safe.html#eitherErrnoIfNullRetryMayBlock" class="link">Source</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
|