on bbb2b2a help sign in
23 lines 659 B history raw
1{-# LANGUAGE DeriveDataTypeable #-}
2module SourceSyntax.Module where
4import Data.Data
5import Data.List (intercalate)
6import qualified SourceSyntax.Declaration as Decl
7import System.FilePath (joinPath)
8import Types.Types
10data Module = Module [String] Exports Imports [Decl.Declaration]
11 deriving (Show)
13type Exports = [String]
15type Imports = [(String, ImportMethod)]
16data ImportMethod = As String | Importing [String] | Hiding [String]
17 deriving (Eq, Ord, Show, Data, Typeable)
19name :: Module -> String
20name (Module names _ _ _) = intercalate "." names
22path :: Module -> FilePath
23path (Module names _ _ _) = joinPath names