Safe Haskell | None |
---|---|
Language | Haskell98 |
Documentation
Delayed arrays wrap functions from an index to element value.
The index space is specified by an inner layout, l
.
Every time you index into a delayed array the element at that position is recomputed.
Delayed | |
|
Eq (Name l) => Eq (Name (D l)) | |
Eq l => Eq (D l) | |
Show (Name l) => Show (Name (D l)) | |
Show l => Show (D l) | |
Layout l => Layout (D l) | Delayed arrays. |
Layout l => Bulk (D l) a | Delayed arrays. |
(Layout l1, Target l2 a) => Load (D l1) l2 a | |
data Name (D l) = D (Name l) | |
type Index (D l) = Index l | |
data Array (D l) = ADelayed !l (Index l -> a) |
fromFunction :: l -> (Index l -> a) -> Array (D l) a Source
Wrap a function as a delayed array.
> toList $ fromFunction (Linear 10) (* 2) = [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]