0

I am working with haskell using stack and each time I need to painfully download all dependencies for creating a new project. Sometimes I wanna overwrite the codes by starting afresh and deleting previous files as they might interfere and make use of default .yaml files. Is there any command that makes a directory made by stack reusable like starting afresh without downloading anything ?

duplode
  • 33,731
  • 7
  • 79
  • 150
Akash
  • 939
  • 1
  • 8
  • 27
  • `stack clean && stack build`? Although I'm not sure at the moment, to be honest. – Zeta May 11 '17 at 12:05
  • 1
    Not sure what you mean, or why you would want to use exactly the same directory for a new project. Stack caches dependencies for each LTS version (in `~/.stack`, not the project directory), so you don't have to download them every time you start a new project. If you mean "how do I setup a new project", then you can do that using `stack new`. – Shaun the Sheep May 11 '17 at 14:12

1 Answers1

1

If you don't want stack to catch the new and shiny LTS version every time you create a new project, you should tell stack to use one LTS version you know is saved on your computer. For instance, the current LTS is 8.13. If you want to use 8.2, type:

stack new projectname --resolver=lts-8.2

More info here: Understanding Haskell's stack program and the resolver and LTS version

Community
  • 1
  • 1
Román García
  • 425
  • 1
  • 4
  • 16