1{-# LANGUAGE DeriveDataTypeable #-}
2module SourceSyntax.Module where
6import Data.List (intercalate)
7import qualified Data.Map as Map
8import Control.Applicative ((<$>), (<*>))
9import Control.Arrow (second)
11import SourceSyntax.Expression (LExpr)
12import SourceSyntax.Declaration
13import SourceSyntax.Type
14import System.FilePath (joinPath)
15import Control.Monad (liftM)
17import Paths_Elm (version)
18import Data.Version (showVersion)
21 Module [String] Exports Imports [Declaration tipe var]
24type Exports = [String]
26type Imports = [(String, ImportMethod)]
27data ImportMethod = As String | Importing [String] | Hiding [String]
28 deriving (Eq, Ord, Show, Data, Typeable)
30instance Binary ImportMethod where
31 put (As s) = do put (0 :: Word8)
34 put (Importing ss) = do put (1 :: Word8)
37 put (Hiding ss) = do put (2 :: Word8)
40 get = do tag <- getWord8
43 1 -> liftM Importing get
46data MetadataModule t v = MetadataModule {
50 imports :: [(String, ImportMethod)],
52 types :: Map.Map String Type,
53 fixities :: [(Assoc, Int, String)],
54 aliases :: [(String, [String], Type)],
55 datatypes :: [ (String, [String], [(String,[Type])]) ],
56 foreignImports :: [(String, LExpr t v, String, Type)],
57 foreignExports :: [(String, String, Type)]
60type Interfaces = Map.Map String ModuleInterface
61type ADT = (String, [String], [(String,[Type])])
63data ModuleInterface = ModuleInterface {
65 iTypes :: Map.Map String Type,
66 iImports :: [(String, ImportMethod)],
68 iAliases :: [(String, [String], Type)],
69 iFixities :: [(Assoc, Int, String)]
73instance Binary ModuleInterface where
74 get = ModuleInterface <$> get <*> get <*> get <*> get <*> get <*> get
84instance Binary Assoc where
85 get = do n <- getWord8
86 return $ case n of { 0 -> L ; 1 -> N ; 2 -> R }
88 put assoc = putWord8 $ case assoc of { L -> 0 ; N -> 1 ; R -> 2 }
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