-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, we used `zip` to define `itraverse` for lists. This led to two problems: 1. Because the zip fused with the index generator, it could *not* fuse with the argument. 2. I ran into situations where the zip *didn't* fuse with the index generator, so my code ended up actually building *and saving* `[0..]` as a CAF. That's a nasty space leak, as well as slow. Writing `itraverse` for lists using `foldr` directly seems to clear up these issues. Unboxing the counter manually should prevent `Int` boxes from being allocated when the passed function doesn't need them.
- Loading branch information
Showing
1 changed file
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters