我正在嘗試使用以下方法在 Windows 上安裝 hlint: cabal install hlint,但出現以下錯誤:
Preprocessing executable 'hlint' for hlint-1.8.50..
Building executable 'hlint' for hlint-1.8.50..
<no location info>: warning: [-Wmissing-home-modules]
These modules are needed for compilation but not listed in your .cabal file's other-modules:
Apply
CmdLine
HLint
HSE.All
HSE.Bracket
HSE.Evaluate
HSE.Match
HSE.NameMatch
HSE.Type
HSE.Util
Hint.All
Hint.Bracket
Hint.Duplicate
Hint.Extensions
Hint.Import
Hint.Lambda
Hint.List
Hint.ListRec
Hint.Match
Hint.Monad
Hint.Naming
Hint.Pragma
Hint.Structure
Hint.Type
Hint.Util
Idea
Language.Haskell.HLint
Parallel
Proof
Report
Settings
Test
Util
[ 1 of 35] Compiling HSE.Type ( src\HSE\Type.hs, dist\build\hlint\hlint-tmp\HSE\Type.o )
src\HSE\Type.hs:6:1: error:
Could not find module `Language.Haskell.Exts.Annotated'
Perhaps you meant
Language.Haskell.Exts.Syntax (from haskell-src-exts-1.23.1)
Language.Haskell.Exts.Pretty (from haskell-src-exts-1.23.1)
Language.Haskell.Exts.Build (from haskell-src-exts-1.23.1)
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
6 | import Language.Haskell.Exts.Annotated as Export hiding (parse, loc, parseFile, paren, Assoc(..))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cabal.exe: Failed to build hlint-1.8.50. See the build log above for details.
Glorious Glasgow Haskell 編譯系統,版本 9.2.1,hlint-1.8.50
uj5u.com熱心網友回復:
根據 Neil Mitchell 的評論“沒有發布版本的 HLint 可以與 GHC 9.2.1 一起使用(因為它的某些依賴項尚未準備好)”,不可能在已安裝的 GHC 9.2.1 上運行 HLint默認使用 Chocolatey 和 Haskell Platform for Windows。
但是,我找到了解決方法。我為 Windows 安裝了 GHCup:
Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $true
GHCup 安裝了 cabal 和 ghc 8.10.7,與 HLint 完美兼容。為了安裝 HLint,我運行了:
cabal update
cabal install hlint
之后將新創建的 hlint 二進制檔案的位置添加到 PATH。瞧:一切都像魅力一樣!
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/387016.html
上一篇:在Haskell中合并兩個串列
下一篇:fmap替換決議樹中的文字
