Generalize instantiations with interface
#1689
Labels
feature request
Asking for new or improved functionality
parameterized modules
Related to Cryptol's parameterized modules
Cryptol allows "passing through" parameters like this:
This means that when
F
is instantiated with some moduleA
,M
will be defined by instantiatingG
with the sameM
.At present,
I
needs to always be a parameter to the current functor. It would make sense to generalize this to allowI
be a parameter of an outer functor too, for example, like this:Note that in this case
Inner
is not a functor and has not parameters, but the definition ofM
still makes sense.This should be fairly easy to implement, because at present the instantiation
G { interface I }
is implemented by desugaring to an anonymous module:This exact same thing should work if
I
was a parameter to an outer functor too, so mostly we'd have to modify the code to look for the closest enclosing matching parameter.The text was updated successfully, but these errors were encountered: