-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More efficient folds for Seq #1036
Comments
Might be worth noting that we already use a couple of extensions in a non-portable way
|
I started working on this today. The main difficulty I'm having is finding a good (not too awkward) way to get foldMapWithIndexFT :: Depth t -> ... -> t -> m When |
Hmmm ... Even that split leaves us with similar awkwardness. Bleh. |
Okay, I think I've worked through the
Related questions: Do we write other folds out in full, or define them using |
The folds we currently have are implemented directly, and generally marked I added some fold benchmarks in #1068, I hope they're useful in evaluating the new implementation including whether or not pragmas help. Performance on MicroHs is a whole another story, if we want to go there. I think there are bigger problems than coercions. For instance, going by the README, it doesn't fully implement BangPatterns.
We also don't have a way to measure performance, since we need |
The folds for digits and nodes can inline into the other folds. But GHC can't inline the folds going down |
We can define folds for
Seq
more efficiently. See thread starting #1016 (comment) and in particular the code by treeowl in #1016 (comment)The catch is that we need GADTs, which is not portable.
The text was updated successfully, but these errors were encountered: