Safe Haskell | None |
---|---|

Language | Haskell2010 |

- newArr :: Type a => Data Length -> Data a -> M (Data (MArr a))
- newArr_ :: Type a => Data Length -> M (Data (MArr a))
- newListArr :: forall a. Type a => [Data a] -> M (Data (MArr a))
- getArr :: Type a => Data (MArr a) -> Data Index -> M (Data a)
- setArr :: Type a => Data (MArr a) -> Data Index -> Data a -> M ()
- modifyArr :: Type a => Data (MArr a) -> Data Index -> (Data a -> Data a) -> M ()
- arrLength :: Type a => Data (MArr a) -> M (Data Length)
- mapArray :: Type a => (Data a -> Data a) -> Data (MArr a) -> M (Data (MArr a))
- forArr :: Syntax a => Data Length -> (Data Index -> M a) -> M ()
- swap :: Type a => Data (MArr a) -> Data Index -> Data Index -> M ()

# 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

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

Modify the element at index