这里的哈斯克尔生态系统很新。我正在尝试安装hunit,但是当我运行cabal install hunit时,我得到了以下消息:
Warning: The install command is a part of the legacy v1 style of cabal usage.
Please switch to using either the new project style and the new-install
command or the legacy v1-install alias as new-style projects will become the
default in the next version of cabal-install. Please file a bug if you cannot
replicate a working v1- use case with the new-style commands.
For more information, see: https://wiki.haskell.org/Cabal/NewBuild
cabal: There is no package named 'hunit'. However, the following package name
exists: 'HUnit'.发布于 2019-09-04 06:18:41
这条信息告诉了你两件不同的事情。"Install“是一个遗留命令,"hunit”不存在。
您的简短解决方案是cabal v2-install --lib HUnit。对于遗留行为,请考虑cabal v1-install HUnit。
安装是遗留的:大段
阴谋集团过去总是把所有的东西安装到一个单一的商店中,无论是用户还是系统,如果有任何软件包在软件包版本上有不同意见,那么祝你好运。v2命令转移到"nix样式的构建“,在那里不同版本可以共存在存储中,项目可以通过共享公共包的构建而继续受益。v2命令实际上是以v2-作为前缀的命令,例如v2-install、v2-build和v2-configure。
hunit不存在
黑客攻击区分大小写。该工具已经告诉您,您可能打算安装HUnit而不是hunit。
使用--lib
除非通过v2-install显式安装,否则--lib不会公开构建的库。这减少了一些昂贵的需要重新培训的程序员的名称空间混乱。要使用HUnit作为库并在repl中使用它,请添加--lib,如前面所示。
https://stackoverflow.com/questions/57781735
复制相似问题