haskell-suite / haskell-names

Haskell suite library for name resolution
52 stars 17 forks source link

Default package db doesn't work with GHC 7.10 #67

Closed konn closed 8 years ago

konn commented 9 years ago

As titled above, default library database bundled with haskell-name doesn't work with GHC 7.10.2.

For example, if we ran the program like below:

module Main where
import Data.Proxy
import Distribution.HaskellSuite
import Distribution.Simple.Compiler
import Language.Haskell.Names
import Language.Haskell.Names.Interfaces

main :: IO ()
main = print =<< getInstalledPackages (Proxy :: Proxy NamesDB) GlobalPackageDB

then we get the following error:

haskell-suite package manager: bad package database at /Users/***/.stack/snapshots/x86_64-osx/lts-3.1/7.10.2/share/x86_64-osx-ghc-7.10.2/haskell-names-0.5.3/libraries/packages.db

The result above is produced with Stack, but the same error was reproduced if I install packages using cabal-install.

Here is my environment:

phischu commented 8 years ago

Hi, thanks for your report. I have just released a new version of haskell-names to hackage. It does not use haskell-packages anymore. It does not try to do automatic package management for you anymore. Instead it directly works with environments.

type Environment = Map ModuleName [Symbol]

You are free to invent your own way of persisting and loading environments. There is a function loadBase :: IO Environment that gives you a base environment with modules similar to GHC's base for quick experimentation.