1
我正在试图用ghc-mod来绑定一个文件。我知道ghc-mod为此使用hlint,我知道hlint接受参数来修改它报告的建议。例如,这工作得很好:将hlint参数传递给ghc-mod的正确方法?
[email protected]:total-beginner-haskell$ hlint src/Borrower.hs --hint=Generalise
src/Borrower.hs:44:3: Suggestion: Use mappend
Found:
getName br ++
" (" `mappend` show (getMaxBooks br) `mappend` " books)"
Why not:
getName br `Data.Monoid.mappend`
(" (" `mappend` show (getMaxBooks br) `mappend` " books)")
1 hint
这里的格式GHC-MOD需要将参数传递给hlint:
Usage: ghc-mod lint [-h|--hlintOpt ARG] FILE
但是下面没有变化的产生上图所示的提示:
[email protected]:total-beginner-haskell$ ghc-mod lint -h hint=Generalise src/Borrower.hs
[email protected]:total-beginner-haskell$ ghc-mod lint --hlintOpt hint=Generalise src/Borrower.hs
[email protected]:total-beginner-haskell$ ghc-mod lint --hlintOpt "--hint=Generalise" src/Borrower.hs
[email protected]:total-beginner-haskell$ ghc-mod lint --hlintOpt '--hint=Generalise' src/Borrower.hs
ghc-mod使用正确的格式将参数传递给hlint的格式是什么?
谢谢。
感谢您的帮助。我用“堆栈安装ghc-mod”来获得ghc mod。我有:“由GHC 8.0.1编译的ghc-mod版本5.6.0.0”。你能告诉我如何像Github的大师一样建立吗?谢谢。 – ericky
@ericky我更新了答案并添加了如何构建 – ymonad
非常感谢!最后一个问题:它是否会影响我将repo克隆到哪个目录? – ericky