feldspar-language-0.7: A functional embedded language for DSP and parallelism

Safe HaskellNone

Feldspar.Core.Frontend.MutableArray

Synopsis

Documentation

newArr :: Type a => Data Length -> Data a -> M (Data (MArr a))Source

Create a new Mutable Array and intialize all elements

newArr_ :: Type a => Data Length -> M (Data (MArr a))Source

Create a new Mutable Array but leave the elements un-initialized

newListArr :: forall a. Type a => [Data a] -> M (Data (MArr a))Source

Create a new Mutable Array and initialize with elements from the list

getArr :: Type a => Data (MArr a) -> Data Index -> M (Data a)Source

Extract the element at index

setArr :: Type a => Data (MArr a) -> Data Index -> Data a -> M ()Source

Replace the value at index

modifyArr :: Type a => Data (MArr a) -> Data Index -> (Data a -> Data a) -> M ()Source

Modify the element at index

arrLength :: Type a => Data (MArr a) -> M (Data Length)Source

Query the length of the array

mapArray :: Type a => (Data a -> Data a) -> Data (MArr a) -> M (Data (MArr a))Source

Modify all elements

forArr :: Syntax a => Data Length -> (Data Index -> M a) -> M ()Source

swap :: Type a => Data (MArr a) -> Data Index -> Data Index -> M ()Source

Swap two elements