Haskell package installed but not found

只愿长相守 提交于 2019-12-01 06:43:21

As bheklilr said, if ghci is started with cabal repl, it will only find packages specified as a dependency in the .cabal file.

However you can start it with cabal exec ghci, then it will find all packages installed in the sandbox.

The same is true for invoking ghc (cabal build vs. cabal exec ghc), but note that if you want to pass flags you have to use --, like in cabal exec ghc -- -O2 Main.hs. Alternatively you can use cabal exec bash and launch ghci or ghc in the new shell.

cabal exec was added with Cabal 1.20.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!