-
Notifications
You must be signed in to change notification settings - Fork 50
Fix shadow and pattern warnings #36
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
Conversation
I'll use this approach elsewhere too if we're happy with it. I don't really want to make a public |
I think I was planning to create |
Everything looks great, by the way. |
Yeah that makes sense actually. I assume |
Yes I think so. It would probably just define the unsafePartial :: forall a. (forall dummy. (Partial) => a) -> a
unsafePartial f = unsafeCoerce f unit and possibly some helper functions, like something to rethrow the pattern match error with a useful message. Incidentally, I'd like to be able to remove the |
Perhaps we should have it as |
But then every module would have a potential dependency on |
Re: dependency, that's true: maybe another option would be to put How would it lead to unhelpful errors though? I think adding a |
Yes, I'm suggesting |
Yeah, that's right. I suppose the advantage of the compiler adding the constraint is that it turns these exhaustivity warnings into actual errors, in that the We'll end up with an almost universal |
Yes, I think that's the best approach. So we'll leave |
Yeah I think so, I'll just duplicate it as needed for now, and then can take it all out again for 0.7.3 or whenever |
Sounds good. |
🚢 |
unsafeThrow
is a bit dodgy, but getting meaningful errors from unsafe failures may be worthwhile? I think we do that in the unsafe FFI in some other places.