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?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With