gpt4 book ai didi

haskell - 找不到模块 'Data.Set'

转载 作者:行者123 更新时间:2023-12-02 17:00:28 25 4
gpt4 key购买 nike

我的 Fedora 28 系统上安装了以下 RPM 软件包:

ghc-ghc-8.2.2-66
ghc-containers-0.5.10.2-66

根据hackage设置的模块应包含在给定的 RPM 中。但是尝试导入 Data.Set 结果

<no location info>: error:
Could not find module ‘Data.Set’
Perhaps you meant Data.Int (from base-4.10.1.0)

我是否错过了要安装的东西?如何检查哪些模块可用?

编辑:

$ ghc-pkg list
/usr/lib64/ghc-8.2.2/package.conf.d
base-4.10.1.0
ghc-prim-0.5.1.1
integer-gmp-1.0.1.0
rts-1.0

如何注册模块?

最佳答案

我会跳过操作系统软件包并选择 stack :

$ wget -o get-stack.sh https://get.haskellstack.org/
$ chmod +x get-stack.sh
$ ./get-stack.sh -d ~/.local/bin
$ echo 'export PATH="~/.local/bin:$PATH"' >> ~/.bashrc
$ source ~/.bashrc
$ stack --version
Version 1.7.1, Git revision ...

然后使用stack ghc运行GHC;第一次会安装这个:

$ stack ghc
Writing implicit global project config file to: ...
Note: You can change the snapshot via the resolver field there.
Using latest snapshot resolver: lts-12.9
Downloaded lts-12.9 build plan.
Preparing to install GHC to an isolated location.

关于haskell - 找不到模块 'Data.Set',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52134945/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com