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

Get rid of an incomplete pattern match #247

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

josephcsible
Copy link

No description provided.

@@ -202,7 +202,7 @@ Extract the string that comes before the module declaration...
> . table_text

> lib_content lib_text
> = let (pre,_drop_me : post) = break (== "fakeimport DATA") $ lines lib_text
> = let (pre,post) = break (== "fakeimport DATA") $ lines lib_text
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make such a change? I think it is hurting code comprehensibility more than helping it.
The current formulation makes clear that the _drop_me : post match MUST succeed, even if GHC does not see it.
The new formulation clouds this insight.
So, I am against such a change.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it would be better to add an explicit pattern match with an error .... It would be even better to try to use NonEmpty.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NonEmpty is available from base-compat for old GHC versions back to 7.0 (base-4.3), so that would not be a problem for keeping all currently supported GHC versions.

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

Successfully merging this pull request may close these issues.

None yet

3 participants