Verified
Modules 15

Data.Array.Storable.Internals

experimental

Actual implementation of Data.Array.Storable.

WARNING

This module is considered internal.

The Package Versioning Policy does not apply.

The contents of this module may change in any way whatsoever and without any warning between minor versions of this package.

Authors importing this module are expected to track development closely.

withStorableArray :: StorableArray i e -> (Ptr e -> IO a) -> IO a

The pointer to the array contents is obtained by withStorableArray. The idea is similar to ForeignPtr (used internally here). The pointer should be used only during execution of the IO action retured by the function passed as argument to withStorableArray.

touchStorableArray :: StorableArray i e -> IO ()

If you want to use it afterwards, ensure that you touchStorableArray after the last use of the pointer, so the array is not freed too early.

unsafeForeignPtrToStorableArray :: Ix i => ForeignPtr e -> (i, i) -> IO (StorableArray i e)

Construct a StorableArray from an arbitrary ForeignPtr. It is the caller's responsibility to ensure that the ForeignPtr points to an area of memory sufficient for the specified bounds.

Instances

1
  • instance Storable e => MArray StorableArray e IO
Maintainer
libraries@haskell.org
Portability
non-portable (uses Data.Array.MArray)
Copyright
(c) The University of Glasgow 2011
License
BSD-style (see the file libraries/base/LICENSE)
Build record and source files

Verified build. The service reproduced this documentation.

Target: Linux on x86-64. Some inferred types and resolved links are not available.

Generator: aihc-haddock-7b0c8493-web-1

Metadata snapshot: 10bf2eab3c8818e91375122614fd52da6b643c8772e4ede6e094d3ea680122b7

Open the dependency plan · Download the documentation model

Import a package

Enter a package name and an exact version from Hackage. The site contains imported versions only.