[Haskell-cafe] How can i run darcs in ghci?

Jason Dagit dagit at codersbase.com
Thu Feb 18 12:47:30 EST 2010

On Tue, Feb 16, 2010 at 12:17 AM, Marc Weber <marco-oweber at gmx.de> wrote:

> > Any help on how to load the .h is greatly appreciated.     I tried -i
> > with
> > path to the src directory but it didn't work (should it?).
> Try -I -i is used for .hs files only (?).

This seems like a missing feature in cabal or ghci.  In the past darcs used
a makefile and it was possible to type, 'make ghci' and you'd be dumped at
the ghci prompt with everything ready.

Perhaps the right way to get this feature is to write a plugin for ghci to
add this.  I'm thinking the plugin would use the cabal library to understand
a .cabal file and then instruct ghci in how to load each module that is
requested (making sure CPP and flags are dealt with correctly and dependency
order is respected).

When a .cabal file provides all the modules as a library (as is the case
with darcs), you can install the library and then instruct ghci to load the
right package.  From inside ghci you can then :m + the modules you want to
use.  The downside to this is that only things exported from the modules are
visible and every time you change the source you have to reinstall and
restart ghci.

So, something like this:
cabal install foo-1.2
ghci -package foo-1.2
:m + Data.Foo

I hope that helps,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100218/5ac6004c/attachment.html

More information about the Haskell-Cafe mailing list