X-Git-Url: https://mattmccutchen.net/match/match.git/blobdiff_plain/05a6f0edaacc70ab373988ec4bafdf9963551004..eb6c3c9f810799e3bfe8cd302dd9d00f97b4baf7:/program/ArrayStuff.hs diff --git a/program/ArrayStuff.hs b/program/ArrayStuff.hs index 8fcced9..ceb7516 100644 --- a/program/ArrayStuff.hs +++ b/program/ArrayStuff.hs @@ -18,3 +18,6 @@ array2DtoListOfLists arr = -- Use instead of amap when the array implementation needs to change. -- E.g., mapping an unboxed array to an array whose elements must be boxed. amap2 f arr = funcArray (bounds arr) (\i -> f (arr ! i)) + +-- Like amap2 but the mapping function is also passed the index. +aixmap f arr = funcArray (bounds arr) (\i -> f i (arr ! i))