-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Labels
feature requestAsking for new or improved functionalityAsking for new or improved functionalityparameterized modulesRelated to Cryptol's parameterized modulesRelated to Cryptol's parameterized modules
Description
Surprisingly, one cannot write something like this using Cryptol's module system:
module TypeAlias where
interface submodule Interface where
type Alias = Bool
value: Alias
submodule Functor where
import interface submodule Interface
submodule Instance = submodule Functor where
value = False: Alias
Loading module TypeAlias
[error] at TypeAlias.cry:10:20--10:25
Type not in scope: Alias
On the other hand, if you leave off the explicit type signature for value in Instance:
submodule Instance = submodule Functor where
value = False
Then Cryptol accepts it. This works around the issue, but it is not a very satisfying workaround. Some use cases for functor instantiations involve complex type definitions, where redefining the type alias is complicated and redundant.
It would be nice if Cryptol provided some way to write value = False: Alias.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestAsking for new or improved functionalityAsking for new or improved functionalityparameterized modulesRelated to Cryptol's parameterized modulesRelated to Cryptol's parameterized modules