Skip to content

Updating HLint to require using 'pure' instead of 'return' #720

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

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

Conversation

recursion-ninja
Copy link
Collaborator

Update the .hlint.yaml to require using pure instead of return. This change is intended to future-proof the code-base for the "Monad of No Return" proposal.

The changes touch a lot of the code-base and if the churn is deemed too high for negligible benefits, we can delete this pull request.

@recursion-ninja recursion-ninja force-pushed the recursion-ninja/hlint-no-return branch from 9f384c5 to 8be794c Compare May 12, 2025 17:10
@jorisdral
Copy link
Collaborator

Update the .hlint.yaml to require using pure instead of return. This change is intended to future-proof the code-base for the "Monad of No Return" proposal.

The changes touch a lot of the code-base and if the churn is deemed too high for negligible benefits, we can delete this pull request.

Would return be removed from base because of the monad of no return proposal? I can't easily see that from the link you posted

Copy link
Collaborator

@wenkokke wenkokke left a comment

Choose a reason for hiding this comment

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

This looks good to me, but it might be best to not merge this until just before we release version 1.0.0, so that there's fewer PRs impacted by this.

@wenkokke
Copy link
Collaborator

wenkokke commented May 12, 2025

Update the .hlint.yaml to require using pure instead of return. This change is intended to future-proof the code-base for the "Monad of No Return" proposal.

The changes touch a lot of the code-base and if the churn is deemed too high for negligible benefits, we can delete this pull request.

Would return be removed from base because of the monad of no return proposal? I can't easily see that from the link you posted

I think the proposal is to make return a top level function rather than a member of the Monad class.

The reason to prioritise pure over return would be to not require a Monad constraint where it isn't needed. The proposal would take care of this by removing the Monad constraint from return.

However, I do support using pure over return for consistency reasons.

@recursion-ninja
Copy link
Collaborator Author

However, I do support using pure over return for consistency reasons.

I'm of a similar mind.

This looks good to me, but it might be best to not merge this until just before we release version 1.0.0, so that there's fewer PRs impacted by this.

Agreed, let's let this sit for a bit and revisit it just before or just after cutting the v1.0.0 release.

@wenkokke
Copy link
Collaborator

This looks good to me, but it might be best to not merge this until just before we release version 1.0.0, so that there's fewer PRs impacted by this.

Agreed, let's let this sit for a bit and revisit it just before or just after cutting the v1.0.0 release.

Let's do just before.

@recursion-ninja
Copy link
Collaborator Author

This looks good to me, but it might be best to not merge this until just before we release version 1.0.0, so that there's fewer PRs impacted by this.

Agreed, let's let this sit for a bit and revisit it just before or just after cutting the v1.0.0 release.

Let's do just before.

My preference as well 👍.

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.

3 participants