repa-array-4.1.0.1: Bulk array representations and operators.

Safe HaskellNone
LanguageHaskell98

Data.Repa.Array.Material.Boxed

Contents

Synopsis

Documentation

data B Source

Layout an array as flat vector of boxed elements.

UNSAFE: Indexing into raw material arrays is not bounds checked. You may want to wrap this with a Checked layout as well.

Constructors

Boxed 

Fields

boxedLength :: !Int
 

Instances

Eq B 
Show B 
Layout B

Boxed arrays.

Bulk B a

Boxed arrays.

Windowable B a

Boxed windows.

Target B a

Boxed buffers.

Eq (Name B) 
Show (Name B) 
Eq a => Eq (Array B a) 
Show a => Show (Array B a) 
Unpack (Buffer B a) (IOVector a) 
data Name B = B 
type Index B = Int 
data Array B = BArray !(Vector a) 
data Buffer B = BBuffer !(IOVector a) 

Conversions

fromBoxed :: Vector a -> Array B a Source

O(1). Wrap a boxed vector as an array.

toBoxed :: Array B a -> Vector a Source

O(1). Unwrap a boxed vector from an array.

Utils

decimate :: (a -> a -> Bool) -> Array B a -> Array B a Source

Scan through an array from front to back. For pairs of successive elements, drop the second one when the given predicate returns true.

This function can be used to remove duplicates from a sorted array.

TODO: generalise to other array types.