cabal sandbox init
cabal install haskeline
... installs successfully ...

ghci
Prelude> :module +System.Console.Haskeline

<no location info>:
    Could not find module `System.Console.Haskeline'

ghc-pkg list haskeline
.. not found ..

我需要做什么才能让 haskeline 与 cabal 沙箱一起工作?如果我正常安装 haskeline(没有沙箱)就可以了(ghc-pkg list haskeline -- 找到了)。

最佳答案

要么使用像约瑟夫提到的 cabal repl ,要么你可以显式地将包 db 传递给相对于当前工作目录的 GHCi shell。

ghci -no-user-package-db -package-db .cabal-sandbox/*-packages.conf.d YourModule.hs

建议您只使用 cabal。

关于haskell - cabal 沙箱 + haskeline,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21035806/

10-12 17:48