-
Notifications
You must be signed in to change notification settings - Fork 123
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
Importing instantiation of the parameterized module doesn't make those values available #1092
Comments
Parameters are kept private. If you want to expose them, you can do something like this:
|
Ah, I didn't know that parameters are private and the above example works. Thanks @weaversa. I have another question:
it seems to me that module importation isn't transitive? |
Yes, this helps keep the namespace under control. |
I see. Thanks |
Hi @weaversa, I stumbled across the above problem of module import not being transitive, and spent an afternoon until I stumbled across this issue that mentions the non-transitivity. I really feel module (and functor) import ought be transitive—that's what users I presume expect if nothing else said. Otherwise, the manual ought mention that in capital letters, i.e., in https://galoisinc.github.io/cryptol/master/Modules.html. It is, of course, possible to work around the lack-of-transitivity issue but this gets very messy if one tries to build deeper hierarchies of (patametrized) modules, i.e., to capture product lines of cryptographic algorithms build on top of a hierarchy of algebraic structures to instantiate those algorithms. (Finding a solution for #1699 would also be excellent and useful in that context.) My question: Would it make sense to reopen this issue? |
Mostly you don't want imports to be transitive, but sometimes you do; this is why ML has both Meanwhile, can you file a new issue about the docs? |
Thanks David, having an PS: I will file an issue about the docs later on today! Cheers—Frank |
Cryptol absolutely already has IMHO (soapbox!) -- parameters should be public. It is idiomatic is Cryptol (and many other languages) to import modules as qualified, pulling in only what you need -- namespace pollution is not a strong argument here (above, I was parroting guidance I was given, that doesn't mean I agree with it). I believe #1699 is the current attempt to fix this wart -- a recent example: https://github.com/GaloisInc/cryptol-specs/blob/0278cf946f1f419c42533bac7980e04465899389/Primitive/Keyless/Hash/SHA2Imperative/SHA.cry#L61) |
The The current plan is to do #1699 indeed, we just need to find the resources to fix it. I don't believe it should be complicated to implement, as nothing major should change. |
The text was updated successfully, but these errors were encountered: