Piskator
Piskator

Reputation: 647

How do I install and run Test.Tasty.Patterns

I want to use the following for testing the ReadP Monad Parser. https://hackage.haskell.org/package/tasty-1.4.3/docs/Test-Tasty-Patterns-Parser.html . How can I install it correctly?

When trying to import

I get

Test.hs:7:1: error:
    Could not load module `Test.Tasty.Patterns'
    it is a hidden module in the package `tasty-1.4.3'
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
7 | import Test.Tasty.Patterns
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^
Failed, two modules loaded.

When trying the :set -v and :set -package tasty-hunit-patterns

I get:

*** initializing unit database:
package flags [-package-id ghc-9.0.1{unit ghc-9.0.1 True ([])},
               -package-id bytestring-0.10.12.1{unit bytestring-0.10.12.1 True ([])},
               -package-id base-4.15.0.0{unit base-4.15.0.0 True ([])},
               -package-id time-1.9.3{unit time-1.9.3 True ([])},
               -package-id hpc-0.6.1.0{unit hpc-0.6.1.0 True ([])},
               -package-id filepath-1.4.2.1{unit filepath-1.4.2.1 True ([])},
               -package-id process-1.6.11.0{unit process-1.6.11.0 True ([])},
               -package-id array-0.5.4.0{unit array-0.5.4.0 True ([])},
               -package-id integer-gmp-1.1{unit integer-gmp-1.1 True ([])},
               -package-id containers-0.6.4.1{unit containers-0.6.4.1 True ([])},
               -package-id ghc-boot-9.0.1{unit ghc-boot-9.0.1 True ([])},
               -package-id binary-0.8.8.0{unit binary-0.8.8.0 True ([])},
               -package-id ghc-prim-0.7.0{unit ghc-prim-0.7.0 True ([])},
               -package-id ghci-9.0.1{unit ghci-9.0.1 True ([])},
               -package-id rts-1.0{unit rts-1.0 True ([])},
               -package-id transformers-0.5.6.2{unit transformers-0.5.6.2 True ([])},
               -package-id deepseq-1.4.5.0{unit deepseq-1.4.5.0 True ([])},
               -package-id ghc-boot-th-9.0.1{unit ghc-boot-th-9.0.1 True ([])},
               -package-id pretty-1.1.3.6{unit pretty-1.1.3.6 True ([])},
               -package-id template-haskell-2.17.0.0{unit template-haskell-2.17.0.0 True ([])},
               -package-id directory-1.3.6.1{unit directory-1.3.6.1 True ([])},
               -package-id text-1.2.4.1{unit text-1.2.4.1 True ([])},
               -package-id random-1.2.1-e1879819ad2512292cbd29842949fd250c449266{unit random-1.2.1 True ([])},
               -package-id QuickCheck-2.14.2-ddd3158346bc1397aa376f2d5b48d0fd800681db{unit QuickCheck-2.14.2 True ([])},
               -package tasty{package tasty True ([])},
               -package tasty-hunit{package tasty-hunit True ([])},
               -package tasty-hunit-patterns{package tasty-hunit-patterns True ([])}]
loading package database C:\tools\ghc-9.0.1\lib\package.conf.d
loading package database C:\Users\tqx98\AppData\Roaming\cabal\store\ghc-9.0.1\package.db
cannot satisfy -package tasty-hunit-patterns
    (use -v for more information)

And on when trying to install, I get:

PS D:\CurrentDir\code> cabal install tasty-hunit-patterns
cabal.exe: Unknown package "tasty-hunit-patterns".

EDIT

I have now tried to add the package with stack as suggested in the comments. I get his output:

PS D:\Redo_haskell_folder\code> stack install Test.Tasty.Patterns.Parser
Error: [S-8506]
Error parsing targets: Directory not found: Test.Tasty.Patterns.Parser
PS D:\Redo_haskell_folder\code> stack install Test.Tasty.Patterns       
Error: [S-8506]
Error parsing targets: Directory not found: Test.Tasty.Patterns
PS D:\Redo_haskell_folder\code> stack exec -- ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.2.5

This would be the typically procedure of using stack what am I missing?

Upvotes: 0

Views: 385

Answers (0)

Related Questions