Comments (4)
Perhaps the current instance for a->b should live in a separate module so that it can be optionally imported ?
from smallcheck.
It would be nice indeed, but this instance is needed to be able to test higher-order functions.
(Note the Show constraint in instance (Serial m a, Show a, Testable m b) => Testable m (a->b)
.)
from smallcheck.
This has now become a real problem.
Some of tasty's dependencies (I don't know which one) apparently imports Text.Show.Functions
which contains a conflicting Show instance for function. So an attempt to use tasty and test functions using smallcheck results in an error:
Overlapping instances for Show (Bool -> JT Bool Maybe Bool)
arising from a use of `testProperty'
Matching instances:
instance [safe] Show (a -> b) -- Defined in `Text.Show.Functions'
instance [overlap ok] (Serial Identity a, Show a, Show b) =>
Show (a -> b)
-- Defined in `Test.SmallCheck.Series'
So, I'm going to remove the Show (a -> b)
instance and replace it with a Show Fun
instance.
from smallcheck.
Here are two approaches that I can think of:
- When generating a function, store the additional information (such as the inspected size of the argument and the default value) so that we know what/how to show
- Use the LogicT continuations to "refine" the function akin to lazy smallcheck. First try with the a never defined function, then catch exceptions and add cases to the table. This will work only with first-order functions, but OTOH it will produce much better results
I'm tempted to implement both approaches, like QuickCheck does (CoArbitrary
vs Argument
).
from smallcheck.
Related Issues (20)
- Work with streams HOT 4
- Add 'tasty' instead of test-framework to docs as an option for running smallcheck HOT 1
- Documentation: types with >4 fields HOT 1
- Fix the tests!
- smallcheck-1.1.1 doesn't compile with current GHC head snapshot HOT 2
- Port some convenience list functions from QuickCheck HOT 2
- Serial and CoSerial instances for `Word` HOT 3
- Review `v1.1.1` restoration commit before pushing HOT 7
- Smallcheck defines an orphan which overlaps `Show (a -> b)` instance from base HOT 3
- Serial instance for base types HOT 2
- Show the bad tests(the ones which didn't meet the ==> condition) even on success HOT 1
- test function of Property type class is not available HOT 4
- Could not find module Numeric.Natural in GHC 7.8 HOT 1
- How to generate a non-empty list of items with a predicate (using suchThat)? HOT 2
- Smallcheck fails to build due to the Safe pragma HOT 3
- Extract Number Wrappers HOT 2
- Generically derived Serial instance for mutually recursive data type causes infinite loop HOT 2
- depth for generics is broken HOT 5
- Builf failure: Test.SmallCheck.Series: GHC.Base.MonadPlus ml HOT 4
- build errors with GHC-7.4 HOT 2
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 smallcheck.