haskell - 在 emacs 上使用 Hlint 和 intero

标签 haskell emacs hlint intero

我无法使用 intero 在 emacs 中获得 hlint 建议。

  • 我有一个新安装的 emacs 24.5
  • 我在 here 添加了 intero 内容进入新 ~/.emacs文件
  • 我对emacs没有做任何其他事情。

  • 我读过解决方案是:
    (flycheck-add-next-checker 'intero
                               '(warning . haskell-hlint))
    

    但我不知道我该怎么处理这个。如果我将它添加到我的 ~/.emacs文件然后emacs在启动时失败。

    (其余的似乎没问题 - 当我打开 Haskell 文件时会启动 intero - 在我键入时会立即标记错误。)

    如何让 Hlint 建议出现?

    最佳答案

    通过将其添加到我的 ~/.emacs 文件来修复:

    ;; do linting on-the-fly 
    (with-eval-after-load 'intero
      (flycheck-add-next-checker 'intero '(warning . haskell-hlint))
    )
    

    (完整的~/.emacs文件可以查看here)

    关于haskell - 在 emacs 上使用 Hlint 和 intero,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40400547/

    相关文章:

    parsing - 我的 Megaparsec 解析器卡住了,而且 ghci 调试也没有帮助

    emacs - 如何在 Emacs 组织模式中调用 Emacs Lisp 函数?

    haskell - 在 HLint 的上下文中,eta reduce 是什么意思

    performance - Prolog 有像 Haskell 一样的别名 "operator"吗?

    haskell - 何时在 Haskell 中毫无悔意地使用 CPS、共密度与反射

    emacs - 在 Emacs 中更新软件包

    debugging - Erlang 是否有与 HLint 等价的工具?

    haskell - Haskell 任务的 Makefile 示例

    mongodb - 如何在 persistent-mongoDB 中使用 MongoDB 查询选择器? (Yesod)

    javascript - 如何在 emacs 的 js2 模式下 trim 尾随空格