Providing a smooth default user experience
Simon Hengel
sol at typeful.net
Fri Nov 2 12:09:42 CET 2012
On Fri, Nov 02, 2012 at 11:25:11AM +0100, Simon Hengel wrote:
> > Recently, I had to add a MIN_VERSION macro to my code because of the
> > old-time / time change in directory, but couldn't test the library in
> > ghci because the macro was not defined.
> >
> > I discovered that configuring ghci with
> >
> > :set -optP-include -optPdist/build/autogen/cabal_macros.h
> >
> > tells ghci about the macro, but I find this even more cumbersome than
> > dist/build/<executable>/<executable>.
> >
> > So, if I'm not missing something, it may also be comfortable to add a
> >
> > cabal ghci
> >
> > command which tells ghci about cabal's configuration.
>
> You can put the required options in a .ghci file in you project root. I
> use [3] as a starting point for new projects, [2] and [3] are real world
> examples.
>
> `cabal ghci` could still be useful, but I think a general solution is
> not trivial. It would probably need to accept qualified targets, e.g.
> `ghci test:properties` to start ghci in a way suitable for a test-suite
> with the name "properties".
>
> Moreover, it would be awesome if it would regenerate generated source
> files on :reload. I'm not sure if this is feasible without changes to
> GHCi, but a custom macro, e.g.
>
> :cabal-reload
>
> could still work.
Seems that there is a ticket for that:
https://github.com/haskell/cabal/issues/375
Cheers,
Simon
More information about the cabal-devel
mailing list