ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
738 stars 134 forks source link

Updates for QuickCheck 2.7 [Fixes #57] #58

Closed jhenahan closed 10 years ago

jhenahan commented 10 years ago

Bumped version number, though a more aggressive bump may be called for due to the apparent API change in QuickCheck.

All tests pass.

jhenahan commented 10 years ago

I actually went and read the changelog, and it may actually be prudent to refactor to use the (===) from QuickCheck. I may give it a look tomorrow if it doesn't look too hairy.

ndmitchell commented 10 years ago

Thanks for the patch. I merged something slightly different as ad71ba110df7bbebf96b161732d6f82702327420 and 5041c4f0c816c7640899b71be0f51324059078b6 and released 4.2.30. An import hiding is much more elegant, but requires QuickCheck 2.7 or above to work, which is a bit annoying (all users would have to upgrade QuickCheck specifically to avoid using the new function!). I wouldn't bother trying to use the QuickCheck === since I think it's incorrect by design (I'll be writing a blog post on that in the next few days) - the existing definition works very nicely.

jhenahan commented 10 years ago

I'm not sure that import hiding requires that the function exist, at all. For instance, I can compile this without any trouble on 7.8 and 7.6.3:

module Main where

import Data.List hiding (someNonsenseFunction)

someNonsenseFunction :: a -> a
someNonsenseFunction = id

main :: IO ()
main = return ()

To clarify, it will warn that someNonsenseFunction isn't exported, but it'll compile just fine.

ndmitchell commented 10 years ago

That's a change in GHC 7.6, in 7.4 and before it's an error you can't suppress. I significantly prefer the new behaviour and argued for it (it makes writing multiple version compatible packages much easier) - but I wasn't aware that it had actually been merged in - that's great news. Unfortunately Hoogle needs to work as far back as 7.2 (there are still some companies using it internally at 7.2, and people using it via something like Debian often are on old versions) so I can't use this approach yet.

jhenahan commented 10 years ago

Ah, fair enough.