elm-in-elm / compiler / Elm.Data.Module

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


type alias Module expr =
{ imports : Dict Elm.Data.ModuleName.ModuleName Elm.Data.Import.Import
, name : Elm.Data.ModuleName.ModuleName
, filePath : Elm.Data.FilePath.FilePath
, declarations : Dict Elm.Data.VarName.VarName (Elm.Data.Declaration.Declaration expr)
, type_ : ModuleType
, exposing_ : Elm.Data.Exposing.Exposing 
}


type ModuleType
    = 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 -> Elm.Data.ModuleName.ModuleName -> Maybe Elm.Data.ModuleName.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 : Elm.Data.VarName.VarName -> Module a -> Basics.Bool

Does this module expose this variable name?