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)
43 (Var.Listing (A.Located Var.Value))
49 ([DefaultImport], [UserImport])
50 (Var.Listing (A.Located Var.Value))
55 Module [Name] [Var.Value] CanonicalBody
58data Module imports exports body = Module
66data CanonicalBody = CanonicalBody
67 { program :: Canonical.Expr
69 , fixities :: [(Decl.Assoc, Int, String)]
78{-| Basic info needed to identify modules and determine dependencies. -}
79data Header imports = Header
81 , _exports :: Var.Listing (A.Located Var.Value)
86type Name = [String] -- must be non-empty
89nameToString :: Name -> String
94nameIsNative :: Name -> Bool
103type UserImport = A.Located (Name, ImportMethod)
106type DefaultImport = (Name, ImportMethod)
109data ImportMethod = ImportMethod
110 { alias :: Maybe String
111 , exposedVars :: !(Var.Listing Var.Value)
117{-| Key facts about a module, used when reading info from .elmi files. -}
118data Interface = Interface
120 , iExports :: [Var.Value]
124 , iAliases :: Aliases
125 , iFixities :: [(Decl.Assoc, Int, String)]
129toInterface :: CanonicalModule -> Interface
131 let body' = body modul in
133 { iVersion = Compiler.version
134 , iExports = exports modul
135 , iTypes = types body'
136 , iImports = imports modul
137 , iAdts = datatypes body'
138 , iAliases = aliases body'
139 , iFixities = fixities body'
140 , iPorts = ports body'
143instance Binary Interface where
144 get = Interface <$> 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