cryptol-3.1.0: Cryptol: The Language of Cryptography
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cryptol.ModuleSystem.Renamer.ImplicitImports

Description

We add implicit imports are for public nested modules. This allows using definitions from nested modules without having to explicitly import them, for example:

module A where

submodule B where x = 0x20

y = x // This works because of the implicit import of B

Restriction: ============

We only add impicit imports of modules that are syntactically visiable in the source code. Consider the following example:

module A where submodule M = F {X} -- F,X are external modules (e.g., top-level)

We will add an implicit import for M, but *NO* implicit imports for any modules imported vial M as those are not sytnactically visible in the source (i.e., we have to know what F refers to).

This restriction allows us to add implicit imports before doing the Imports pass.

Synopsis

Documentation

addImplicitNestedImports :: [TopDecl PName] -> [TopDecl PName] Source #

Add additional imports for modules nested withing this one