-
Notifications
You must be signed in to change notification settings - Fork 52
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
Type Hole Inference (post merge) #1155
base: dev
Are you sure you want to change the base?
Conversation
…easured.re (offset of grout set based on associated annotation, if any) and in Code.re (text for grout set to annotation, if any)
…ons present. fixes issues with lists in inference
…tation with red emptyholedec svg
Editor.new_state calls State.next which calculates measurements. Before calculating measurements, update the annotations with a call to mk_map(). Store annotations in Editor state to avoid using globals. Measurements still work after removing previous change to Cell.re
… more logic for occurs failure handling into CI, where prompts can explain the unsolved status
Sorry for the wall of text; tldr, fixed with new behavior illustrated below So after unification, it's solved as pts = {?, T, Int ->(pts)}. The occurs check as implemented makes it so that becomes {?, T, Int -> ?} and the general filtering rule for making suggestions out of ptses is to prefer 'non-nodes' over nodes if possible (which is anything that isn't a plain var or hole)- that filters it down to Int -> ? The 'solution' in this case would be the set {T, Int -> T, Int -> Int -> T, ...}. Our filtering rules reads to Int -> T, where the issue is detected, and replaces T with ?. Before ADTs were added, so when the occurs failure could only happen on holes (eg ? or Int -> ?), saying ? was always useless so we'd just suggest Int -> ? while marking occurs failing ptses as unsolved. With type variables, (T vs Int -> T) the two possibilities are each valid suggestions as they are inconsistent with one another. To facilitate this, changing the filtering so that when it comes to type variables, keep at least one when filtering the pts if the occurs check has failed. When occurs hasn't failed, still filtering all type variables is non hole/var alternatives exist (eg Z, Int -> T will have the suggestion Int -> T, and A, Int will have the suggestion Int) |
…rove/hazel into thi-old-engine-with-merge
@RaefM I think there must be a bug in your recent fixes -- the following should certainly not infer Also still seeing this issue where there isn't a conflict arising from the conflicted patterns: |
No description provided.