2 ( Interfaces, CanonicalInterfaces
4 , AdtInfo, CanonicalAdt
5 , SourceModule, ValidModule, CanonicalModule, Optimized
8 , Name, nameToString, nameIsNative
9 , CanonicalName(..), canonPkg, canonModul
10 , Interface(..), toInterface
11 , UserImport, DefaultImport, ImportMethod(..)
14import Control.Applicative ((<$>),(<*>))
16import qualified Data.List as List
17import qualified Data.Map as Map
19import qualified AST.Declaration as Decl
20import qualified AST.Expression.Canonical as Canonical
21import qualified AST.Expression.Optimized as Optimized
22import qualified AST.Type as Type
23import qualified AST.Variable as Var
24import qualified Docs.AST as Docs
25import qualified Elm.Package as Package
26import qualified Elm.Compiler.Version as Compiler
27import qualified Reporting.Annotation as A
30-- HELPFUL TYPE ALIASES
32type Interfaces = Map.Map Name Interface
33type CanonicalInterfaces = Map.Map CanonicalName Interface
35type Types = Map.Map String Type.Canonical
36type Aliases = Map.Map String ([String], Type.Canonical)
37type ADTs = Map.Map String (AdtInfo String)
39type AdtInfo v = ( [String], [(v, [Type.Canonical])] )
40type CanonicalAdt = (Var.Canonical, AdtInfo Var.Canonical)
49 (Var.Listing (A.Located Var.Value))
56 ([DefaultImport], [UserImport])
57 (Var.Listing (A.Located Var.Value))
62 Module Docs.Centralized [Name] [Var.Value] (Body Canonical.Expr)
66 Module Docs.Centralized [Name] [Var.Value] (Body Optimized.Expr)
69data Module docs imports exports body = Module
72 , docs :: A.Located (Maybe docs)
82 , fixities :: [(Decl.Assoc, Int, String)]
91{-| Basic info needed to identify modules and determine dependencies. -}
92data Header imports = Header
94 , _docs :: A.Located (Maybe String)
95 , _exports :: Var.Listing (A.Located Var.Value)
100type Name = [String] -- must be non-empty
105 { canonPkg :: Package.Name
110nameToString :: Name -> String
115nameIsNative :: Name -> Bool
124type UserImport = A.Located (Name, ImportMethod)
127type DefaultImport = (Name, ImportMethod)
130data ImportMethod = ImportMethod
131 { alias :: Maybe String
132 , exposedVars :: !(Var.Listing Var.Value)
138{-| Key facts about a module, used when reading info from .elmi files. -}
139data Interface = Interface
141 , iExports :: [Var.Value]
145 , iAliases :: Aliases
146 , iFixities :: [(Decl.Assoc, Int, String)]
151toInterface :: CanonicalModule -> Interface
153 let body' = body modul in
155 { iVersion = Package.versionToString Compiler.version
156 , iExports = exports modul
157 , iTypes = types body'
158 , iImports = imports modul
159 , iAdts = datatypes body'
160 , iAliases = aliases body'
161 , iFixities = fixities body'
162 , iPorts = ports body'
166instance Binary Interface where
167 get = Interface <$> get <*> get <*> get <*> get <*> get <*> get <*> get <*> get
175 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