[Haskell-cafe] (automatically) adding import statements in vim

Erik Hesselink hesselink at gmail.com
Sat Jan 4 20:13:03 UTC 2014


On Fri, Jan 3, 2014 at 2:55 PM, Adam Bergmark <adam at bergmark.nl> wrote:
> Hi Daniel,
>
>> If I'm getting this correctly, than Halberd uses some kind of static
>> database, right?
>
> Right.

To be more clear, it uses the database built by hs-gen-iface [0],
which is a compile-like tool that generates an interface database for
your packages. You have to make a separate `cabal` call to use it and
build the database for each package you compile. Hopefully in the
future, cabal will have a way to automatically call compiler-like
tools (think haddock as wel). But for now, it's a bit impractical.

>> I think the nice approach of 'vim-hsimport' is, that by using 'hdevtools'
>> in
> conjunction with a 'cabal sandbox', only the modules of the packages are
> considered,
> which your project depends on, and this information is dynamically
> "established"
> by 'hdevtools' reading the package database of the 'cabal sandbox'.
>
> I recall Erik and others discussing ways of restricting halberd to a sandbox
> as well, but you'd have to ask him about the progress.

Right now halberd uses the global and user database. It should be
fairly trivial to add support for cabal sandboxes, although there will
probably be some duplication with cabal in the sandbox flags at least.
Let me know if you're interested.

Regards,

Erik

[0] http://hackage.haskell.org/package/hs-gen-iface


More information about the Haskell-Cafe mailing list