We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If we run
Prelude Test.QuickCheck> quickCheck (\xs -> reverse xs == xs) +++ OK, passed 100 tests.
It passes and it's ambiguous why it does that (and it shouldn't)
The text was updated successfully, but these errors were encountered:
because GHCi defaults to ()
GHCi
()
λ Test.QuickCheck> quickCheck (\xs -> reverse xs == xs) +++ OK, passed 100 tests. λ Test.QuickCheck> quickCheck (\xs -> reverse xs == (xs :: [()])) +++ OK, passed 100 tests. λ Test.QuickCheck> quickCheck (\xs -> reverse xs == (xs :: [Int])) *** Failed! Falsifiable (after 5 tests and 2 shrinks): [0,1] λ Test.QuickCheck> :set -XNoExtendedDefaultRules λ Test.QuickCheck> quickCheck (\xs -> reverse xs == xs) <interactive>:9:1: error: • Ambiguous type variable ‘a0’ arising from a use of ‘quickCheck’
Read more in the GHC manual: https://downloads.haskell.org/~ghc/8.4.4/docs/html/users_guide/ghci.html#type-defaulting-in-ghci
Sorry, something went wrong.
Yes, this is due to GHCi defaulting all type variables to (). Annoying, but I don't think there's anything we can do about it.
Would it be worth warning about this in the documentation?
Successfully merging a pull request may close this issue.
If we run
It passes and it's ambiguous why it does that (and it shouldn't)
The text was updated successfully, but these errors were encountered: