Changes between Version 29 and Version 30 of WikiStart
- Timestamp:
- Jun 10, 2011, 2:46:44 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiStart
v29 v30 29 29 30 30 Q: How to I map a function across all slices in an array? [[br]] 31 A: This is not possible in general because we can't guarantee that the worker function will return a slice with the same shape as the original. If the slices only contain a few elements (up to six) then your best bet is to use an array of tuples and use the regular `map` function to apply the worker to all the tuples. This approach is limited to 6-tuples because that's the maximum the `Data.Vector` library currently supports, and `Repa` uses `Data.Vector` to store manifest arrays. See `http://repa.ouroborus.net/ticket/22`for discussion.31 A: This is not possible in general because we can't guarantee that the worker function will return a slice with the same shape as the original. If the slices only contain a few elements (up to six) then your best bet is to use an array of tuples and use the regular `map` function to apply the worker to all the tuples. This approach is limited to 6-tuples because that's the maximum the `Data.Vector` library currently supports, and `Repa` uses `Data.Vector` to store manifest arrays. See #22 for discussion. 32 32 33 33 Q: Where do I ask further questions? [[br]]