-
Notifications
You must be signed in to change notification settings - Fork 179
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
Foldable Conversions #351
Comments
On Oct 21, 2016 10:06 AM, "Andrew Martin" [email protected] wrote:
|
Perhaps my reasoning is a bit naive, but if we were attempting to change the type signature of Change:
To:
|
Hi. While browsing the issue here, I see this has come up several times, but not sure whether there is a definitive answer. So, would you consider a PR generalizing the two functions mentionned ? Should the other from*ListWith also generalized ? P.S. : I'm quite new to Haskell, so please correct me if I've missed reasons why this is the way it is. |
Regarding It does seem redundant to add |
This is related to some of what I brought up in #338. I was just working with Data.Set and wanted to call unions on some foldable collection of Sets. I can just write:
And that works fine. And for some data structures, the intermediate list may even get fused away. Maybe. But any time I have to call toList on a Foldable, I'm unsatisfied because whatever cosumes the list could have been written to just fold over the collection instead. It seems like generalizing unions should be possible (although it does use a special variant of foldl).
Additionally, having a fromFoldable would be nice. It would be misleading to generalize fromList since the name would then be misleading.
But for the most part, I would like the see the functions whose names don't explicitly mention the word "list" be generalized, with rewrite rules to use the tunes list variants when possible.
The text was updated successfully, but these errors were encountered: