【发布时间】:2015-02-08 16:53:08
【问题描述】:
我尝试了以下方法:
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 模式是否不支持沙箱,或者我是否缺少一些步骤来让它们工作?
【问题讨论】:
-
你确定你启用了 interactive-haskell-mode hook 吗?看来您使用的是劣质haskell-mode。
-
这个关于 haskell-mode 的 github 问题可能会有所帮助:github.com/haskell/haskell-mode/issues/253
标签: haskell emacs haskell-mode