Comments (4)
Most likely a GHCi bug. But we should investigate. Can you try to reproduce with GHCi only?
from doctest.
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.
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.
Thanks.
from doctest.
Related Issues (20)
- Support GHC 9.2 HOT 2
- doctest extracts examples from code blocks
- New major version? HOT 1
- I could discuss if you wouldn't limit discussion. HOT 1
- Weird test failure due to type error with GHC 9.2.1 HOT 5
- "not in scope" errors when running with GHC 9 + stack test; redux HOT 20
- Disable test without changing rendering HOT 1
- 0.20.0 doesn't build on ghc 9.4.2 HOT 6
- Invalid platform constants HOT 2
- Error related to OverloadedLists not reported as such HOT 3
- Extra `type-defaults` warnings (from `OverloadedStrings`) make doctests fail HOT 10
- Build failure on GHC 9.6 HOT 1
- How to pass `--fast` when going via `cabal repl`? HOT 1
- `doctest` in multi-GHC setting HOT 5
- One test fails with GHC 9.6.1 HOT 1
- Ci: ubuntu-18.04 will be discontinued soon HOT 1
- Can I focus doctest on a particular function in a module or can I exclude functions from being tested? HOT 2
- GHC 9.4.5, doctest 0.22.0 `$setup import …` does only work with `cabal repl --with-ghc=doctest` HOT 1
- `cabal test` integration (GHC 9.4.5) HOT 7
- cabal repl --enable-multi-repl --with-ghc=doctest fails with "unrecognized option `-unit'" HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doctest.