You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//parameterized module
module M where
parameter
x : [10]
type y = 10
//instantiated module
module N=M where
x = 20
// importing instantiated module
module O where
import N
// but I'm not able to access x value here for some reason
The text was updated successfully, but these errors were encountered:
ajayeeralla
changed the title
Importing instantiation of the parameterized module doesn't make the values available
Importing instantiation of the parameterized module doesn't make those values available
Feb 27, 2021
Parameters are kept private. If you want to expose them, you can do something like this:
//parameterized module
module M where
parameter
_x : [10]
type y = 10
x = _x
//instantiated module
module N=M where
_x = 20
// importing instantiated module
module O where
import N
// Now you can access x
Ah, I didn't know that parameters are private and the above example works. Thanks @weaversa.
I have another question:
module M where
type x = 10
module N where
import M
type y = 20
module O where
import N
// but I'm not able to access x here but y only
// to access both x and y, I had import both M and N in this module
it seems to me that module importation isn't transitive?
The text was updated successfully, but these errors were encountered: