Sophie

Sophie

distrib > Mageia > 3 > x86_64 > by-pkgid > d5d42515f78bdb3a5381de09f2cf4125 > files > 273

ghc-doc-7.4.2-2.mga3.x86_64.rpm

<!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.Marshal.Unsafe</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-Marshal-Unsafe.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">base-4.5.1.0: Basic libraries</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Maintainer</th><td>ffi@haskell.org</td></tr><tr><th>Safe Haskell</th><td>Unsafe</td></tr></table><p class="caption">Foreign.Marshal.Unsafe</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Unsafe functions
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Marshalling support. Unsafe API.
</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:unsafeLocalState">unsafeLocalState</a> ::  <a href="System-IO.html#t:IO">IO</a> a -&gt; a</li></ul></div><div id="interface"><h1 id="g:1">Unsafe functions
</h1><div class="top"><p class="src"><a name="v:unsafeLocalState" class="def">unsafeLocalState</a> ::  <a href="System-IO.html#t:IO">IO</a> a -&gt; a</p><div class="doc"><p>Sometimes an external entity is a pure function, except that it passes
arguments and/or results via pointers.  The function
<code>unsafeLocalState</code> permits the packaging of such entities as pure
functions.  
</p><p>The only IO operations allowed in the IO action passed to
<code>unsafeLocalState</code> are (a) local allocation (<code>alloca</code>, <code>allocaBytes</code>
and derived operations such as <code>withArray</code> and <code>withCString</code>), and (b)
pointer operations (<code>Foreign.Storable</code> and <code>Foreign.Ptr</code>) on the
pointers to local storage, and (c) foreign functions whose only
observable effect is to read and/or write the locally allocated
memory.  Passing an IO operation that does not obey these rules
results in undefined behaviour.
</p><p>It is expected that this operation will be
replaced in a future revision of Haskell.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>