Copyright | (c) Artem Chirkin |
---|---|
License | BSD3 |
Maintainer | chirkin@arch.ethz.ch |
Safe Haskell | None |
Language | Haskell2010 |
Map a function over all dimensions provided dimension indices or offsets.
- overDim# :: Dim (ds :: [Nat]) -> (Idx ds -> Int# -> a -> State# s -> (#State# s, a#)) -> Int# -> Int# -> a -> State# s -> (#State# s, a#)
- overDim_# :: Dim (ds :: [Nat]) -> (Idx ds -> Int# -> State# s -> State# s) -> Int# -> Int# -> State# s -> State# s
- overDimIdx# :: Dim (ds :: [Nat]) -> (Idx ds -> a -> State# s -> (#State# s, a#)) -> a -> State# s -> (#State# s, a#)
- overDimIdx_# :: Dim (ds :: [Nat]) -> (Idx ds -> State# s -> State# s) -> State# s -> State# s
- overDimOff# :: Dim (ds :: [Nat]) -> (Int# -> a -> State# s -> (#State# s, a#)) -> Int# -> Int# -> a -> State# s -> (#State# s, a#)
- overDimOff_# :: Dim (ds :: [Nat]) -> (Int# -> State# s -> State# s) -> Int# -> Int# -> State# s -> State# s
- overDimPart# :: forall ds a s. Dimensions ds => Idx ds -> Idx ds -> (Idx ds -> Int# -> a -> State# s -> (#State# s, a#)) -> Int# -> Int# -> a -> State# s -> (#State# s, a#)
- foldDim :: Dim (ds :: [Nat]) -> (Idx ds -> Int# -> a -> a) -> Int# -> Int# -> a -> a
- foldDimIdx :: Dim (ds :: [Nat]) -> (Idx ds -> a -> a) -> a -> a
- foldDimOff :: Dim (ds :: [Nat]) -> (Int# -> a -> a) -> Int# -> Int# -> a -> a
- foldDimReverse :: Dim (ds :: [Nat]) -> (Idx ds -> Int# -> a -> a) -> Int# -> Int# -> a -> a
- foldDimReverseIdx :: Dim (ds :: [Nat]) -> (Idx ds -> a -> a) -> a -> a
Documentation
:: Dim (ds :: [Nat]) | |
-> (Idx ds -> Int# -> a -> State# s -> (#State# s, a#)) | function to map over each dimension |
-> Int# | Initial offset |
-> Int# | offset step |
-> a | |
-> State# s | |
-> (#State# s, a#) |
Traverse over all dimensions keeping track of index and offset
:: Dim (ds :: [Nat]) | |
-> (Idx ds -> Int# -> State# s -> State# s) | function to map over each dimension |
-> Int# | Initial offset |
-> Int# | offset step |
-> State# s | |
-> State# s |
Same as overDim#, but with no return value
overDimIdx# :: Dim (ds :: [Nat]) -> (Idx ds -> a -> State# s -> (#State# s, a#)) -> a -> State# s -> (#State# s, a#) Source #
Traverse over all dimensions keeping track of indices
overDimIdx_# :: Dim (ds :: [Nat]) -> (Idx ds -> State# s -> State# s) -> State# s -> State# s Source #
Traverse over all dimensions keeping track of indices, with no return value
:: Dim (ds :: [Nat]) | |
-> (Int# -> a -> State# s -> (#State# s, a#)) | function to map over each dimension |
-> Int# | Initial offset |
-> Int# | offset step |
-> a | |
-> State# s | |
-> (#State# s, a#) |
Traverse over all dimensions keeping track of total offset
:: Dim (ds :: [Nat]) | |
-> (Int# -> State# s -> State# s) | function to map over each dimension |
-> Int# | Initial offset |
-> Int# | offset step |
-> State# s | |
-> State# s |
Traverse over all dimensions keeping track of total offset, with not return value
:: forall (ds :: [Nat]). Dimensions ds | |
=> Idx ds | |
-> Idx ds | |
-> (Idx ds -> Int# -> a -> State# s -> (#State# s, a#)) | function to map over each dimension |
-> Int# | Initial offset |
-> Int# | offset step |
-> a | |
-> State# s | |
-> (#State# 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.
:: 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
:: 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