-
Notifications
You must be signed in to change notification settings - Fork 150
Proposal: Name representation and resolution #2572
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
base: develop
Are you sure you want to change the base?
Conversation
Hi @pieter-bos — thanks! This sounds like an excellent idea to me. I also like the proposal: @facundominguez or @nikivazou do you see any issues? A (much!) more “extreme” approach would be to have some version of fixpoints ExprV just for LH and make these different kinds of names different Var variants there. (This is what “flux” the LH for rust does which allows us to handle const generics there) but this proposal seems more pragmatic given the present state. thanks!!! |
👋 Thanks for the proposal! Introducing uniques looks plausible. I share some questions below. The proposal mentions Considering alternatives, I could only think of the following. Maybe you already have a good argument to prefer uniques: It would be helpful to collect here the issues that would be helped with this proposal. Or you could create some, if they are not written yet. At the moment, I don't know what examples would be possible to verify after the proposal is implemented. |
Thanks for the prompt feedback!
On review I specifically meant
Hmm, I see two obstacles (please correct me if I'm mistaken about anything):
Actually I suppose then that collisions between
Will do! |
That looks like adopting the rapier approach. Section 2 of this paper [link] gives a short account of the difficulties. If it were only In this place of the code, I had to determine the scope of the various bindings in RTypeV [link]. It may help define other functions that also need to understand the scope of bindings like
Maybe the transformation from GHC name to symbol could include the unique as a suffix. But I don't claim to know all the trouble that this will create. Also, note that there is a place in the code that is hardcoding the liquidhaskell/liquidhaskell-boot/src/Language/Haskell/Liquid/Types/PredType.hs Lines 261 to 262 in f049893
Might not affect bindings. |
Hello! We'd like to contribute some work to get to a state where we can add refinement types to the prelude of Clash. I thought it would be good to start by improving the support for mentioning value-kind type variables in refinements; here phrased as a proposal so that we can discuss a plan.
It is still somewhat light on details, but broadly I'd suggest to continue adopting
LHName
overSymbol
to represent names, in our case especially for local names. I'd also suggest adding an equivalent of GHC'sUnique
toLHName
, to remove the need to make names unique prior to or along resolution.Curious to hear what you think!