Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- addImplicitNestedImports :: [TopDecl PName] -> [TopDecl PName]