elm-in-elm/compiler/1.0.1

Elm.Data.Module

Module information (corresponds to a single .elm file). Name, imports, contents, etc.

type alias Module expr =
{ imports : Dict ModuleName Import
, name : ModuleName
, filePath : FilePath
, declarations : Dict VarName (Declaration expr)
, type_ : ModuleType
, exposing_ : Exposing
}
= PlainModule
| PortModule
| EffectModule
module Main exposing ...
--> PlainModule


port module Main exposing ...
--> PortModule


effect module Main where ... exposing ...
--> EffectModule
map : (a -> b) -> Module a -> Module b

Apply a function to all the expressions inside the module.

unalias : Module a -> ModuleName -> Maybe ModuleName

Reverses the aliasing in import statements for a single module name.

Given import Foo as F:

unalias module_ "F"
--> Just "Foo"


unalias module_ "Foo"
--> Nothing


unalias module_ "Foox"
--> Nothing
exposes : VarName -> Module a -> Bool

Does this module expose this variable name?