move QuickCheck.All to separate package (because of TemplateHaskell)
Henning Thielemann
lemming at henning-thielemann.de
Mon Jun 18 16:52:37 BST 2012
Hi Nick,
On Mon, 18 Jun 2012, Nick Smallbone wrote:
> This flag is supposed to be disabled automatically by Cabal whenever
> you don't have the template-haskell package installed; the user isn't
> supposed to set it themselves. Thus the intended way to assert that
> you depend on Test.QuickCheck.All is just to depend on the
> template-haskell package.
That is, every package that imports QuickCheck and uses the module
Test.QuickCheck.All must explicitly depend on template-haskell although it
might not call any function from template-haskell? This seems to be
fragile to me, although currently Test.QuickCheck.All looks like it
exports only functions that make sense when working explicitly with
TemplateHaskell.
> We use the same mechanism to decide which version of the base package
> to depend on (since we also support old versions of GHC, and Hugs),
> and there it works fine, without any user interaction. So I'm
> surprised that you had trouble with it. The only thing I can guess is
> that you might have had the template-haskell package installed even
> though your GHC didn't support TH---I'll have to check if this is
> supposed to happen.
I don't remember the details anymore, but the template-haskell API changes
from GHC version to GHC version. I assume that QuickCheck decided to
enable template-haskell because it is available, but then it couldn't cope
with the new template-haskell version of GHC-7.5.
I know I had trouble with Cabal's automatic flag selection and different
template-haskell versions in data-accessor-template. You may look there
how I solved the problem. The essence was that when the compiler is GHC
then the Cabal file derives the template-haskell version from the GHC
version and otherwise it just relies on the template-haskell version.
http://hackage.haskell.org/packages/archive/data-accessor-template/0.2.1.9/data-accessor-template.cabal
More information about the QuickCheck
mailing list