我正在尝试安装
stack install ghc-mod
Run Code Online (Sandbox Code Playgroud)
我有以下错误:
In the dependencies for ghc-mod-5.8.0.0:
Cabal-2.0.1.1 from stack configuration does not match >=1.18 && <1.25 (latest matching version is 1.24.2.0)
base-4.10.1.0 from stack configuration does not match >=4.6.0.1 && <4.10 (latest matching version is 4.9.1.0)
cabal-helper must match <0.8 && >=0.7.3.0, but the stack configuration has no specified version (latest matching version is 0.7.3.0)
extra-1.6.2 from stack configuration does not match <1.6 && >=1.4 (latest matching version is 1.5.3)
ghc-8.2.2 from stack configuration does not …Run Code Online (Sandbox Code Playgroud) 我正在使用多个stack.yaml文件来构建GHC 7.8和7.10.如何设置我PATH包含特定stack.yaml文件的二进制文件,例如stack-7.8.yaml?
我在Haskell中有点初学者,我正在尝试使用堆栈来构建应用程序.
但是,stack build执行时会给我链接器错误:
Linking .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/sim-exe/sim-exe ...
[...]/.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/libHSsim-0.1.0.0-EmdGqYS9bXF9VefempSPEG.a(Lib.o):(.text+0x98f5): undefined reference to `simzuEmdGqYS9bXF9VefempSPEG_Linter_lint_info'
[...]/.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/libHSsim-0.1.0.0-EmdGqYS9bXF9VefempSPEG.a(Lib.o):(.data+0x5f0): undefined reference to `simzuEmdGqYS9bXF9VefempSPEG_Linter_lint_closure'
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
查看标签告诉我它与此函数中的闭包有关:
lint :: String -> [LintError]
lint source = let
handleParseError :: ParseError -> [LintError]
handleParseError e = [LintError (fromSourcePos $ errorPos e) $ format e]
in
case parseSim source of
(Left error) -> handleParseError error
(Right prog) -> lintProgram prog
Run Code Online (Sandbox Code Playgroud)
但那里真的没有关闭?如果我更换执行lint与
lint _ = []
Run Code Online (Sandbox Code Playgroud)
它编译得很好.
我可以执行stack ghci并充分利用完整的 …
堆栈文档提供了使用ghcjs https://docs.haskellstack.org/en/stable/ghcjs/进行编译的示例配置.但最新的例子是lts-7.19.我想配置堆栈以使用最新的gtcjs和最新的lts(目前为8.4).
我知道ghcjs编译器是为每个lts预先打包并由https://github.com/tolysz/托管,使用https://github.com/tolysz/prepare-ghcjs.我想我真正的问题是:
我怎样才能找到ghcjs.tolysz.org上可用的版本(以及它们的sha1哈希)?
编辑:到目前为止,我发现你可以在这里查看未经测试的版本:http://tolysz.org/ghcjs/untested/但它们确实未经测试,而我试过的那些不起作用.我已经尝试用prepare-ghcjs构建我自己的但没有成功 - 在prepare-ghcjs中还没有允许ghcjs的最近更改,所以我试图在那里放一些东西https://github.com/tolysz/prepare-ghcjs/issues/6.
我不能让haskell的堆栈在我的Mac上工作.
我安装了haskell:
brew cask install haskell-platform
这里指定的是:https://www.haskell.org/platform/mac.html#osx-homebrewcask
我也尝试通过可下载的软件包安装在同一个站点上.
我执行以下命令:
stack new my-project
cd my-project
stack setup
stack build
stack exec my-project-exe
根据此处的文档:https: //docs.haskellstack.org/en/stable/README/#quick-start-guide
我立即看到了这个:
[1] 43017 killed stack exec my-project-exe
我还尝试了许多安装haskell的方法.我实际上已经能够得到的东西编译和只使用执行的cabal,但我不能再拿到hlint,hindent或ghc-mod工作,他们都返回了类似的消息,上面的一个.我希望能够在我的Mac上使用IntelliJ中的HaskForce,但我从来没有运气让haskell工作.
这里有一个gif的例子:https://imgur.com/gallery/afYym7m
我吹走了与ghc,stack和cabal相关的所有东西,然后以这种方式安装 https://haskell-lang.org/get-started
编写小的HelloWorld.hs脚本工作正常并显示 Hello, World
但是,干嘛
stack new someproj
cd someproj
stack build
结果如下:
? someproj stack build
[1 of 2] Compiling Main ( /Users/trevord2/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /Users/trevord2/.stack/setup-exe-src/setup-mPHDZzAJ.o …Run Code Online (Sandbox Code Playgroud) 我正在尝试在NixOS上构建我的haskell项目.
运行$ stack build会出现以下错误.
$ stack build
error: attribute ‘ghc822’ missing, at (string):1:53
(use ‘--show-trace’ to show detailed location information)
Run Code Online (Sandbox Code Playgroud)
这个错误意味着什么,我该怎么办?当我$ stack build --show-trace按照建议运行时,我得到以下输出,我也不明白.
$ stack build --show-trace
Invalid option `--show-trace'
Usage: stack build [TARGET] [--dry-run] [--pedantic] [--fast]
[--ghc-options OPTIONS] [--flag PACKAGE:[-]FLAG]
([--dependencies-only] | [--only-snapshot] |
[--only-dependencies]) ([--file-watch] | [--file-watch-poll])
[--exec CMD [ARGS]] [--only-configure] [--trace] [--profile]
[--no-strip] [--[no-]library-profiling]
[--[no-]executable-profiling] [--[no-]library-stripping]
[--[no-]executable-stripping] [--[no-]haddock]
[--haddock-arguments HADDOCK_ARGS] [--[no-]open]
[--[no-]haddock-deps] [--[no-]haddock-internal]
[--[no-]haddock-hyperlink-source] [--[no-]copy-bins]
[--[no-]copy-compiler-tool] [--[no-]prefetch]
[--[no-]keep-going] [--[no-]force-dirty] [--[no-]test]
[--[no-]rerun-tests] [--ta|--test-arguments …Run Code Online (Sandbox Code Playgroud) 假设我的haskell项目目录中有以下脚本:
#!/usr/bin/env stack
-- stack --resolver lts-12.5 script
-- some imports here
main :: IO ()
main = do
-- some code here
Run Code Online (Sandbox Code Playgroud)
我想使用stack.yaml项目目录中存在的文件,以获取所需的包,因为我想从特定的git提交中获取它们而不是lts-12.5.
我尝试过添加--stack-yaml stack.yaml,--resolver lts-12.5但是当我运行脚本时,我收到了这个警告:Ignoring override stack.yaml file for script command: stack.yaml.
是否可以将我的stack.yaml文件用于脚本?或者是否可以指定我想从中获取包的git提交(比如使用locationwith commit和gitinside stack.yaml)?
我需要导入 Graphics.UI.Gtk,GHC建议:
\n\n\n\n\n也许您需要将 \xe2\x80\x98text\xe2\x80\x99 添加到 .cabal 文件中的构建依赖项中。
\n
但我使用stack,所以我将gtk添加到 extra-deps 中,执行stack build并获取../gtk/: getDirectoryContents:openDirStream: 不存在 (没有这样的文件或目录)。
\n\n如何添加与stack 的依赖关系?
\n有没有办法让智能感知适用于其他模块(前奏之外的任何内容),例如 VS Code 中的 Quicktest 或 Random?\n我正在使用:
\nGHCi, version 8.10.3: https://www.haskell.org/ghc/Version 2.5.1, Git revision d6ab861544918185236cf826cb2028abb266d6d5 x86_64 hpack-0.33.0VSCode 说:
\nCould not find module \xe2\x80\x98Test.QuickCheck\xe2\x80\x99\nIt is not a module in the current program, or in any known package.not found\nRun Code Online (Sandbox Code Playgroud)\n\n我认为原因是我已经通过安装了 Quicktest stack,并且该堆栈使用其自己的“隔离”ghc。因此,我寻找一种方法来配置 VSCode 扩展以使用我的stack环境的 ghc,但没有成功。
我也尝试过黑线鳕和黑线鳕,但没有成功。
\n有没有人使用 VS-Code 来编写 haskell 代码并具有自动完成功能、鼠标悬停文档、wingman …