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.Compiler.Version as Compiler
25import qualified Reporting.Annotation as A
28-- HELPFUL TYPE ALIASES
30type Interfaces = Map.Map Name 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] [Var.Value] (Body Canonical.Expr)
63 Module Docs.Centralized [Name] [Var.Value] (Body Optimized.Expr)
66data Module docs imports exports body = Module
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)
97type Name = [String] -- must be non-empty
100nameToString :: Name -> String
105nameIsNative :: Name -> Bool
114type UserImport = A.Located (Name, ImportMethod)
117type DefaultImport = (Name, ImportMethod)
120data ImportMethod = ImportMethod
121 { alias :: Maybe String
122 , exposedVars :: !(Var.Listing Var.Value)
128{-| Key facts about a module, used when reading info from .elmi files. -}
129data Interface = Interface
131 , iExports :: [Var.Value]
135 , iAliases :: Aliases
136 , iFixities :: [(Decl.Assoc, Int, String)]
141toInterface :: CanonicalModule -> Interface
143 let body' = body modul in
145 { iVersion = Compiler.version
146 , iExports = exports modul
147 , iTypes = types body'
148 , iImports = imports modul
149 , iAdts = datatypes body'
150 , iAliases = aliases body'
151 , iFixities = fixities body'
152 , iPorts = ports body'
156instance Binary Interface where
157 get = Interface <$> get <*> get <*> get <*> get <*> get <*> get <*> get <*> get
165 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