Compiler versions

Isaac Jones ijones at syntaxpolice.org
Wed Apr 7 11:33:04 EDT 2004


"Simon Peyton-Jones" <simonpj at microsoft.com> writes:

(snip
> Would anyone like to run with this to get an interface agreed?  From the
> GHC end we'd be happy to implement any agreed interface.
(snip)

To bring this around a little, I think I had proposed somewhere along
the line that each library (and even Main modules perhaps) export a
"toolInfo" variable which is based on
Distribution.Package.PackageConfig type (which itself is based on
types used in ghc-pkg).  So I'm a little less sure at this point
exactly which datatype should be exported, but it should have at least
some of the fields in PackageConfig (which is below for your
reference).

I think it would be nice for most tools to export something along the lines of:

ToolInfo PkgIdentifier {- includes version and name -}
         License
         String -- copyright
         String -- maintainer
         String -- stability

But let's make sure I have the various configuration data types down
first.  Hopefully that'll happen Real Soon Now :)

peace,

isaac


data PackageConfig
   = Package {
        pkgIdent        :: PkgIdentifier,
        license         :: License,
        copyright       :: String,
        maintainer      :: String,
        stability       :: String,
        auto            :: Bool,
        importDirs     :: [FilePath],
        sourceDirs     :: [FilePath],
        libraryDirs    :: [FilePath],
        hsLibraries    :: [String],
        extraLibraries :: [String],
        includeDirs    :: [FilePath],
        cIncludes      :: [String],
        depends         :: [Dependency], -- use dependencies
        extraHugsOpts :: [Opt],
        extraCcOpts   :: [Opt],
        extraLdOpts   :: [Opt],
        frameworkDirs  :: [FilePath],
        extraFrameworks:: [String]}
    deriving (Read, Show)

data PkgIdentifier
    = PkgIdentifier {pkgName::String, pkgVersion::Version}

data License = GPL | LGPL | BSD3 | BSD4 | PublicDomain | AllRightsReserved
             | {- ... | -} OtherLicense FilePath
               deriving (Read, Show)

data SourcePackage
    = SourcePackage { pkgIdent    :: PkgIdentifier,
                      depends     :: [Dependency],
                      setupScript :: Either FilePath (String, FilePath)
                    } deriving (Show, Read)


More information about the Libraries mailing list