1{-# OPTIONS_GHC -Wall #-}
2module SourceSyntax.Module where
5import qualified Data.Map as Map
6import Control.Applicative ((<$>), (<*>))
8import SourceSyntax.Expression (LExpr)
9import SourceSyntax.Declaration
10import SourceSyntax.Type
12import qualified Elm.Internal.Version as Version
15 Module [String] Exports Imports [def]
18type Exports = [String]
20type Imports = [(String, ImportMethod)]
21data ImportMethod = As String | Importing [String] | Hiding [String]
22 deriving (Eq, Ord, Show)
24instance Binary ImportMethod where
26 let put' n info = putWord8 n >> put info in
29 Importing ss -> put' 1 ss
30 Hiding ss -> put' 2 ss
32 get = do tag <- getWord8
35 1 -> Importing <$> get
37 _ -> error "Error reading valid ImportMethod type from serialized string"
44 , imports :: [(String, ImportMethod)]
46 , types :: Map.Map String Type
47 , fixities :: [(Assoc, Int, String)]
53type Interfaces = Map.Map String ModuleInterface
54type ADT = (String, [String], [(String,[Type])])
55type Alias = (String, [String], Type)
59 { iVersion :: Version.Version
60 , iTypes :: Map.Map String Type
61 , iImports :: [(String, ImportMethod)]
64 , iFixities :: [(Assoc, Int, String)]
68metaToInterface :: MetadataModule -> ModuleInterface
69metaToInterface metaModule =
71 { iVersion = Version.elmVersion
72 , iTypes = types metaModule
73 , iImports = imports metaModule
74 , iAdts = datatypes metaModule
75 , iAliases = aliases metaModule
76 , iFixities = fixities metaModule
77 , iPorts = ports metaModule
80instance Binary ModuleInterface where
81 get = ModuleInterface <$> get <*> get <*> get <*> get <*> get <*> get <*> get
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