What I am doing in HaRe (as a trial at this stage) is to load the module graph for each cabal target in turn, and take the union of all non-Main modules. This will work for a large proportion of cabal files.

Where something special is going on in terms of e.g. flags pulling on one of two mutually exclusive files with the same name, a different approach will be needed, probably by specifying how to break the tie in a config section for the tool.

But I agree that a separate tool could be useful for this, I am pretty sure BuildWrapper is wrestling with the same problem.

Alan



On Fri, Feb 21, 2014 at 2:22 PM, Daniel Trstenjak <daniel.trstenjak@gmail.com> wrote:

Hi Alan,

On Fri, Feb 21, 2014 at 02:09:28PM +0200, AlanKim Zimmerman wrote:
> In terms of using the right section of cabal, in the dev/editor environment you
> actually need to union of all the cabal targets, so all the various hs-src
> directories etc are in scope.

You might get an issue by doing it that way, just think about two
executables having modules with the same name.

I think the "right" way might be to find the associated cabal target
for the current source file.

But I don't know if it's possible to always get a unique cabal target.


Greetings,
Daniel
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe