-
Notifications
You must be signed in to change notification settings - Fork 14
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
Export getSolo from Data.Tuple #113
Comments
Yep, fully in favor of it. |
+1 |
@treeowl could you please raise an MR, so that we can proceed with a vote? |
@Bodigrim Please trigger a vote. |
Dear CLC members, let's vote on the proposal to export +1 from me. As explained in the proposal, this is a generally useful function, and users should not reach out to |
Since it appears to be a somewhat subtle distinction on matching on I'm also wondering if it's possible to give it a more suggestive name for the For example, the case arr `indexA` 12 of
Solo a -> insert "hello" a m One way to rewrite this would be: insert "hello" (getSolo $ arr `indexA` 12) m If I just have my "referential transparency" hat on, then I'd imagine these to be equivalent expressions - but I suspect that they're not. So perhaps some docs explaining when you'd want to use I am generally +1 on exposing it, since it seems like an oversight, but I'd also like to take the chance to potentially find a more illustrative name and/or provide some docs. |
Yes, these two aren't equivalent w.r.t. laziness (the latter doesn't force the array access), but that's a general thing, nothing specific to |
@parsonsmatt just to be clear, are you happy to +1 the MR as is? Additional documentation if any can be added without CLC approval. In general, CLC members are encouraged to discuss proposals before a vote is triggered. |
I will add Haddocks. I think pointing out the laziness distinction is a good idea, given the purpose of |
I would like to hold In general, I think I'd be fine to +1 the MR as-is provided that there's a follow-up issue somewhere to add the documentation, if not actually adding the documentation then. |
I'm sorry if I jumped the gun asking for a vote. I will push a documentation commit tonight. |
Nothing to apologize for 😄 I'm just getting caught up on everything and would have made the same comment whether you'd requested a vote or not. |
+1 |
1 similar comment
+1 |
While I am a bit concerned about increasing the surface area of base. I don't think that concern should outweigh the prospect of not having to reach for ghc-prim. So +1 from me. |
+1 |
+1 It's a non-breaking change, and since |
@parsonsmatt I've added a commit to document |
https://hackage-search.serokell.io/?q=GHC.Tuple.*Solo Surprisingly but technically that will be a breaking change, though not in |
Addition: And in long term it would be nicer if |
That's not at all surprising when |
@treeowl the search I made was OTOH, |
+1 - thanks for the comment, that's very helpful! |
Thanks all, the proposal to re-export @treeowl if you want to do something else than re-export (e. g., redefine, or remove from |
Proposed in [CLC proposal #113](haskell/core-libraries-committee#113) and [approved by the CLC](haskell/core-libraries-committee#113 (comment))
Proposed in [CLC proposal #113](haskell/core-libraries-committee#113) and [approved by the CLC](haskell/core-libraries-committee#113 (comment))
Proposed in [CLC proposal #113](haskell/core-libraries-committee#113) and [approved by the CLC](haskell/core-libraries-committee#113 (comment))
I'm trying to summarise the state of this proposal as part of my volunteering effort to track the progress of all
Please, let me know if you find any mistakes 🙂 |
GHC.Tuple
provides a functionUnfortunately, that's not available in
Data.Tuple
, so anyone who wants to use it must depend onghc-prim
. I propose to export it fromData.Tuple
.It may not be immediately obvious why this function is useful. After all, the point of
Solo
is generally to control evaluation in a fine-grained way through pattern matching. However, traversals provide a significant application. For example, one might want to write a function to map over a container strictly:All the "interesting" pattern matching on
Solo
is being done by itsApplicative
instance here, and we just want to get out at the end.The text was updated successfully, but these errors were encountered: