jesicabaxter / ndmitchell

Automatically exported from code.google.com/p/ndmitchell
0 stars 0 forks source link

HLint incorrectly suggests use of Control.Exception.evaluate outside of IO monad #639

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. define the following function:

return' ∷ forall a m. Monad m ⇒ a → m a
return' x = x `seq` return x

2. run HLint

What is the expected output? What do you see instead?

The expected output would be 'no suggestions'.

The following suggestion is incorrect, because 'evaluate' works only in the IO 
monad:

File x:0:0: Error: Use evaluate
Found:
  x `seq` return x
Why not:
  Control.Exception.evaluate x

What version of the product are you using? On what operating system?
(Saying "latest" is fine, especially for Hoogle web search)

HLint 1.8.55 on Mac OS X

Please provide any additional information below.

Original issue reported on code.google.com by niklas.m...@gmail.com on 21 Mar 2014 at 10:42

GoogleCodeExporter commented 8 years ago
Thanks, I totally hadn't thought of that. I do like the seq to evaluate hint, 
but I guess there's no safe way to do it without types, so I'll have to remove 
it.

Original comment by ndmitch...@gmail.com on 21 Mar 2014 at 11:06

GoogleCodeExporter commented 8 years ago
I just removed the hint from the repo, will be fixed in the next release.

Original comment by ndmitch...@gmail.com on 21 Mar 2014 at 4:03

GoogleCodeExporter commented 8 years ago
Released a while back.

Original comment by ndmitch...@gmail.com on 13 Jun 2015 at 5:36