2

I use cabal to install QuickCheck in a sandbox environment and it looks good

C:\Users\yashi>cabal install QuickCheck
Resolving dependencies...
Notice: installing into a sandbox located at C:\Users\yashi\.cabal-sandbox
Downloading erf-2.0.0.0...
Downloading primitive-0.6.4.0...
Downloading random-1.1...
...
Installed QuickCheck-2.12.4

But when I open a file, it shows

C:\\Users\yashi\OneDrive\Desktop\Ex1.hs:24:1: error:
    Could not find module ‘Test.QuickCheck’
    Use -v to see a list of the files searched for.
   |
24 | import Test.QuickCheck (Property, quickCheck, (==>))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Failed, no modules loaded.
Prelude> import Test.QuickCheck

How can I fix it?

user8314628
  • 1,952
  • 2
  • 22
  • 46
  • See https://stackoverflow.com/questions/53402263/could-not-find-module-test-quickcheck-on-windows#53402537 for solutions. – glyn Mar 04 '23 at 10:52

1 Answers1

0

There probably isn't enough information in here on how you set up your sandbox or started GHCi for people to provide you with an answer. I can give you an approach to this that will work with Stack, however:

$ stack ghci --package QuickCheck
> import Test.QuickCheck
Michael Snoyman
  • 31,100
  • 3
  • 48
  • 77