@@ -3,11 +3,16 @@ module SourceSyntax.Module where
33
44import Data.Data
55import Data.List (intercalate)
6−import qualified SourceSyntax.Declaration as Decl
6+import qualified Data.Map as Map
7+
8+import SourceSyntax.Expression
9+import SourceSyntax.Declaration
10+import SourceSyntax.Type
711import System.FilePath (joinPath)
12+import qualified Type.Type as T
813
914data Module tipe var =
10− Module [String] Exports Imports [Decl.Declaration tipe var]
15+ Module [String] Exports Imports [Declaration tipe var]
1116 deriving (Show)
1217
1318type Exports = [String]
@@ -16,8 +21,15 @@ type Imports = [(String, ImportMethod)]
1621data ImportMethod = As String | Importing [String] | Hiding [String]
1722 deriving (Eq, Ord, Show, Data, Typeable)
1823
19−name :: Module a b -> String
20−name (Module names _ _ _) = intercalate "." names
21−
22−path :: Module a b -> FilePath
23−path (Module names _ _ _) = joinPath names
24+data 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+ foreignImports :: [(String, LExpr t v, String, Type)],
34+ foreignExports :: [(String, String, Type)]
35+}