我尝试了以下方法:
cabal sandbox init
然后制作以下 cabal 文件。
-- Initial hsource.cabal generated by cabal init. For further
-- documentation, see http://haskell.org/cabal/users-guide/
name: hsource
version: 0.1.0.0
-- synopsis:
-- description:
-- license:
license-file: LICENSE
author: abc
maintainer: abc
-- copyright:
-- category:
build-type: Simple
-- extra-source-files:
cabal-version: >=1.10
executable hsource
main-is: main.hs
other-modules:
-- other-extensions:
build-depends: base >=4.7 && <4.8, csv
hs-source-dirs: src
default-language: Haskell2010
现在我安装 CSV 包:
cabal install --only-dependencies
现在当我尝试import Text.CSV
然后C-c C-l
我得到以下错误:
Util/RandomTree.hs:7:8-15: Could not find module ‘Text.CSV’ …
Use -v to see a list of the files searched for.
Compilation failed.
所以我的问题是,haskell 模式是否不支持沙箱,或者我是否遗漏了一些让它们工作的步骤?