dimensions-0.3.1.0: Safe type-level dimensionality for multidimensional data.

Copyright(c) Artem Chirkin
LicenseBSD3
Maintainerchirkin@arch.ethz.ch
Safe HaskellNone
LanguageHaskell2010

Numeric.Dimensions.Traverse.ST

Description

Map a function over all dimensions provided dimension indices or offsets. This module provides a variant of traversal that lives in ST monad.

Synopsis

Documentation

overDim Source #

Arguments

:: Dim (ds :: [Nat]) 
-> (Idx ds -> Int# -> a -> ST s a)

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step

-> a 
-> ST s a 

Traverse over all dimensions keeping track of index and offset

overDim_ Source #

Arguments

:: Dim (ds :: [Nat]) 
-> (Idx ds -> Int# -> ST s ())

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step

-> ST s () 

Same as overDim#, but with no return value

overDimIdx :: Dim (ds :: [Nat]) -> (Idx ds -> a -> ST s a) -> a -> ST s a Source #

Traverse over all dimensions keeping track of indices

overDimIdx_ :: Dim (ds :: [Nat]) -> (Idx ds -> ST s ()) -> ST s () Source #

Traverse over all dimensions keeping track of indices, with no return value

overDimOff Source #

Arguments

:: Dim (ds :: [Nat]) 
-> (Idx ds -> Int# -> a -> ST s a)

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step

-> a 
-> ST s a 

Traverse over all dimensions keeping track of total offset

overDimOff_ Source #

Arguments

:: Dim (ds :: [Nat]) 
-> (Int# -> ST s ())

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step

-> ST s () 

Traverse over all dimensions keeping track of total offset, with not return value

overDimPart Source #

Arguments

:: forall (ds :: [Nat]). Dimensions ds 
=> Idx ds 
-> Idx ds 
-> (Idx ds -> Int# -> a -> ST s a)

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step

-> a 
-> ST s a 

Traverse from the first index to the second index in each dimension. Indices must be within Dim range, which is not checked. You can combine positive and negative traversal directions along different dimensions.

foldDim Source #

Arguments

:: Dim (ds :: [Nat]) 
-> (Idx ds -> Int# -> a -> a)

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step

-> a 
-> a 

Fold over all dimensions keeping track of index and offset

foldDimIdx :: Dim (ds :: [Nat]) -> (Idx ds -> a -> a) -> a -> a Source #

Fold all dimensions keeping track of indices

foldDimOff Source #

Arguments

:: Dim (ds :: [Nat]) 
-> (Int# -> a -> a)

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step

-> a 
-> a 

Fold over all dimensions keeping track of total offset