Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Array traversals and folds
Synopsis
- foreachArr :: (Tuple ix, Tuple a) => Arr ix a -> ((ix, a) -> SE ()) -> SE ()
- foreachArrD :: (Tuple ix, Tuple a) => Arr ix a -> ((ix, a) -> SE ()) -> SE ()
- forRowArr :: Tuple a => Sig -> Arr Sig2 a -> ((Sig, a) -> SE ()) -> SE ()
- forColumnArr :: Tuple a => Sig -> Arr Sig2 a -> ((Sig, a) -> SE ()) -> SE ()
- forRowArrD :: Tuple a => D -> Arr D2 a -> ((D, a) -> SE ()) -> SE ()
- forColumnArrD :: Tuple a => D -> Arr D2 a -> ((D, a) -> SE ()) -> SE ()
- foldArr :: (Tuple ix, Tuple a, Tuple b) => ((ix, a) -> b -> SE b) -> b -> Arr ix a -> SE b
- foldRowArr :: (Tuple a, Tuple b) => ((Sig, a) -> b -> SE b) -> b -> Sig -> Arr Sig2 a -> SE b
- foldColumnArr :: (Tuple a, Tuple b) => ((Sig, a) -> b -> SE b) -> b -> Sig -> Arr Sig2 a -> SE b
- foldRowsArrD :: (Tuple a, Tuple b) => ((D, a) -> b -> SE b) -> b -> D -> Arr D2 a -> SE b
- foldColumnsArrD :: (Tuple a, Tuple b) => ((D, a) -> b -> SE b) -> b -> D -> Arr D2 a -> SE b
Documentation
foreachArr :: (Tuple ix, Tuple a) => Arr ix a -> ((ix, a) -> SE ()) -> SE () Source #
Traverses all elements of the array array and applies a procedure to each element. The procedure takes in a pair of index and the current value at the given index.
foreachArrD :: (Tuple ix, Tuple a) => Arr ix a -> ((ix, a) -> SE ()) -> SE () Source #
Traverses all elements of the array at the **init rate** and applies a procedure to each element. The procedure takes in a pair of index and the current value at the given index.
forRowArr :: Tuple a => Sig -> Arr Sig2 a -> ((Sig, a) -> SE ()) -> SE () Source #
Traverses all elements in the given row of 2D array at the signal rate and applies a procedure to all elements.
forColumnArr :: Tuple a => Sig -> Arr Sig2 a -> ((Sig, a) -> SE ()) -> SE () Source #
Traverses all elements in the given column of 2D array at the signal rate and applies a procedure to all elements.
forRowArrD :: Tuple a => D -> Arr D2 a -> ((D, a) -> SE ()) -> SE () Source #
Traverses all elements in the given row of 2D array at the init rate and applies a procedure to all elements.
forColumnArrD :: Tuple a => D -> Arr D2 a -> ((D, a) -> SE ()) -> SE () Source #
Traverses all elements in the given column of 2D array at the init rate and applies a procedure to all elements.
foldArr :: (Tuple ix, Tuple a, Tuple b) => ((ix, a) -> b -> SE b) -> b -> Arr ix a -> SE b Source #
Traverses an array and accumulates a value. We invoke the function with accumulator function, initial value and the array.
foldRowArr :: (Tuple a, Tuple b) => ((Sig, a) -> b -> SE b) -> b -> Sig -> Arr Sig2 a -> SE b Source #
Traverses a row in the array and accumulates a value. We invoke the function with accumulator function, initial value and the array with signal of the row number.
foldRowArr accum initValue rowId array
foldColumnArr :: (Tuple a, Tuple b) => ((Sig, a) -> b -> SE b) -> b -> Sig -> Arr Sig2 a -> SE b Source #
Traverses a column in the array and accumulates a value. We invoke the function with accumulator function, initial value and the array with signal of the row number.
foldColumnArr accum initValue columnId array
foldRowsArrD :: (Tuple a, Tuple b) => ((D, a) -> b -> SE b) -> b -> D -> Arr D2 a -> SE b Source #
Traverses a row at the **init rate** in the array and accumulates a value. We invoke the function with accumulator function, initial value and the array with signal of the row number.
foldRowArr accum initValue rowId array
foldColumnsArrD :: (Tuple a, Tuple b) => ((D, a) -> b -> SE b) -> b -> D -> Arr D2 a -> SE b Source #
Traverses a column at the **init rate** in the array and accumulates a value. We invoke the function with accumulator function, initial value and the array with signal of the row number.
foldColumnArr accum initValue columnId array