JS: perform loopification
Following on https://github.com/haskell/bytestring/pull/631 bytestring will be adding a -fpure-haskell
flag to remove all FFI (https://github.com/haskell/bytestring/pull/660) but the JS backend cannot yet generate efficient code for tight loops like the ones that are required for the flag.
Why? Because the JS backend does no loopification (See also this Note). This ticket is to:
-
add loopification in the StgToJS
pass -
add a test that detects this optimization has fired
What should it look like?