4 , AdtInfo, CanonicalAdt
5 , SourceModule, ValidModule, CanonicalModule, Optimized
8 , Interface(..), toInterface
9 , UserImport, DefaultImport, ImportMethod(..)
13import qualified Data.Map as Map
15import qualified AST.Declaration as Decl
16import qualified AST.Expression.Canonical as Canonical
17import qualified AST.Expression.Optimized as Optimized
18import qualified AST.Module.Name as Name
19import qualified AST.Type as Type
20import qualified AST.Variable as Var
21import qualified Docs.AST as Docs
22import qualified Elm.Package as Package
23import qualified Elm.Compiler.Version as Compiler
24import qualified Reporting.Annotation as A
27-- HELPFUL TYPE ALIASES
29type Interfaces = Map.Map Name.Canonical Interface
31type Types = Map.Map String Type.Canonical
32type Aliases = Map.Map String ([String], Type.Canonical)
33type ADTs = Map.Map String (AdtInfo String)
35type AdtInfo v = ( [String], [(v, [Type.Canonical])] )
36type CanonicalAdt = (Var.Canonical, AdtInfo Var.Canonical)
45 (Var.Listing (A.Located Var.Value))
52 ([DefaultImport], [UserImport])
53 (Var.Listing (A.Located Var.Value))
58 Module Docs.Centralized [Name.Raw] [Var.Value] (Body Canonical.Expr)
62 Module Docs.Centralized [Name.Raw] [Var.Value] (Body [Optimized.Def])
65data Module docs imports exports body = Module
66 { name :: Name.Canonical
68 , docs :: A.Located (Maybe docs)
78 , fixities :: [(Decl.Assoc, Int, String)]
87{-| Basic info needed to identify modules and determine dependencies. -}
88data Header imports = Header
90 , _docs :: A.Located (Maybe String)
91 , _exports :: Var.Listing (A.Located Var.Value)
98type UserImport = A.Located (Name.Raw, ImportMethod)
101type DefaultImport = (Name.Raw, ImportMethod)
104data ImportMethod = ImportMethod
105 { alias :: Maybe String
106 , exposedVars :: !(Var.Listing Var.Value)
112{-| Key facts about a module, used when reading info from .elmi files. -}
113data Interface = Interface
114 { iVersion :: Package.Version
115 , iPackage :: Package.Name
116 , iExports :: [Var.Value]
118 , iImports :: [Name.Raw]
120 , iAliases :: Aliases
121 , iFixities :: [(Decl.Assoc, Int, String)]
126toInterface :: Package.Name -> Optimized -> Interface
127toInterface pkgName modul =
128 let body' = body modul in
130 { iVersion = Compiler.version
132 , iExports = exports modul
133 , iTypes = types body'
134 , iImports = imports modul
135 , iAdts = datatypes body'
136 , iAliases = aliases body'
137 , iFixities = fixities body'
138 , iPorts = ports body'
142instance Binary Interface where
143 get = Interface <$> get <*> get <*> get <*> get <*> get <*> get <*> get <*> get <*> get
152 put (iFixities modul)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list