Make listArray and newListArray good consumers
- Deduplicate
listArrayST
,listUArrayST
andnewListArray
which have identical definitions. - Make
newListArray
usefoldr
, which can fuse with the input list of elements.listArray
also benefits because it gets rewritten by rules to usenewListArray
.
Closes #8 (closed).
Note: This MR does not change the definition of listArray
(used when it does not get rewritten), which is also not fusion-friendly due to a zip [0..] es
. This definition is not used for any of the defined array instances because all of them have rewrite rules, but will be for user-defined instances. It can be made fusion-friendly but needs some changes which I don't want to burden this MR with.
Edited by meooow