2

我想System.Directory在带有 Haskell 模式和 Intero 的 emacs 中使用,而动态检查会警告Couldn't find module System.Directory. 所以我在我的 cabal 文件中添加了一些依赖项。stack build并且成功执行时警告不会消失。

下面是我的阴谋集团文件:

-- This file has been generated from package.yaml by hpack version 0.28.2.
--
-- see: https://github.com/sol/hpack
--
-- hash: 536b5f6ecaaec7d4b7a9694c8f69bbe648a1d21d80fa721e533ac5b139955401

name:           find
version:        0.1.0.0
description:    Please see the README on GitHub at <https://github.com/Handora/find#readme>
homepage:       https://github.com/Handora/find#readme
bug-reports:    https://github.com/Handora/find/issues
author:         Handora
maintainer:     qcdsr970209@gmail.com
copyright:      Qian Chen
license:        BSD3
license-file:   LICENSE
build-type:     Simple
cabal-version:  >= 1.10
extra-source-files:
    ChangeLog.md
    README.md

source-repository head
  type: git
  location: https://github.com/Handora/find

library
  exposed-modules:
      Lib
      RecursiveContents
  other-modules:
      Paths_find
  hs-source-dirs:
      src
  build-depends:
      base >=4.7 && <5
    , directory
  default-language: Haskell2010

executable find-exe
  main-is: Main.hs
  other-modules:
      Paths_find
  hs-source-dirs:
      app
  ghc-options: -threaded -rtsopts -with-rtsopts=-N
  build-depends:
      base >=4.7 && <5
    , find
    , directory
  default-language: Haskell2010

test-suite find-test
  type: exitcode-stdio-1.0
  main-is: Spec.hs
  other-modules:
      Paths_find
  hs-source-dirs:
      test
  ghc-options: -threaded -rtsopts -with-rtsopts=-N
  build-depends:
      base >=4.7 && <5
    , find
  default-language: Haskell2010

我将其添加directory到构建依赖项和可执行构建依赖项中。所以我的问题是如何使对System.Directory可见Intero,所以警告可以消失。

4

1 回答 1

3

您可以通过运行来显示它intero-restart

可能有一种“更正确”的方式,但这是可行的。

于 2018-06-19T12:57:49.707 回答