Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 6e204a966e8c42d976f99a1700ce5f20 > files > 2181

ghc-7.4.2-4.mga5.i586.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>Data.Array.Storable.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_Data-Array-Storable-Safe.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">array-0.4.0.0: Mutable and immutable arrays</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>non-portable (uses Data.Array.MArray)</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Maintainer</th><td>libraries@haskell.org</td></tr><tr><th>Safe Haskell</th><td>Trustworthy</td></tr></table><p class="caption">Data.Array.Storable.Safe</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Arrays of <code>Storable</code> things.
</a></li><li><a href="#g:2">Overloaded mutable array interface
</a></li><li><a href="#g:3">Accessing the pointer to the array contents
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>A storable array is an IO-mutable array which stores its
 contents in a contiguous memory block living in the C
 heap. Elements are stored according to the class <code>Storable</code>.
 You can obtain the pointer to the array contents to manipulate
 elements from languages like C.
</p><p>It is similar to <code><a href="Data-Array-IO.html#t:IOUArray">IOUArray</a></code> but slower.
 Its advantage is that it's compatible with C.
</p><p>Safe API only of <a href="Data-Array-Storable.html">Data.Array.Storable</a>.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span>  <a href="#t:StorableArray">StorableArray</a> i e</li><li class="src short">module <a href="Data-Array-MArray-Safe.html">Data.Array.MArray.Safe</a></li><li class="src short"><a href="#v:withStorableArray">withStorableArray</a> ::  <a href="Data-Array-Storable-Safe.html#t:StorableArray">StorableArray</a> i e -&gt; (<a href="../base-4.5.1.0/Foreign-Ptr.html#t:Ptr">Ptr</a> e -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a) -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:touchStorableArray">touchStorableArray</a> ::  <a href="Data-Array-Storable-Safe.html#t:StorableArray">StorableArray</a> i e -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li></ul></div><div id="interface"><h1 id="g:1">Arrays of <code>Storable</code> things.
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:StorableArray" class="def">StorableArray</a> i e </p><div class="doc"><p>The array type
</p></div><div class="subs instances"><p id="control.i:StorableArray" class="caption collapser" onclick="toggleSection('i:StorableArray')">Instances</p><div id="section.i:StorableArray" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Foreign-Storable.html#t:Storable">Storable</a> e =&gt; <a href="Data-Array-MArray.html#t:MArray">MArray</a> <a href="Data-Array-Storable-Safe.html#t:StorableArray">StorableArray</a> e <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><h1 id="g:2">Overloaded mutable array interface
</h1><div class="doc"><p>Module <a href="Data-Array-MArray.html">Data.Array.MArray</a> provides the interface of storable arrays.
 They are instances of class <code><a href="Data-Array-MArray.html#t:MArray">MArray</a></code> (with the <code><a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a></code> monad).
</p></div><div class="top"><p class="src">module <a href="Data-Array-MArray-Safe.html">Data.Array.MArray.Safe</a></p></div><h1 id="g:3">Accessing the pointer to the array contents
</h1><div class="top"><p class="src"><a name="v:withStorableArray" class="def">withStorableArray</a> ::  <a href="Data-Array-Storable-Safe.html#t:StorableArray">StorableArray</a> i e -&gt; (<a href="../base-4.5.1.0/Foreign-Ptr.html#t:Ptr">Ptr</a> e -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a) -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</p><div class="doc"><p>The pointer to the array contents is obtained by <code><a href="Data-Array-Storable-Safe.html#v:withStorableArray">withStorableArray</a></code>.
 The idea is similar to <code><a href="../base-4.5.1.0/Foreign-ForeignPtr-Safe.html#t:ForeignPtr">ForeignPtr</a></code> (used internally here).
 The pointer should be used only during execution of the <code><a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a></code> action
 retured by the function passed as argument to <code><a href="Data-Array-Storable-Safe.html#v:withStorableArray">withStorableArray</a></code>.
</p></div></div><div class="top"><p class="src"><a name="v:touchStorableArray" class="def">touchStorableArray</a> ::  <a href="Data-Array-Storable-Safe.html#t:StorableArray">StorableArray</a> i e -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>If you want to use it afterwards, ensure that you
 <code><a href="Data-Array-Storable-Safe.html#v:touchStorableArray">touchStorableArray</a></code> after the last use of the pointer,
 so the array is not freed too early.
</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>