on 1fcb01f help sign in
23 lines 660 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)
9data Module tipe var =
10 Module [String] Exports Imports [Decl.Declaration tipe var]
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 a b -> String
20name (Module names _ _ _) = intercalate "." names
22path :: Module a b -> FilePath
23path (Module names _ _ _) = joinPath names