4 , AdtInfo, CanonicalAdt
5 , SourceModule, ValidModule, CanonicalModule, Optimized
8 , Interface(..), toInterface
9 , UserImport, DefaultImport, ImportMethod(..)
12import Control.Applicative ((<$>),(<*>))
14import qualified Data.Map as Map
16import qualified AST.Declaration as Decl
17import qualified AST.Expression.Canonical as Canonical
18import qualified AST.Expression.Optimized as Optimized
19import qualified AST.Module.Name as Name
20import qualified AST.Type as Type
21import qualified AST.Variable as Var
22import qualified Docs.AST as Docs
23import qualified Elm.Package as Package
24import qualified Elm.Compiler.Version as Compiler
25import qualified Reporting.Annotation as A
28-- HELPFUL TYPE ALIASES
30type Interfaces = Map.Map Name.Canonical Interface
32type Types = Map.Map String Type.Canonical
33type Aliases = Map.Map String ([String], Type.Canonical)
34type ADTs = Map.Map String (AdtInfo String)
36type AdtInfo v = ( [String], [(v, [Type.Canonical])] )
37type CanonicalAdt = (Var.Canonical, AdtInfo Var.Canonical)
46 (Var.Listing (A.Located Var.Value))
53 ([DefaultImport], [UserImport])
54 (Var.Listing (A.Located Var.Value))
59 Module Docs.Centralized [Name.Raw] [Var.Value] (Body Canonical.Expr)
66data Module docs imports exports body = Module
67 { name :: Name.Canonical
69 , docs :: A.Located (Maybe docs)
79 , fixities :: [(Decl.Assoc, Int, String)]
88{-| Basic info needed to identify modules and determine dependencies. -}
89data Header imports = Header
91 , _docs :: A.Located (Maybe String)
92 , _exports :: Var.Listing (A.Located Var.Value)
99type UserImport = A.Located (Name.Raw, ImportMethod)
102type DefaultImport = (Name.Raw, ImportMethod)
105data ImportMethod = ImportMethod
106 { alias :: Maybe String
107 , exposedVars :: !(Var.Listing Var.Value)
113{-| Key facts about a module, used when reading info from .elmi files. -}
114data Interface = Interface
115 { iVersion :: Package.Version
116 , iPackage :: Package.Name
117 , iExports :: [Var.Value]
119 , iImports :: [Name.Raw]
121 , iAliases :: Aliases
122 , iFixities :: [(Decl.Assoc, Int, String)]
127toInterface :: Package.Name -> CanonicalModule -> Interface
128toInterface pkgName modul =
129 let body' = body modul in
131 { iVersion = Compiler.version
133 , iExports = exports modul
134 , iTypes = types body'
135 , iImports = imports modul
136 , iAdts = datatypes body'
137 , iAliases = aliases body'
138 , iFixities = fixities body'
139 , iPorts = ports body'
143instance Binary Interface where
144 get = Interface <$> get <*> get <*> get <*> get <*> get <*> get <*> get <*> get <*> get
153 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