Questions tagged [haskell-stack]

Questions about the Stack, a build tool for the Haskell language. Do not use this tag for general Haskell questions that do not involve Stack.

stack is a modern, cross-platform build tool for Haskell code. It covers management of Haskell environment and project dependencies, building, testing and benchmarking.

1268 questions
25
votes
1 answer

How to load tests in ghci with stack

I created a very simple project with stack. It contains: an executable, a library and test targets in the associated cabal file. When I load the code to ghci via stack ghci, I can't access test there, even if they are in separate module. Is there…
Konstantin Solomatov
  • 10,252
  • 8
  • 58
  • 88
24
votes
2 answers

How do I set up IntelliJ to build Haskell projects with Stack?

I am using Stack to setup, build, and run my Haskell projects from the command line. I want to use IntelliJ as my IDE but am running into problems configuring Stack as my build tool. I used Stack to create and run a "Hello, World" Haskell program on…
W.P. McNeill
  • 16,336
  • 12
  • 75
  • 111
21
votes
1 answer

Stack's package.yaml vs stack.yaml

Stack has supported hpack's package.yaml configuration files since at least around this commit, as far as I can tell, but there's not much documentation about the differences between it and the stack.yaml file. One of the few links I've found…
hnefatl
  • 5,860
  • 2
  • 27
  • 49
21
votes
2 answers

How am I meant to split code between src/Lib.hs and app/Main.hs in a new stack project?

I was following the stack guide and I got a new project setup (yay!). It generated the following file layout: . ├── app │   ├── Main.hs ├── .gitignore ├── LICENSE ├── helloworld.cabal ├── Setup.hs ├── src │   └── Lib.hs ├── stack.yaml └── test …
Sunjay Varma
  • 5,007
  • 6
  • 34
  • 51
20
votes
1 answer

Why is a fresh install of Haskell-Stack and GHC so large/big?

When doing a fresh install of Haskell Stack through the install script from here: wget -qO- https://get.haskellstack.org/ | sh Followed by: stack setup you will end up with a $HOME/.stack/ directory of 1.5 GB size (from just a 120+ MB download).…
Klorax
  • 579
  • 2
  • 6
  • 10
18
votes
1 answer

What is package.yaml & stack.yaml & Setup.hs & the-project-name.cabal files?

I find that, when I use the stack new the-project-name new-template command, many files is generated into a new directory. and I notice the following 4 special files: package.yaml stack.yaml Setup.hs the-project-name.cabal These 4 files seems…
luochen1990
  • 3,689
  • 1
  • 22
  • 37
17
votes
1 answer

How to upgrade GHC with Stack

The output of stack ghc -- --version is The Glorious Glasgow Haskell Compilation System, version 7.10.3 I want to upgrade to GHC 8. How can I tell Stack to upgrade GHC?
mac10688
  • 2,145
  • 2
  • 24
  • 37
17
votes
1 answer

How to list the global packages installed by `stack`?

I want to check if some package is installed globally by stack. How to do that?
Ben
  • 3,612
  • 3
  • 19
  • 24
16
votes
1 answer

Load a new package in ghci using stack

Is there a way to load a package(s) using Stack in GHCI and play around with it ? So, that when the ghci is loaded, we can import the modules and see it's type signature, etc.
Sibi
  • 47,472
  • 16
  • 95
  • 163
16
votes
1 answer

How can I make Stack call Happy, Alex and other build tools?

As part of my compiler, I need alex and happy to run as part of my build process. How does Stack support this scenario? Bonus: how can I register alex and happy as compile-time dependencies?
Carl Patenaude Poulin
  • 6,238
  • 5
  • 24
  • 46
15
votes
4 answers

Stack has not been tested with GHC & Cabal versions

In my Haskell project when I stack run, it is showing the following, but still runs. What warning is this? How can I get rid of it? Stack has not been tested with GHC versions above 8.6, and using 8.8.2, this may fail Stack has not been tested with…
Muhammadjon
  • 1,476
  • 2
  • 14
  • 35
15
votes
2 answers

How do you set the executable output location for a Haskell project built with Stack?

While building my Haskell programs with Stack, I'm trying to get the executable to be written to project/dist/ but no matter what command line arguments I use or config files I change, it always ends up in…
TheEnvironmentalist
  • 2,694
  • 2
  • 19
  • 46
15
votes
1 answer

Select which test to run with Hspec and stack

I've written a series of test, using the automatic spec discovery feature of Hspec. I'm also using stack as my build tool. My test directory has the the Spec.hs file, along with the test files for the different modules of my application (e.g.…
Damian Nadales
  • 4,907
  • 1
  • 21
  • 34
14
votes
1 answer

Is my experience with setting up Haskell dev environment for the first time common or a one-off?

I've decided to start with Haskell and bumped into an unfamiliar ecosystem. I've wrote down my current conclusions in short and long version (by now I realise the issue I had is probably temporal and won't apply in the future and realise that below…
rusln
  • 1,284
  • 8
  • 10
14
votes
1 answer

Recommended approach to use Stack as global package manager

I would like to install some Haskell libraries globally, for example hindent which is used by my editor's Haskell integration. What is the recommended way to do this? I thought that stack install hindent was the correct way to do this. However, then…
Resigned June 2023
  • 4,638
  • 3
  • 38
  • 49
1
2
3
84 85