-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimized rewrite rule for $$ foldM, $$ fold, and enum $$ fold
This is *not* intended to be a final implementation. While this *is* optimal, the goal is to have a higher-level helper function which implements this kind of rewrite rule, and then use that function in all relevant functions in .List.
- Loading branch information
Showing
1 changed file
with
53 additions
and
1 deletion.
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
succ
is slower than just+1
because it checks for overflow, adding a branch!Implementation of succ for
Int
is as follows: