3

I have used stack to create a new project.

I see it has created a stack.yaml file and a myproject.cabal file, when i tried to add a dependency (split) in my .cabal file like so:

    library
      hs-source-dirs:
        src
      build-depends:
        base >= 4.7 && < 5, split
      exposed-modules:
        Lib
      default-language: Haskell2010

i then run stack build and i get a failure message:

Failed to load interface for `Data.List.Split'
Use -v to see a list of the files searched for

i then go back to my .cabal file and find that there is no split dependency listed anymore as the file has been overwritten.

Any idea why this is happening?

Shersh
  • 9,019
  • 3
  • 33
  • 61
bleakcon
  • 61
  • 9
  • 3
    My guess is that your cabal file is being controlled via `hpack`. There will be a file named `package.yaml` - which you have to edit for dependency and other information. Your cabal file will be generated based on that. – Sibi Dec 14 '17 at 17:54
  • Thank you, my first use of stack means I totally missed this, been driving me nuts, I knew something like this was happening but not what. – bleakcon Dec 14 '17 at 18:13
  • You can delete `package.yaml` if you want it to do the normal way. Honestly, the stack project templates should be documented with more than maybe a one-liner in the output of `stack templates`... – MauganRa May 28 '18 at 09:18

0 Answers0