-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: *
-kinded holes which are solved by BRAT
#69
Conversation
^^^ | ||
|
||
Expected to work out values for these holes: | ||
In checking_check_defs_1_g_1_Eval 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does #54 help here? I guess we can punt it until that if this goes in first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff and nice minimal PR! :)
brat/Brat/Checker/Monad.hs
Outdated
RemoveHope e -> let hset = hopes ctx in | ||
if M.member e hset | ||
then handler (k ()) (ctx { hopes = M.delete e hset }) g | ||
else Left (dumbErr (InternalError ("Trying to remove Hope not in set: " ++ show e))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else Left (dumbErr (InternalError ("Trying to remove Hope not in set: " ++ show e))) | |
else Left (dumbErr (InternalError ("Trying to remove unknown Hope: " ++ show e))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe some $
s too
brat/Brat/Checker/SolveHoles.hs
Outdated
[e1, e2] | e1 == e2 -> pure () -- trivially same, even if both still yet-to-be-defined | ||
_es -> error "TODO: must wait for one or the other to become more defined" | ||
|
||
-- This will update the `hopes` set, potentially invalidating things that have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- This will update the `hopes` set, potentially invalidating things that have | |
-- This will update the `hopes, potentially invalidating things that have |
typeEqEta _ (Zy :* _ :* _) hopes Nat exp act | ||
| Just (SPar (InEnd e)) <- isNumVar exp, M.member e hopes = solveHope Nat e act | ||
| Just (SPar (InEnd e)) <- isNumVar act, M.member e hopes = solveHope Nat e exp | ||
-- 2. harder cases, neither is in the hope set, so we can't define it ourselves |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- 2. harder cases, neither is in the hope set, so we can't define it ourselves | |
-- 2. harder cases, neither is in `hopes`, so we can't define it ourselves |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left hope set
as OK terminology, but removed things like
`hopes` set
!
as type to be inferred when there is exactly one solution.typeEq
fromeqTest
, into new SolveHoles.hs, with some beginnings of support for nat holesdoesntOccur
from SolvePatterns.hs to Eval.hs and factor outgetNumVar
hlint
s in Helpers.hspullPorts
and Parser.hspullAndJuxt
Closes #28.