0

运行 cabal new-run 时出现以下错误:

    src\Main.hs:3:2: error:
    Could not load module `Text.ParserCombinators.Parsec'
    It is a member of the hidden package `parsec-3.1.13.0'.
    Perhaps you need to add `parsec' to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.
  |
3 |  import Text.ParserCombinators.Parsec hiding (spaces)
  |  ^^

遵循建议并在我的 cabal 文件中添加了 parsec:

build-depends:   base ^>=4.12.0.0, 
                 parsec ==3.1.15.0

但它仍然不起作用。试过了cabal install parsec,还是不行。

谢谢

4

1 回答 1

0

糟糕.. .cabal 文件有两个部分,其中 build-depends 没有在可执行部分中添加依赖项:)

于 2022-02-27T11:11:51.460 回答