on 5cc99f5 help sign in
24 lines 679 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 tipe var =
11 Module [String] Exports Imports [Decl.Declaration tipe var]
12 deriving (Show)
14type Exports = [String]
16type Imports = [(String, ImportMethod)]
17data ImportMethod = As String | Importing [String] | Hiding [String]
18 deriving (Eq, Ord, Show, Data, Typeable)
20name :: Module a b -> String
21name (Module names _ _ _) = intercalate "." names
23path :: Module a b -> FilePath
24path (Module names _ _ _) = joinPath names