4 , AdtInfo, CanonicalAdt
5 , SourceModule, ValidModule, CanonicalModule
6 , Module(..), CanonicalBody(..)
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.Type as Type
21import qualified AST.Variable as Var
22import qualified Elm.Compiler.Version as Compiler
23import qualified Reporting.Annotation as A
26-- HELPFUL TYPE ALIASES
28type Interfaces = Map.Map Name Interface
30type Types = Map.Map String Type.Canonical
31type Aliases = Map.Map String ([String], Type.Canonical)
32type ADTs = Map.Map String (AdtInfo String)
34type AdtInfo v = ( [String], [(v, [Type.Canonical])] )
35type CanonicalAdt = (Var.Canonical, AdtInfo Var.Canonical)
41 Module [UserImport] (Var.Listing Var.Value) [Decl.SourceDecl]
45 ([DefaultImport], [UserImport])
46 (Var.Listing Var.Value)
50 Module [Name] [Var.Value] CanonicalBody
53data Module imports exports body = Module
61data CanonicalBody = CanonicalBody
62 { program :: Canonical.Expr
64 , fixities :: [(Decl.Assoc, Int, String)]
73{-| Basic info needed to identify modules and determine dependencies. -}
74data Header imports = Header
76 , _exports :: Var.Listing Var.Value
81type Name = [String] -- must be non-empty
84nameToString :: Name -> String
89nameIsNative :: Name -> Bool
98type UserImport = A.Located (Name, ImportMethod)
101type DefaultImport = (Name, 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
115 , iExports :: [Var.Value]
119 , iAliases :: Aliases
120 , iFixities :: [(Decl.Assoc, Int, String)]
124toInterface :: CanonicalModule -> Interface
126 let body' = body modul in
128 { iVersion = Compiler.version
129 , iExports = exports modul
130 , iTypes = types body'
131 , iImports = imports modul
132 , iAdts = datatypes body'
133 , iAliases = aliases body'
134 , iFixities = fixities body'
135 , iPorts = ports body'
138instance Binary Interface where
139 get = Interface <$> get <*> get <*> get <*> get <*> get <*> get <*> get <*> get
147 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