Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module Test.QuickCheck.Instances collides with a module of the same name from quickcheck-instances #4

Open
sol opened this issue Nov 1, 2014 · 6 comments

Comments

@sol
Copy link

sol commented Nov 1, 2014

From a users perspective this is a pain, esp. when using a global package database and GHCi. checkers was first, quickcheck-instances is more widely used, not sure how to resolve this.

@sol
Copy link
Author

sol commented Nov 1, 2014

I'm cross-filing this at aslatter/qc-instances#9.

@russmatney
Copy link

(repost from same linked issue). Is there are movement on this? I just ran into it, but it seems quite old - if there's a systemic way to solve this I'd love to know about it!

@russmatney
Copy link

Just discovered PackageImports, which totally solved this for me.

import "quickcheck-instances" Test.QuickCheck.Instances()
import "checkers" Test.QuickCheck.Instances()

Sorry for the noise!

@sjakobi
Copy link
Member

sjakobi commented Jun 19, 2020

Since there hasn't been any more input on this issue for over 2 years, I currently tend to do nothing about it.

@conal
Copy link
Collaborator

conal commented Jun 19, 2020

I completely forgot about this issue. Is there still interest in addressing? How do the contents of these two modules relate?

@sjakobi
Copy link
Member

sjakobi commented Jun 19, 2020

How do the contents of these two modules relate?

To my surprise they actually don't relate much at all:

> :browse Test.QuickCheck.Instances
(Test.QuickCheck.Instances.Tuple.>****<) ::
  Test.QuickCheck.Gen.Gen a
  -> Test.QuickCheck.Gen.Gen b
  -> Test.QuickCheck.Gen.Gen c
  -> Test.QuickCheck.Gen.Gen d
  -> Test.QuickCheck.Gen.Gen e
  -> Test.QuickCheck.Gen.Gen (a, b, c, d, e)
(Test.QuickCheck.Instances.Tuple.>***<) ::
  Test.QuickCheck.Gen.Gen a
  -> Test.QuickCheck.Gen.Gen b
  -> Test.QuickCheck.Gen.Gen c
  -> Test.QuickCheck.Gen.Gen d
  -> Test.QuickCheck.Gen.Gen (a, b, c, d)
(Test.QuickCheck.Instances.Tuple.>**<) ::
  Test.QuickCheck.Gen.Gen a
  -> Test.QuickCheck.Gen.Gen b
  -> Test.QuickCheck.Gen.Gen c
  -> Test.QuickCheck.Gen.Gen (a, b, c)
(Test.QuickCheck.Instances.Tuple.>*<) ::
  Test.QuickCheck.Gen.Gen a
  -> Test.QuickCheck.Gen.Gen b -> Test.QuickCheck.Gen.Gen (a, b)
Test.QuickCheck.Instances.List.anyList ::
  Test.QuickCheck.Gen.Gen a -> Test.QuickCheck.Gen.Gen [a]
Test.QuickCheck.Instances.Char.brace ::
  Test.QuickCheck.Gen.Gen Char
Test.QuickCheck.Instances.Char.bracket ::
  Test.QuickCheck.Gen.Gen Char
Test.QuickCheck.Instances.List.decreasing ::
  (Test.QuickCheck.Arbitrary.Arbitrary a, Eq a, Num a) =>
  Test.QuickCheck.Gen.Gen [a]
Test.QuickCheck.Instances.List.decreasingInf ::
  (Test.QuickCheck.Arbitrary.Arbitrary a, Eq a, Num a) =>
  Test.QuickCheck.Gen.Gen [a]
Test.QuickCheck.Instances.Ord.greaterThan ::
  Ord a =>
  a -> Test.QuickCheck.Gen.Gen a -> Test.QuickCheck.Gen.Gen a
Test.QuickCheck.Instances.List.increasing ::
  (Test.QuickCheck.Arbitrary.Arbitrary a, Eq a, Num a) =>
  Test.QuickCheck.Gen.Gen [a]
Test.QuickCheck.Instances.List.increasingInf ::
  (Test.QuickCheck.Arbitrary.Arbitrary a, Eq a, Num a) =>
  Test.QuickCheck.Gen.Gen [a]
Test.QuickCheck.Instances.List.infiniteList ::
  Test.QuickCheck.Gen.Gen a -> Test.QuickCheck.Gen.Gen [a]
Test.QuickCheck.Instances.Ord.lessThan ::
  Ord a =>
  a -> Test.QuickCheck.Gen.Gen a -> Test.QuickCheck.Gen.Gen a
Test.QuickCheck.Instances.Char.lowerAlpha ::
  Test.QuickCheck.Gen.Gen Char
Test.QuickCheck.Instances.Maybe.maybeGen ::
  Test.QuickCheck.Gen.Gen a -> Test.QuickCheck.Gen.Gen (Maybe a)
Test.QuickCheck.Instances.Num.negative ::
  (Eq a, Num a, Test.QuickCheck.Arbitrary.Arbitrary a) =>
  Test.QuickCheck.Gen.Gen a
Test.QuickCheck.Instances.Char.newline ::
  Test.QuickCheck.Gen.Gen Char
Test.QuickCheck.Instances.List.nonEmpty ::
  Test.QuickCheck.Gen.Gen a -> Test.QuickCheck.Gen.Gen [a]
Test.QuickCheck.Instances.Num.nonNegative ::
  (Num a, Test.QuickCheck.Arbitrary.Arbitrary a) =>
  Test.QuickCheck.Gen.Gen a
Test.QuickCheck.Instances.Num.nonPositive ::
  (Num a, Test.QuickCheck.Arbitrary.Arbitrary a) =>
  Test.QuickCheck.Gen.Gen a
Test.QuickCheck.Instances.Char.nonSpace ::
  Test.QuickCheck.Gen.Gen Char
Test.QuickCheck.Instances.Num.nonZero ::
  (Eq a, Num a) =>
  Test.QuickCheck.Gen.Gen a -> Test.QuickCheck.Gen.Gen a
Test.QuickCheck.Instances.Num.nonZero_ ::
  (Eq a, Num a, Test.QuickCheck.Arbitrary.Arbitrary a) =>
  Test.QuickCheck.Gen.Gen a
Test.QuickCheck.Instances.List.nondecreasing ::
  (Test.QuickCheck.Arbitrary.Arbitrary a, Num a) =>
  Test.QuickCheck.Gen.Gen [a]
Test.QuickCheck.Instances.List.nondecreasingInf ::
  (Test.QuickCheck.Arbitrary.Arbitrary a, Num a) =>
  Test.QuickCheck.Gen.Gen [a]
Test.QuickCheck.Instances.List.nonincreasing ::
  (Test.QuickCheck.Arbitrary.Arbitrary a, Num a) =>
  Test.QuickCheck.Gen.Gen [a]
Test.QuickCheck.Instances.List.nonincreasingInf ::
  (Test.QuickCheck.Arbitrary.Arbitrary a, Num a) =>
  Test.QuickCheck.Gen.Gen [a]
Test.QuickCheck.Instances.Eq.notEqualTo ::
  Eq a => a -> Test.QuickCheck.Gen.Gen a -> Test.QuickCheck.Gen.Gen a
Test.QuickCheck.Instances.Eq.notOneof ::
  (Eq a, Test.QuickCheck.Arbitrary.Arbitrary a) =>
  [a] -> Test.QuickCheck.Gen.Gen a
Test.QuickCheck.Instances.Char.numeric ::
  Test.QuickCheck.Gen.Gen Char
Test.QuickCheck.Instances.Char.operator ::
  Test.QuickCheck.Gen.Gen Char
Test.QuickCheck.Instances.Char.parenthesis ::
  Test.QuickCheck.Gen.Gen Char
Test.QuickCheck.Instances.Num.positive ::
  (Eq a, Num a, Test.QuickCheck.Arbitrary.Arbitrary a) =>
  Test.QuickCheck.Gen.Gen a
Test.QuickCheck.Instances.List.setLength ::
  Int -> Test.QuickCheck.Gen.Gen a -> Test.QuickCheck.Gen.Gen [a]
Test.QuickCheck.Instances.Char.space ::
  Test.QuickCheck.Gen.Gen Char
Test.QuickCheck.Instances.Char.upperAlpha ::
  Test.QuickCheck.Gen.Gen Char
Test.QuickCheck.Instances.Char.whitespace ::
  Test.QuickCheck.Gen.Gen Char

We could probably get rid of the Array instances – quickcheck-instances provides these too.

The generators seem rather hidden in an Instances module – we could try moving these to a module with a more appropriate name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants