purescript-0.8.5.0: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell98

Language.PureScript.Sugar.Names

Synopsis

Documentation

desugarImports :: forall m. (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => [ExternsFile] -> [Module] -> m [Module] Source

Replaces all local names with qualified names within a list of modules. The modules should be topologically sorted beforehand.

type Env = Map ModuleName (SourceSpan, Imports, Exports) Source

The imports and exports for a collection of modules. The SourceSpan is used to store the source location of the module with a given name, used to provide useful information when there is a duplicate module definition.

data ImportRecord a Source

The details for an import: the name of the thing that is being imported (x if importing from A), the module that the thing was originally defined in (for re-export resolution), and the import provenance (see below).

data ImportProvenance Source

Used to track how an import was introduced into scope. This allows us to handle the one-open-import special case that allows a name conflict to become a warning rather than being an unresolvable situation.

data Imports Source

The imported declarations for a module, including the module's own members.

Constructors

Imports 

Fields

importedTypes :: Map (Qualified (ProperName TypeName)) [ImportRecord (ProperName TypeName)]

Local names for types within a module mapped to to their qualified names

importedTypeOps :: Map (Qualified Ident) [ImportRecord Ident]

Local names for type operators within a module mapped to to their qualified names

importedDataConstructors :: Map (Qualified (ProperName ConstructorName)) [ImportRecord (ProperName ConstructorName)]

Local names for data constructors within a module mapped to to their qualified names

importedTypeClasses :: Map (Qualified (ProperName ClassName)) [ImportRecord (ProperName ClassName)]

Local names for classes within a module mapped to to their qualified names

importedValues :: Map (Qualified Ident) [ImportRecord Ident]

Local names for values within a module mapped to to their qualified names

importedModules :: Set ModuleName

The modules that have been imported into the current scope.

importedVirtualModules :: Set ModuleName

The names of "virtual" modules that come into existence when "import as" is used.

data Exports Source

The exported declarations from a module.

Constructors

Exports 

Fields

exportedTypes :: [((ProperName TypeName, [ProperName ConstructorName]), ModuleName)]

The types exported from each module along with the module they originally came from.

exportedTypeOps :: [(Ident, ModuleName)]

The type operators exported from each module along with the module they originally came from.

exportedTypeClasses :: [(ProperName ClassName, ModuleName)]

The classes exported from each module along with the module they originally came from.

exportedValues :: [(Ident, ModuleName)]

The values exported from each module along with the module they originally came from.