Skip to content

Make listArray and newListArray good consumers

meooow requested to merge meooow/array:listArray-fuse into master
  • Deduplicate listArrayST, listUArrayST and newListArray which have identical definitions.
  • Make newListArray use foldr, which can fuse with the input list of elements. listArray also benefits because it gets rewritten by rules to use newListArray.

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

Merge request reports