Skip to content

Increase rendered typed holes to max of 30#4341

Merged
JordanMartinez merged 1 commit intopurescript:masterfrom
JordanMartinez:jam/increase-hole-amounts
Jun 24, 2022
Merged

Increase rendered typed holes to max of 30#4341
JordanMartinez merged 1 commit intopurescript:masterfrom
JordanMartinez:jam/increase-hole-amounts

Conversation

@JordanMartinez
Copy link
Copy Markdown
Contributor

Description of the change

Fixes #4340


Checklist:

  • Added a file to CHANGELOG.d for this PR (see CHANGELOG.d/README.md)
  • Added myself to CONTRIBUTORS.md (if this is my first contribution)
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

Copy link
Copy Markdown
Member

@rhendric rhendric left a comment

Choose a reason for hiding this comment

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

I suppose the best way to have an actual conversation about a number this arbitrary and unexciting is to change it and see who complains!

@natefaubion
Copy link
Copy Markdown
Contributor

natefaubion commented May 27, 2022

One thing I'm not aware of is whether the size of the list that's forced contributes to how much work is done to compute it. That is, it's already pretty slow at 5 items. Does changing it to 30 or whatever increase the work significantly (ie. is the list produced lazily)? If the same work is done regardless, then it doesn't really matter.

@rhendric
Copy link
Copy Markdown
Member

The list ultimately comes from

-- | Get locally-bound names in context, to create an error message.
getLocalContext :: MonadState CheckState m => m Context
getLocalContext = do
env <- getEnv
return [ (ident, ty') | (Qualified Nothing ident@Ident{}, (ty', _, Defined)) <- M.toList (names env) ]

Clearly some work is saved by truncating that list but the only meaningful source of laziness I see here is if names env contains some lazy values.

@JordanMartinez
Copy link
Copy Markdown
Contributor Author

What would be a good way to confirm whether this adds a lot of work or not?

@JordanMartinez
Copy link
Copy Markdown
Contributor Author

One way we could test this is do a prerelease and see what people find in their usage of it. It's not hard to change this back to 5 (or some other higher-than-5 number). This is also not a breaking change, so we can adjust this as needed.

@purefunctor
Copy link
Copy Markdown
Member

I think trialing this for 0.15.3 would be fine.

@JordanMartinez JordanMartinez added this to the v0.15.3 milestone Jun 23, 2022
@JordanMartinez
Copy link
Copy Markdown
Contributor Author

Part of me wonder if this should be merged as the first 0.15.4 prerelease. If we had merged this back when I got Ryan's approval, then we could have gotten early feedback about whether 30 is a good number or causes problems. With 0.15.3 coming out next Tuesday (per our 6-week release cycle), this PR hasn't had a lot of soak time.

Alternatively, this could get merged and 0.15.3 released. And if there are any issues, we make a quick 0.15.4 release that reverts this change. I think I'd lean towards this approach.

@JordanMartinez
Copy link
Copy Markdown
Contributor Author

With 0.15.3 released, I'm merging this. We have another 6 weeks to see what issues this change may create before making a full release.

@JordanMartinez JordanMartinez merged commit 9cfc6c0 into purescript:master Jun 24, 2022
@JordanMartinez JordanMartinez deleted the jam/increase-hole-amounts branch June 24, 2022 14:13
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.

Increase max limit for rendered type holes

4 participants