为什么派生出现错误消息?

发布于 2025-01-17 19:33:48 字数 1451 浏览 0 评论 0原文

我有一个带有以下行的Haskell文件:

{-# LANGUAGE DeriveGeneric #-}

但是,我在该行上收到以下错误消息:

Failed to parse result of calling cabal
Resolving dependencies...
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - haskell-translator-0.1.0.0 (exe:haskell-translator) (configuration changed)

Warning: haskell-translator.cabal:24:5:
unexpected 'a'
expecting space, "&&", white space, "||", comma or end of input

base >=4.12 && <4.13
async
cabal: Failed parsing "./haskell-translator.cabal".

以下是我的.cabal文件的内容:

name:                haskell-translator
version:             0.1.0.0
-- synopsis:
-- description:
license:             BSD3
license-file:        LICENSE
author:              saad.shaikh
maintainer:          [email protected]
-- copyright:
-- category:
build-type:          Simple
extra-source-files:  CHANGELOG.md
cabal-version:       >=1.10

executable haskell-translator
  main-is:             Main.hs
  -- other-modules:
  -- other-extensions:
  build-depends:       
    base >=4.12 && <4.13
    async>=1.2.0 && <1.3
    haskell-translator-0.1.0.0
  -- hs-source-dirs:
  default-language:    Haskell2010

错误消息的原因是什么?

I have a haskell file with the below line:

{-# LANGUAGE DeriveGeneric #-}

However, I am getting the below error message on that line:

Failed to parse result of calling cabal
Resolving dependencies...
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - haskell-translator-0.1.0.0 (exe:haskell-translator) (configuration changed)

Warning: haskell-translator.cabal:24:5:
unexpected 'a'
expecting space, "&&", white space, "||", comma or end of input

base >=4.12 && <4.13
async
cabal: Failed parsing "./haskell-translator.cabal".

And below are the contents of my .cabal file:

name:                haskell-translator
version:             0.1.0.0
-- synopsis:
-- description:
license:             BSD3
license-file:        LICENSE
author:              saad.shaikh
maintainer:          [email protected]
-- copyright:
-- category:
build-type:          Simple
extra-source-files:  CHANGELOG.md
cabal-version:       >=1.10

executable haskell-translator
  main-is:             Main.hs
  -- other-modules:
  -- other-extensions:
  build-depends:       
    base >=4.12 && <4.13
    async>=1.2.0 && <1.3
    haskell-translator-0.1.0.0
  -- hs-source-dirs:
  default-language:    Haskell2010

What is the reason for the error message?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陈独秀 2025-01-24 19:33:48

您的Cabal文件在build依赖 e节上存在一些问题,您应该通过逗号分开项目,并使用Constrainst So == 0.1.0.0.0,而不是-0.1.0.0

build-depends:
    base >=4.12 && <4.13
  , async>=1.2.0 && <1.3
  , haskell-translator == 0.1.0.0

Your cabal file has some problems with the build-depends section, you shhould separate the items by a comma, and use constrainst so == 0.1.0.0, not -0.1.0.0:

build-depends:
    base >=4.12 && <4.13
  , async>=1.2.0 && <1.3
  , haskell-translator == 0.1.0.0
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文