4 , AdtInfo, CanonicalAdt
5 , SourceModule, ValidModule, CanonicalModule, Optimized
8 , Name, nameToString, nameIsNative
9 , Interface(..), toInterface
10 , UserImport, DefaultImport, ImportMethod(..)
13import Control.Applicative ((<$>),(<*>))
15import qualified Data.List as List
16import qualified Data.Map as Map
18import qualified AST.Declaration as Decl
19import qualified AST.Expression.Canonical as Canonical
20import qualified AST.Expression.Optimized as Optimized
21import qualified AST.Type as Type
22import qualified AST.Variable as Var
23import qualified Docs.AST as Docs
24import qualified Elm.Package as Package
25import qualified Elm.Compiler.Version as Compiler
26import qualified Reporting.Annotation as A
29-- HELPFUL TYPE ALIASES
31type Interfaces = Map.Map Name Interface
33type Types = Map.Map String Type.Canonical
34type Aliases = Map.Map String ([String], Type.Canonical)
35type ADTs = Map.Map String (AdtInfo String)
37type AdtInfo v = ( [String], [(v, [Type.Canonical])] )
38type CanonicalAdt = (Var.Canonical, AdtInfo Var.Canonical)
47 (Var.Listing (A.Located Var.Value))
54 ([DefaultImport], [UserImport])
55 (Var.Listing (A.Located Var.Value))
60 Module Docs.Centralized [Name] [Var.Value] (Body Canonical.Expr)
64 Module Docs.Centralized [Name] [Var.Value] (Body Optimized.Expr)
67data Module docs imports exports body = Module
70 , docs :: A.Located (Maybe docs)
80 , fixities :: [(Decl.Assoc, Int, String)]
89{-| Basic info needed to identify modules and determine dependencies. -}
90data Header imports = Header
92 , _docs :: A.Located (Maybe String)
93 , _exports :: Var.Listing (A.Located Var.Value)
98type Name = [String] -- must be non-empty
101nameToString :: Name -> String
106nameIsNative :: Name -> Bool
115type UserImport = A.Located (Name, ImportMethod)
118type DefaultImport = (Name, ImportMethod)
121data ImportMethod = ImportMethod
122 { alias :: Maybe String
123 , exposedVars :: !(Var.Listing Var.Value)
129{-| Key facts about a module, used when reading info from .elmi files. -}
130data Interface = Interface
132 , iExports :: [Var.Value]
136 , iAliases :: Aliases
137 , iFixities :: [(Decl.Assoc, Int, String)]
142toInterface :: CanonicalModule -> Interface
144 let body' = body modul in
146 { iVersion = Package.versionToString Compiler.version
147 , iExports = exports modul
148 , iTypes = types body'
149 , iImports = imports modul
150 , iAdts = datatypes body'
151 , iAliases = aliases body'
152 , iFixities = fixities body'
153 , iPorts = ports body'
157instance Binary Interface where
158 get = Interface <$> get <*> get <*> get <*> get <*> get <*> get <*> get <*> get
166 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