Comments (6)
@kazu-yamamoto I agree that True :: Bool
is not important. But I'm not yet sure if we can exclude such cases in general.
Say we have a type class Foo
.
class Foo where
instance Foo Int where
And a property p
.
p :: Foo a => a -> Bool
Then the user might want to write.
prop> p :: Int -> Bool
Any thoughts?
from doctest.
If this is important, we can write:
prop> (p :: Int -> Bool)
I think that we should more flexible one to users. I guess that "$" is more flexible than "()" at this moment.
What do you think?
from doctest.
The user would still need to know about this. How would you document it and make sure that the user actually reads it?
Saying something like "Trailing comments do not work!" is relatively clear.
An other approach would be to strip trailing comments; but we may run into other corner cases here. I'm really not sure what to do here.
from doctest.
Just for image:
With trailing comments:
http://mew.org/~kazu/tmp/Data-Set-Splay.html#v:delete
Without trailing comments:
http://mew.org/~kazu/tmp/Data-Set-Splay2.html#v:delete
Which do yo prefer?
BTW, I guess dropping trailing comments is possible but its implementation would be troublesome.
from doctest.
Personally I prefer the second.
In the first, the comments look too much like being part of the property. I think trailing comments could be useful, but only if they get a different layout (e.g. normal font weight, italic, and gray text color). Something similar to this.
prop> xs == ys -- xs always equals ys
That would again require parsing.
I agree that striping trailing comments could be troublesome. The longer I think about it, the less I like it.
So what to do? I'd tend to just document that trailing comments are not supported. What do you think?
from doctest.
OK. Let's not allow trailing comments at this moment. We can get back this issue if users actually require.
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 3
- 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.