Skip to content
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

Consider using descriptive type errors for invalid cast cases #5

Open
Martoon-00 opened this issue Oct 29, 2020 · 6 comments
Open

Consider using descriptive type errors for invalid cast cases #5

Martoon-00 opened this issue Oct 29, 2020 · 6 comments

Comments

@Martoon-00
Copy link

Martoon-00 commented Oct 29, 2020

As far as I understand, currently, when I use e.g. intCast incorrectly, I will get Couldn't match type ‘'False’ with ‘'True’ error. It may be not immediately obvious that the conversion method is used incorrectly, and the types between which we convert are not mentioned here so understanding the cause of the failure may take a bit of extra time.

I propose using TypeError to provide better error messages. For instance, it is possible to define some CheckIntSubType wrapper over IsIntSubType that would report Cannot convert a to b error on failure, and then conversion methods can use these Check* constraints instead of ~ 'True.

I'm really happy that I finally found this library, and to me it looks like the most proper solution to the problem; hope it could be polished to final bits of perfection. 🙂

@hvr
Copy link
Collaborator

hvr commented Oct 29, 2020 via email

@Martoon-00
Copy link
Author

Hey @hvr, had you have a chance to look into this proposal?

@andreasabel
Copy link
Member

Atm @hvr is the only hackage maintainer of this package, so even if a PR landed, it could not be published.
This would require a hackage takeover.

@Martoon-00, do you want to take over this package? If yes, please carry out the Takeover procedure. I can then give you rights on this repo.

@Martoon-00
Copy link
Author

@andreasabel Thanks for bumping on this.

I personally have no opportunity to take handling this package. But maybe I know a person who would...

@lierdakil
Copy link

@andreasabel hi, I'm the person in question. While we're here, do you happen to know whether @hvr is available at all, i.e. does it make sense to try to contact them via e-mail first?

@andreasabel
Copy link
Member

@andreasabel hi, I'm the person in question. While we're here, do you happen to know whether @hvr is available at all, i.e. does it make sense to try to contact them via e-mail first?

@lierdakil Great to see you are willing to take over this package.

The process should be followed. Can you please open a new issue here where we can track the progress of the takeover with the following steps? (If I open the issues, you cannot tick off the boxes because of lack of permissions.)

  • Try to contact the maintainer. Give them reasonable time to respond.
  • State your intention to take over the package in a public forum (we recommend the haskell discourse and/or the haskell-cafe). CC the maintainer.
  • Wait a while.
  • Send an email to the hackage administrators (hackage-admin@haskell.org), with a link to the public email thread.
  • The admins will grant you maintenance rights or upload a patched version for you.

You can cut the response period of the first item short (say a week), because it is (by extrapolation of the current interaction pattern) unlikely that @hvr will respond---but you never know.

@lierdakil lierdakil mentioned this issue Jul 6, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants