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)
18 Module [String] Exports Imports [Declaration tipe var]
21type Exports = [String]
23type Imports = [(String, ImportMethod)]
24data ImportMethod = As String | Importing [String] | Hiding [String]
25 deriving (Eq, Ord, Show, Data, Typeable)
27instance Binary ImportMethod where
28 put (As s) = do put (0 :: Word8)
31 put (Importing ss) = do put (1 :: Word8)
34 put (Hiding ss) = do put (2 :: Word8)
37 get = do tag <- getWord8
40 1 -> liftM Importing get
43data MetadataModule t v = MetadataModule {
47 imports :: [(String, ImportMethod)],
49 types :: Map.Map String Type,
50 fixities :: [(Assoc, Int, String)],
51 aliases :: [(String, [String], Type)],
52 datatypes :: [ (String, [String], [(String,[Type])]) ],
53 foreignImports :: [(String, LExpr t v, String, Type)],
54 foreignExports :: [(String, String, Type)]
57type Interfaces = Map.Map String ModuleInterface
58type ADT = (String, [String], [(String,[Type])])
60data ModuleInterface = ModuleInterface {
61 iTypes :: Map.Map String Type,
62 iImports :: [(String, ImportMethod)],
64 iAliases :: [(String, [String], Type)],
65 iFixities :: [(Assoc, Int, String)]
69instance Binary ModuleInterface where
70 get = ModuleInterface <$> get <*> get <*> get <*> get <*> get
79instance Binary Assoc where
80 get = do n <- getWord8
81 return $ case n of { 0 -> L ; 1 -> N ; 2 -> R }
83 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