| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Language.PureScript.Sugar.Names.Env
Synopsis
- data ImportRecord a = ImportRecord {}
- data ImportProvenance
- data Imports = Imports {
- importedTypes :: ImportMap (ProperName 'TypeName)
- importedTypeOps :: ImportMap (OpName 'TypeOpName)
- importedDataConstructors :: ImportMap (ProperName 'ConstructorName)
- importedTypeClasses :: ImportMap (ProperName 'ClassName)
- importedValues :: ImportMap Ident
- importedValueOps :: ImportMap (OpName 'ValueOpName)
- importedModules :: Set ModuleName
- importedQualModules :: Set ModuleName
- importedKinds :: ImportMap (ProperName 'TypeName)
- nullImports :: Imports
- data Exports = Exports {
- exportedTypes :: Map (ProperName 'TypeName) ([ProperName 'ConstructorName], ExportSource)
- exportedTypeOps :: Map (OpName 'TypeOpName) ExportSource
- exportedTypeClasses :: Map (ProperName 'ClassName) ExportSource
- exportedValues :: Map Ident ExportSource
- exportedValueOps :: Map (OpName 'ValueOpName) ExportSource
- nullExports :: Exports
- type Env = Map ModuleName (SourceSpan, Imports, Exports)
- primEnv :: Env
- primExports :: Exports
- envModuleExports :: (a, b, Exports) -> Exports
- data ExportMode
- exportType :: MonadError MultipleErrors m => SourceSpan -> ExportMode -> Exports -> ProperName 'TypeName -> [ProperName 'ConstructorName] -> ExportSource -> m Exports
- exportTypeOp :: MonadError MultipleErrors m => SourceSpan -> Exports -> OpName 'TypeOpName -> ExportSource -> m Exports
- exportTypeClass :: MonadError MultipleErrors m => SourceSpan -> ExportMode -> Exports -> ProperName 'ClassName -> ExportSource -> m Exports
- exportValue :: MonadError MultipleErrors m => SourceSpan -> Exports -> Ident -> ExportSource -> m Exports
- exportValueOp :: MonadError MultipleErrors m => SourceSpan -> Exports -> OpName 'ValueOpName -> ExportSource -> m Exports
- checkImportConflicts :: forall m a. (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => SourceSpan -> ModuleName -> (a -> Name) -> [ImportRecord a] -> m (ModuleName, ModuleName)
Documentation
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).
Constructors
| ImportRecord | |
Fields | |
Instances
| Show a => Show (ImportRecord a) Source # | |
Defined in Language.PureScript.Sugar.Names.Env Methods showsPrec :: Int -> ImportRecord a -> ShowS # show :: ImportRecord a -> String # showList :: [ImportRecord a] -> ShowS # | |
| Eq a => Eq (ImportRecord a) Source # | |
Defined in Language.PureScript.Sugar.Names.Env Methods (==) :: ImportRecord a -> ImportRecord a -> Bool # (/=) :: ImportRecord a -> ImportRecord a -> Bool # | |
| Ord a => Ord (ImportRecord a) Source # | |
Defined in Language.PureScript.Sugar.Names.Env Methods compare :: ImportRecord a -> ImportRecord a -> Ordering # (<) :: ImportRecord a -> ImportRecord a -> Bool # (<=) :: ImportRecord a -> ImportRecord a -> Bool # (>) :: ImportRecord a -> ImportRecord a -> Bool # (>=) :: ImportRecord a -> ImportRecord a -> Bool # max :: ImportRecord a -> ImportRecord a -> ImportRecord a # min :: ImportRecord a -> ImportRecord a -> ImportRecord a # | |
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.
Constructors
| FromImplicit | |
| FromExplicit | |
| Local | |
| Prim |
Instances
| Show ImportProvenance Source # | |
Defined in Language.PureScript.Sugar.Names.Env Methods showsPrec :: Int -> ImportProvenance -> ShowS # show :: ImportProvenance -> String # showList :: [ImportProvenance] -> ShowS # | |
| Eq ImportProvenance Source # | |
Defined in Language.PureScript.Sugar.Names.Env Methods (==) :: ImportProvenance -> ImportProvenance -> Bool # (/=) :: ImportProvenance -> ImportProvenance -> Bool # | |
| Ord ImportProvenance Source # | |
Defined in Language.PureScript.Sugar.Names.Env Methods compare :: ImportProvenance -> ImportProvenance -> Ordering # (<) :: ImportProvenance -> ImportProvenance -> Bool # (<=) :: ImportProvenance -> ImportProvenance -> Bool # (>) :: ImportProvenance -> ImportProvenance -> Bool # (>=) :: ImportProvenance -> ImportProvenance -> Bool # max :: ImportProvenance -> ImportProvenance -> ImportProvenance # min :: ImportProvenance -> ImportProvenance -> ImportProvenance # | |
The imported declarations for a module, including the module's own members.
Constructors
| Imports | |
Fields
| |
The exported declarations from a module.
Constructors
| Exports | |
Fields
| |
nullExports :: Exports Source #
An empty Exports value.
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.
primExports :: Exports Source #
The exported types from the Prim module
data ExportMode Source #
When updating the Exports the behaviour is slightly different depending
on whether we are exporting values defined within the module or elaborating
re-exported values. This type is used to indicate which behaviour should be
used.
Instances
| Show ExportMode Source # | |
Defined in Language.PureScript.Sugar.Names.Env Methods showsPrec :: Int -> ExportMode -> ShowS # show :: ExportMode -> String # showList :: [ExportMode] -> ShowS # | |
| Eq ExportMode Source # | |
Defined in Language.PureScript.Sugar.Names.Env | |
exportType :: MonadError MultipleErrors m => SourceSpan -> ExportMode -> Exports -> ProperName 'TypeName -> [ProperName 'ConstructorName] -> ExportSource -> m Exports Source #
Safely adds a type and its data constructors to some exports, returning an error if a conflict occurs.
exportTypeOp :: MonadError MultipleErrors m => SourceSpan -> Exports -> OpName 'TypeOpName -> ExportSource -> m Exports Source #
Safely adds a type operator to some exports, returning an error if a conflict occurs.
exportTypeClass :: MonadError MultipleErrors m => SourceSpan -> ExportMode -> Exports -> ProperName 'ClassName -> ExportSource -> m Exports Source #
Safely adds a class to some exports, returning an error if a conflict occurs.
exportValue :: MonadError MultipleErrors m => SourceSpan -> Exports -> Ident -> ExportSource -> m Exports Source #
Safely adds a value to some exports, returning an error if a conflict occurs.
exportValueOp :: MonadError MultipleErrors m => SourceSpan -> Exports -> OpName 'ValueOpName -> ExportSource -> m Exports Source #
Safely adds a value operator to some exports, returning an error if a conflict occurs.
checkImportConflicts :: forall m a. (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => SourceSpan -> ModuleName -> (a -> Name) -> [ImportRecord a] -> m (ModuleName, ModuleName) Source #
When reading a value from the imports, check that there are no conflicts in scope.