Coder Social home page Coder Social logo

Comments (4)

sol avatar sol commented on June 2, 2024

Most likely a GHCi bug. But we should investigate. Can you try to reproduce with GHCi only?

from doctest.

notogawa avatar notogawa commented on June 2, 2024

I try it and reproduce the issue.

On ghc-7.4.1

$ ghci -package-conf .cabal-sandbox/x86_64-linux-ghc-7.4.1-packages.conf.d TestTarget.hs
*TestTarget> T == T
True
*TestTarget> import Test.QuickCheck
*TestTarget Test.QuickCheck> T == T
True
*TestTarget Test.QuickCheck> instance Arbitrary T where arbitrary = return T
*TestTarget Test.QuickCheck> T == T

<interactive>:10:3:
    Overlapping instances for Eq T
      arising from a use of `=='
    Matching instances:
      instance Eq T -- Defined at TestTarget.hs:14:21
      instance Eq T -- Defined at TestTarget.hs:14:21
    In the expression: T == T
    In an equation for `it': it = T == T

On ghc-7.6.3

$ ghci -package-db .cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d TestTarget.hs
*TestTarget> T == T
True
*TestTarget> import Test.QuickCheck
*TestTarget Test.QuickCheck> T == T
True
*TestTarget Test.QuickCheck> instance Arbitrary T where arbitrary = return T
*TestTarget Test.QuickCheck> T == T
True

And I found this ghc issue.

Is there any workaround ? Defining Arbitrary instances in the source is the only way to use doctest with QuickCheck ?

from doctest.

sol avatar sol commented on June 2, 2024

I guess this is fixed in GHC 7.4.2. The solution is to not use the version of GHC that comes with Debian, but install your own. You can try the binary builds from http://www.haskell.org/ghc/ (they may or may not work, doing generic binary builds is hard). If you are on wheezy, you can also use http://typeful.net/ghc/.

from doctest.

notogawa avatar notogawa commented on June 2, 2024

Thanks.

from doctest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.