|
Data.Array.Vector.UArr | Portability | non-portable (GADTS) | Stability | internal | Maintainer | Roman Leshchinskiy <rl@cse.unsw.edu.au> |
|
|
|
|
|
Description |
Description ---------------------------------------------------------------
This module defines unlifted arrays generically as a GADT.
Slicing is implemented by each BUArr having the slicing information. A
possible alternative design would be to maintain this information in
UArr, but not in the representations, but at the root. This may seem
attractive at first, but seems to be more disruptive without any real
benefits _ this is essentially, because we then need the slicing
information at each level; ie, also at the leafs where it is sufficient
using the current implementation.
Todo ----------------------------------------------------------------------
|
|
Synopsis |
|
|
|
|
Array types and classes containing the admissable elements types
|
|
|
This type class determines the types that can be elements immutable
unboxed arrays. The representation type of these arrays is defined by way
of an associated type. All representation-dependent functions are methods
of this class.
| | Associated Types | | The basic array datatype.
|
| | |
| | Methods | | O(1?). Yield the length of an unboxed array.
| | | | | O(1). sliceU restricts access to a subrange of the original array
(no copying).
| | | O(1). lengthMU yields the length of a mutable unboxed array.
| | | O(1). newMU allocates a mutable unboxed array of the specified length.
| | | O(1). readMU reads the element at the specified index of a mutable
unboxed array.
| | | O(1). writeMU writes a new value to the specified index of a
mutable unboxed array.
| | | O(n). copyMU copies the contents of an immutable unboxed array into
a mutable one starting from the specified index.
| | | O(1). unsafeFreezeMU converts a prefix of a mutable array into an
immutable unboxed array, without copying. The mutable array must not be
mutated after this.
| | | Copy a portion of one mutable array to a second.
| | | Copy a portion of one mutable array to a second, beginning at the
specified offsets for each.
| | | Copy a portion of one mutable array to a second, beginning at the
specified offsets for each. This operation is safe even if the source
and destination are the same.
|
| | Instances | |
|
|
class UAE e => UPrim e where | Source |
|
| Methods | | | Instances | |
|
|
Basic operations on parallel arrays
|
|
|
O(1). Yield an array of units.
|
|
|
O(1). Elementwise pairing of array elements.
N.B: The output will be as long as the first array (and will thus
access past the end of the second array), unlike its List counterpart.
This will not occur at the time zipU is called, but only after the resulting
array is accessed.
|
|
|
O(1). Elementwise unpairing of array elements.
|
|
|
O(1). Yield the first components of an array of pairs.
|
|
|
O(1). Yield the second components of an array of pairs.
|
|
|
O(n). newU constructs an immutable array of the given size by
performing the provided initialization function on a mutable representation
of the output array.
|
|
|
|
|
|
|
O(1). unsafeFreezeAllMU converts an entire mutable array into an
immutable array, without copying. The mutable array must not be mutated
after this.
|
|
|
Elementwise pairing of mutable arrays. This is an unsafe
operation, as no copying is performed, so changes to the
pair array will affect the original arrays, and vice versa.
|
|
|
Elementwise unpairing of mutable arrays. This is an unsafe
operation, as no copying is performed, so changes to the
unpaired arrays will affect the original, and vice versa.
|
|
I/O
|
|
|
| Methods | | | Instances | |
|
|
Produced by Haddock version 2.4.2 |