iamaprogrammer
iamaprogrammer

Reputation: 135

Why is DeriveGeneric showing an error message?

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?

Upvotes: 0

Views: 81

Answers (1)

willeM_ Van Onsem
willeM_ Van Onsem

Reputation: 476567

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

Upvotes: 1

Related Questions