Open andreasabel opened 9 years ago
Hi,
This is definitely unfortunate. The problem is that Template Haskell gives (AFAIK) no way to find all the names in scope. So quickCheckAll
works by reading the source file (!) and looking for lines that start with prop_
.
The warning is mostly there so that if you forget the return []
you get a warning instead of it just testing nothing. But in this case it gives a false positive. One workaround is to make the line not start with prop_
, e.g. by using a single-line --
comment instead of a multi-line one. I'll leave the bug open though until we have a fix.
A week ago or so I went looking for a tool that would strip comments from Haskell files. Surprisingly, I did not find anything that is correct, fast, and works with unicode. Should not be so hard to write that DFA. Maybe Ana should give it as homework in her class.
If you use getRichTokenStream
, filter out the comments, and then showRichTokenStream
the GHC lexer will be able to help.
https://downloads.haskell.org/~ghc/latest/docs/html/libraries/ghc-7.10.1/GHC.html#g:33
Yes, but this is too heavy-weight (depending on GHC).
The comments could be stripped using haskell-src-exts.
Example:
That introduces rather a big dependency though. Maybe haskell-lexer could be an alternative.
@andreasabel, please note that {-# LANGUAGE TemplateHaskell #-}
is missing in the OP.
Applies to ver. 2.8.1
gives warning
which turns into error with -Werror