Comments (3)
I've hit the same issue. I was under the impression that Control.Monad.Catch
is the recommended way to deal with errors in Haskell. So I wrote the following and ran with it. The compiler, of course gives a warning. What's the correct way to go about this?
instance (Monad a) => MonadThrow (PropertyM a)
instance (MonadThrow a) => MonadCatch (PropertyM a)
from quickcheck.
The MonadThrow
instance at least should be easy to define using liftIO
. MonadCatch
I'm not sure about because of the continuations - it's not a good sign that Control.Monad.Catch
has no MonadCatch
instance for ContT
. I'll have a think about it though.
from quickcheck.
You can "built in" catch continuation: http://hackage.haskell.org/package/unification-fd-0.10.0.1/docs/src/Control-Monad-EitherK.html#EitherK
AFAIK the only way to have MonadCatch
if you want CPS-monad
from quickcheck.
Related Issues (20)
- Should `Fn` have `{-# COMPLETE #-}`? HOT 1
- haddocks for Test.QuickCheck.Random HOT 5
- instances for Down from Data.Ord?
- Add generating monotonic functions
- shrinkRealFrac & shrinkDecimal problems HOT 1
- New release? HOT 3
- Printing is slow! HOT 3
- Need better containers instances HOT 4
- instance Arbitrary (Ratio a) is broken in general case and sometimes throws exceptions HOT 10
- `Natural` data type: Moving instances from quickcheck-instances to QuickCheck HOT 2
- 2.14.3 breaks test suite of multiple projects HOT 4
- `Small` has no `CoArbitrary` instance HOT 1
- quickCheckWith does zero tests if maxSuccess is too large HOT 2
- Could `classify` collect non-covered cases too? HOT 1
- discard is too lazy HOT 4
- `PropertyM`, add combinators for making working with it easier? HOT 2
- `checkCoverage` interacts poorly with discards
- Generating `Small Natural`s leads to arithmetic underflows
- `DISCARD` exception shows up user-side HOT 2
- Witnesses of labelledExamples? 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 quickcheck.