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
Use HasCallStack and error in GHC.List and .NonEmpty #5
Comments
+1 |
5 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
Thanks everyone, approved unanimously. |
I'm probably way too late to do anything about this now, but I find it very surprising that this change was approved so easily. I have argued against adding |
@goldfirere proposed partialityIsOK :: HasCallStack => String -> (IsPartial => r) -> r |
@tomjaguarpaw I would highly advise that we ask the PureScript community about their usage and experience of their own |
@simonmar During the (very) heated debates, an alternative approach was suggested which was that we would have a |
I explored a bit but didn't find any very heated debates, can you help me with a link or two? |
Yes, those are hard questions that the PureScript community has to deal with, which is why I highly suggest that we survey them to see how their engineering practices have evolved on their side, to deal with |
We've definitely had people wondering whether the absence of a Partial constraint implies that a function is total, although off the top of my head I am not sure I remember whether I've seen people trip over this in their actual code. What I have seen, though, is that it's hard to explain how to use the class effectively. I wrote some documentation for the Partial class in PureScript but in the wild, in my experience, it's much more common to see people just slap our version of Another thing that I think is worth mentioning, although which is possibly less applicable to Haskell than it is to PureScript, is that it's worth being clear about how the |
I think my proposed partialityIsOK :: HasCallStack => String -> (IsPartial => r) -> r |
The proposal was raised in May and approved in October. This is as far from "easily" as I can imagine.
Please refer to the links in #5 (comment). I would like to highlight that there was plenty of time to discuss and propose alternatives ( |
I'm not complaining that I wasn't consulted, I mean sure, if I don't actively read the libraries mailing list then I'm sure I'll miss things. No, my surprise was really that nobody seemed to be worried about the aesthetics of the feature, and the impact on new users and teaching. As far as I can tell, my previous objection to this wasn't mentioned either - I just dug it up, I think this is it: https://gitlab.haskell.org/ghc/ghc/-/issues/11035#note_109305 |
@simonmar I guess the main difference is that when you raised your objections six years ago |
Not quite. It certainly helps to have a call stack to hand if it does turn out to blow up at runtime, but what I had in mind was people misunderstanding how minimum :: [a] -> a
minimum = foldr1 min This will fail because there's no minimum :: [a] -> a
minimum = partialityIsOK "minimum should not be used with empty arrays" (foldr1 min) despite the fact that the partiality has not been handled. |
Yes, I was thinking the |
Indeed, |
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 🙂 |
The original proposal was raised on May 30 by @phadej https://mail.haskell.org/pipermail/libraries/2021-May/031246.html, accompanied by detailed impact analysis. There were extensive discussions on the proposal in June. On Jul 7 @phadej asked CLC to trigger a vote on the proposal in https://mail.haskell.org/pipermail/libraries/2021-July/031355.html.
Merge request is available at https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6772. GHC developers seem to be on board with it.
Since CLC vote is long overdue, I would like to trigger it immediately. Members of CLC are encouraged to vote in replies to this issue.
The text was updated successfully, but these errors were encountered: