Text.ParserCombinators.Parsec requires -package text.
George Russell
ger at informatik.uni-bremen.de
Tue Sep 7 11:45:03 EDT 2004
Simon Marlow wrote (snipped):
> Could you elaborate on the template haskell problem you mentioned? I
> don't think template haskell is affected by this (i.e. it's still just
> batch linking that requires the -package options, template haskell
> should still work just fine without them).
The problem is that if package A includes an import of
Text.ParserCombinators.Parsec and package B includes a module
which uses Template Haskell code that requires package B,
you are liable to get things falling over at compile-time.
This has happened to me and I found it confusing.
The fact that this only happens when the modules are in separate
packages just makes the situation even more complicated than I thought
it was.
> So you're proposing that -package options should *always* be required?
> Even for --make? I think you might encounter some resistance to that...
Yes, I think they should. I hate programs which try to save the user
a few keystrokes by being clever, but then are inconsistent or get things
wrong.
I wonder who will resist. Are there really people out there who write
non-trivial Haskell programs, but expect to be able to go into the source
directory and type ghc --make Main.hs and everything will work?
If you are allergic to makefiles you can at least put all your options and
required packages into a package.conf file and then type
ghc --make Main.hs -package-conf my-packages.pkg -package my-options
It seems to me this is much more rational than having ghc try to infer
what non-base packages might be required, and also allows users to specify
language options in the package file.
More information about the Glasgow-haskell-bugs
mailing list