on c942afe help sign in
36 lines 1.1 kB history raw
1{-# LANGUAGE DeriveDataTypeable #-}
2module SourceSyntax.Module where
4import Data.Data
5import Data.List (intercalate)
6import qualified Data.Map as Map
8import SourceSyntax.Expression
9import SourceSyntax.Declaration
10import SourceSyntax.Type
11import System.FilePath (joinPath)
12import qualified Type.Type as T
14data Module tipe var =
15 Module [String] Exports Imports [Declaration tipe var]
16 deriving (Show)
18type Exports = [String]
20type Imports = [(String, ImportMethod)]
21data ImportMethod = As String | Importing [String] | Hiding [String]
22 deriving (Eq, Ord, Show, Data, Typeable)
24data MetadataModule t v = MetadataModule {
25 names :: [String],
26 path :: FilePath,
27 exports :: [String],
28 imports :: [(String, ImportMethod)],
29 defs :: [Def t v],
30 types :: Map.Map String T.Variable,
31 fixities :: [(Assoc, Int, String)],
32 aliases :: [(String, [String], Type)],
33 datatypes :: [ (String, [String], [(String,[Type])]) ],
34 foreignImports :: [(String, LExpr t v, String, Type)],
35 foreignExports :: [(String, String, Type)]