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

Test suite fails due to Overlapping instances #6

Closed
nomeata opened this issue Apr 17, 2015 · 1 comment
Closed

Test suite fails due to Overlapping instances #6

nomeata opened this issue Apr 17, 2015 · 1 comment

Comments

@nomeata
Copy link

nomeata commented Apr 17, 2015

Configuring monoid-subclasses-0.4.0.4...
Dependency QuickCheck ==2.*: using QuickCheck-2.7.6
Dependency base ==4.*: using base-4.7.0.2
Dependency bytestring >=0.9 && <1.0: using bytestring-0.10.4.0
Dependency containers >=0.5.2.0 && <0.6: using containers-0.5.5.1
Dependency monoid-subclasses -any: using monoid-subclasses-0.4.0.4
Dependency primes ==0.2.*: using primes-0.2.1.0
Dependency quickcheck-instances ==0.3.*: using quickcheck-instances-0.3.8
Dependency tasty >=0.7: using tasty-0.10.1
Dependency tasty-quickcheck >=0.7: using tasty-quickcheck-0.8.3.2
Dependency text >=0.11 && <1.3: using text-1.1.1.3
Dependency vector >=0.9 && <0.11: using vector-0.10.12.3
Using Cabal-1.22.1.1 compiled by ghc-7.8
Using compiler: ghc-7.8.4
[..]
Preprocessing test suite 'Main' for monoid-subclasses-0.4.0.4...
[ 1 of 10] Compiling Data.Monoid.Cancellative ( Data/Monoid/Cancellative.hs, dist-ghc/build/Main/Main-tmp/Data/Monoid/Cancellative.o )
[ 2 of 10] Compiling Data.Monoid.Null ( Data/Monoid/Null.hs, dist-ghc/build/Main/Main-tmp/Data/Monoid/Null.o )
[ 3 of 10] Compiling Data.Monoid.Factorial ( Data/Monoid/Factorial.hs, dist-ghc/build/Main/Main-tmp/Data/Monoid/Factorial.o )
[ 4 of 10] Compiling Data.Monoid.Textual ( Data/Monoid/Textual.hs, dist-ghc/build/Main/Main-tmp/Data/Monoid/Textual.o )
[ 5 of 10] Compiling Data.Monoid.Instances.Positioned ( Data/Monoid/Instances/Positioned.hs, dist-ghc/build/Main/Main-tmp/Data/Monoid/Instances/Positioned.o )
[ 6 of 10] Compiling Data.Monoid.Instances.Stateful ( Data/Monoid/Instances/Stateful.hs, dist-ghc/build/Main/Main-tmp/Data/Monoid/Instances/Stateful.o )
[ 7 of 10] Compiling Data.Monoid.Instances.Measured ( Data/Monoid/Instances/Measured.hs, dist-ghc/build/Main/Main-tmp/Data/Monoid/Instances/Measured.o )
[ 8 of 10] Compiling Data.Monoid.Instances.Concat ( Data/Monoid/Instances/Concat.hs, dist-ghc/build/Main/Main-tmp/Data/Monoid/Instances/Concat.o )
[ 9 of 10] Compiling Data.Monoid.Instances.ByteString.UTF8 ( Data/Monoid/Instances/ByteString/UTF8.hs, dist-ghc/build/Main/Main-tmp/Data/Monoid/Instances/ByteString/UTF8.o )
[10 of 10] Compiling Main             ( Test/TestMonoidSubclasses.hs, dist-ghc/build/Main/Main-tmp/Main.o )

Test/TestMonoidSubclasses.hs:452:48:
    Overlapping instances for Show (a -> Bool)
      arising from a use of `property'
    Matching instances:
      instance [safe] Show (a -> b) -- Defined in `Text.Show.Functions'
      instance Show a => Show (a -> Bool)
        -- Defined at Test/TestMonoidSubclasses.hs:841:10
    In the expression: property
    In the expression:
      property $ \ p -> forAll (arbitrary :: Gen a) (check p)
    In an equation for `checkSpan':
        checkSpan (FactorialMonoidInstance (_ :: a))
          = property $ \ p -> forAll (arbitrary :: Gen a) (check p)
          where
              check p a
                = span p a == (mconcat l, mconcat r)
                where
                    (l, r) = List.span p (factors a)

Test/TestMonoidSubclasses.hs:456:53:
    Overlapping instances for Show (Bool -> a -> Maybe Bool)
      arising from a use of `property'
    Matching instances:
      instance [safe] Show (a -> b) -- Defined in `Text.Show.Functions'
      instance Show a => Show (Bool -> a -> Maybe Bool)
        -- Defined at Test/TestMonoidSubclasses.hs:844:10
    In the expression: property
    In the expression:
      property
      $ \ (f, s) -> forAll (arbitrary :: Gen a) (check f (s :: Bool))
    In an equation for `checkSpanMaybe':
        checkSpanMaybe (FactorialMonoidInstance (_ :: a))
          = property
            $ \ (f, s) -> forAll (arbitrary :: Gen a) (check f (s :: Bool))
          where
              check f s0 a
                = a == prefix <> suffix
                  &&
                    foldMaybe prefix == Just s'
                    && (null suffix || f s' (primePrefix suffix) == Nothing)
                where
                    (prefix, suffix, s') = spanMaybe s0 f a
                    foldMaybe = foldl g (Just s0)
                    ....

Test/TestMonoidSubclasses.hs:464:77:
    Overlapping instances for Show (a -> Bool)
      arising from a use of `check'
    Matching instances:
      instance [safe] Show (a -> b) -- Defined in `Text.Show.Functions'
      instance Show a => Show (a -> Bool)
        -- Defined at Test/TestMonoidSubclasses.hs:841:10
    In the second argument of `forAll', namely `check'
    In the expression: forAll (arbitrary :: Gen a) check
    In an equation for `checkSplit':
        checkSplit (FactorialMonoidInstance (_ :: a))
          = forAll (arbitrary :: Gen a) check
          where
              check a
                = property
                    (\ pred -> all (all (not . pred) . factors) (split pred a))
                  .&&.
                    property
                      (\ prime -> mconcat (intersperse prime $ split (== prime) a) == a)

Test/TestMonoidSubclasses.hs:622:4:
    Overlapping instances for Show (Bool -> Char -> Maybe Bool)
      arising from a use of `property'
    Matching instances:
      instance [safe] Show (a -> b) -- Defined in `Text.Show.Functions'
      instance Show a => Show (Bool -> a -> Maybe Bool)
        -- Defined at Test/TestMonoidSubclasses.hs:844:10
    In the expression: property
    In the expression:
      property
      $ \ (ft, fc, s)
          -> forAll (arbitrary :: Gen a) (check ft fc (s :: Bool))
    In an equation for `checkTextualSpanMaybe':
        checkTextualSpanMaybe (TextualMonoidInstance (_ :: a))
          = property
            $ \ (ft, fc, s)
                -> forAll (arbitrary :: Gen a) (check ft fc (s :: Bool))
          where
              check ft fc s0 a
                = a == prefix <> suffix
                  &&
                    foldMaybe prefix == Just s'
                    &&
                      (null suffix
                       ||
                         maybe
                           (ft s' (primePrefix suffix))
                           (fc s')
                           (Textual.characterPrefix suffix)
                         == Nothing)
                where
                    (prefix, suffix, s') = Textual.spanMaybe s0 ft fc a
                    foldMaybe = Textual.foldl gt gc (Just s0)
                    ....

Test/TestMonoidSubclasses.hs:639:4:
    Overlapping instances for Show (Bool -> Char -> Maybe Bool)
      arising from a use of `property'
    Matching instances:
      instance [safe] Show (a -> b) -- Defined in `Text.Show.Functions'
      instance Show a => Show (Bool -> a -> Maybe Bool)
        -- Defined at Test/TestMonoidSubclasses.hs:844:10
    In the expression: property
    In the expression:
      property
      $ \ (fc, s) -> forAll (arbitrary :: Gen a) (check fc (s :: Bool))
    In an equation for `checkTextualSpanMaybe_':
        checkTextualSpanMaybe_ (TextualMonoidInstance (_ :: a))
          = property
            $ \ (fc, s) -> forAll (arbitrary :: Gen a) (check fc (s :: Bool))
          where
              check fc s0 a
                = a == prefix <> suffix
                  &&
                    foldMaybe prefix == Just s'
                    &&
                      (null suffix
                       || (Textual.characterPrefix suffix >>= fc s') == Nothing)
                where
                    (prefix, suffix, s') = Textual.spanMaybe_ s0 fc a
                    foldMaybe = Textual.foldl_ gc (Just s0)
                    ....

Test/TestMonoidSubclasses.hs:648:4:
    Overlapping instances for Show (Bool -> Char -> Maybe Bool)
      arising from a use of `property'
    Matching instances:
      instance [safe] Show (a -> b) -- Defined in `Text.Show.Functions'
      instance Show a => Show (Bool -> a -> Maybe Bool)
        -- Defined at Test/TestMonoidSubclasses.hs:844:10
    In the expression: property
    In the expression:
      property
      $ \ (fc, s) -> forAll (arbitrary :: Gen a) (check fc (s :: Bool))
    In an equation for checkTextualSpanMaybe_':
        checkTextualSpanMaybe_' (TextualMonoidInstance (_ :: a))
          = property
            $ \ (fc, s) -> forAll (arbitrary :: Gen a) (check fc (s :: Bool))
          where
              check fc s0 a
                = a == prefix <> suffix
                  &&
                    foldMaybe prefix == Just s'
                    &&
                      (null suffix
                       || (Textual.characterPrefix suffix >>= fc s') == Nothing)
                where
                    (prefix, suffix, s') = Textual.spanMaybe_' s0 fc a
                    foldMaybe = Textual.foldl_' gc (Just s0)
                    ....
@blamario
Copy link
Owner

Fixed, thank you for the report.

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

2 participants