无法在 Haskell 中导入和下载 Data.List.Ordered

发布于 2025-01-20 03:09:30 字数 1734 浏览 3 评论 0原文

我在 Haskell 上太初学者了,我编写了一个导入 Data.List.Ordered 的简单程序,当我运行该程序时出现此错误:

test.hs:3:1: error:
    Could not find module `Data.List.Ordered'
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
3 | import Data.List.Ordered ( isSorted, nub )
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

然后我厌倦了使用以下命令下载包:

cabal install --lib --package-env . ordered

但它也不起作用

C:\WINDOWS\system32>cabal install --lib --package-env . ordered
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - ordered-0.1 (lib:ordered) (requires build)
Starting     ordered-0.1 (all, legacy fallback)
Building     ordered-0.1 (all, legacy fallback)

Failed to build ordered-0.1.
Build log (
C:\Users\reema\Desktop\Haskell\cabal\logs\ghc-8.10.7\ordered-0.1-e612131c8de88f5b62dca269575aa8273bdac512.log
):
Preprocessing library for ordered-0.1..
Building library for ordered-0.1..
[1 of 3] Compiling Data.Poset.Internal ( Data\Poset\Internal.hs, dist\build\Data\Poset\Internal.o )

Data\Poset\Internal.hs:32:10: error:
    * No instance for (Semigroup PosetOrd)
        arising from the superclasses of an instance declaration
    * In the instance declaration for `Monoid PosetOrd'
   |
32 | instance Monoid PosetOrd where
   |          ^^^^^^^^^^^^^^^
cabal-3.6.2.0.exe: Failed to build ordered-0.1. See the build log above for details.

我正在使用的这些版本:

GHCi,  version 8.10.7
Cabal, version3.6.2.0

I'm too beginner in Haskell and I wrote a simple program that imports Data.List.Ordered, when I run the program this error appears:

test.hs:3:1: error:
    Could not find module `Data.List.Ordered'
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
3 | import Data.List.Ordered ( isSorted, nub )
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Then I tired to download the package using the following command:

cabal install --lib --package-env . ordered

but It didn't work as well

C:\WINDOWS\system32>cabal install --lib --package-env . ordered
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - ordered-0.1 (lib:ordered) (requires build)
Starting     ordered-0.1 (all, legacy fallback)
Building     ordered-0.1 (all, legacy fallback)

Failed to build ordered-0.1.
Build log (
C:\Users\reema\Desktop\Haskell\cabal\logs\ghc-8.10.7\ordered-0.1-e612131c8de88f5b62dca269575aa8273bdac512.log
):
Preprocessing library for ordered-0.1..
Building library for ordered-0.1..
[1 of 3] Compiling Data.Poset.Internal ( Data\Poset\Internal.hs, dist\build\Data\Poset\Internal.o )

Data\Poset\Internal.hs:32:10: error:
    * No instance for (Semigroup PosetOrd)
        arising from the superclasses of an instance declaration
    * In the instance declaration for `Monoid PosetOrd'
   |
32 | instance Monoid PosetOrd where
   |          ^^^^^^^^^^^^^^^
cabal-3.6.2.0.exe: Failed to build ordered-0.1. See the build log above for details.

These versions I'm using:

GHCi,  version 8.10.7
Cabal, version3.6.2.0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文