Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell stack and version control

I'm new to Haskell and Stack. When creating a new project using stack new which files should be checked in to git (or any other VCS)? The whole dir?

like image 229
dimid Avatar asked Oct 19 '16 22:10

dimid


People also ask

Does Haskell have a stack?

In fact, Haskell does have a stack which can overflow, but it's not the call stack you're familiar with from C. It is quite possible to write non-tail-recursive functions which infinitely recurse and will consume all available memory without hitting a limit on call depth.

What is stack Haskell?

Stack handles the management of your toolchain (including GHC — the Glasgow Haskell Compiler — and, for Windows users, MSYS2), building and registering libraries, building build tool dependencies, and more.

What is stack Ghci?

stack ghci allows you to load components and files of your project into ghci . It uses the same TARGET syntax as stack build , and can also take options like --test , --bench , and --flag . Similarly to stack build , the default is to load up ghci with all libraries and executables in the project.

Where does stack install GHC?

You can find these sandboxed GHC installations in the ghc-* directories in the stack path --programs directory. If you would like Stack to use your system GHC installation, use the --system-ghc flag or run stack config set system-ghc --global true to make Stack check your PATH for a suitable GHC by default.


1 Answers

You should check in stack.yaml, either package.yaml (if your project has it) or your-project-name.cabal (if it hasn't), and Setup.hs, as they are necessary for building your project in a reproducible way. The src, app and test directories should also be committed, as they in principle are where your source code will live (you can of course rearrange the structure of the default project if you wish to do so). On the other hand, you should ignore the .stack-work directory, as it contains the build output and other volatile pieces of data.

like image 51
duplode Avatar answered Sep 20 '22 17:09

duplode