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
12
votes
1 answer

Cannot add extra-deps to Stack project

I'm trying to set up a Haskell project with Stack. I have created a project: stack new project1 and added the suggested dependency (acme-missile) just to see how it works. extra-deps: - acme-missiles-0.3 But when I try to invoke launchMissile in…
godzsa
  • 2,105
  • 4
  • 34
  • 56
12
votes
2 answers

include extensions in haskell-stack conf file

I want to add ViewPatterns extensions to my build and currently I do it by adding the following lines to package.yaml ghc-options: - -Wall - -XViewPatterns I get a warning: Warning: Instead of 'ghc-options: -XViewPatterns' use…
Asalle
  • 1,239
  • 19
  • 41
12
votes
1 answer

How to get stack build/install to include resource files (configs, images etc.)

After having picked up stack as a step in starting to write non-trivial haskell programs (larger than a single file) I've run across the problem of not knowing how to get stack to recognize .ini files and such. It doesn't seem to fit anywhere in the…
sara
  • 3,521
  • 14
  • 34
12
votes
1 answer

How do I get stack to use dynamic linking?

I'm using stack to build projects and find that the generated executables are pretty large (10M) even for simple programs. In order to reduce the executable size, how can i get stack to build shared libraries and generate executables that…
Joshua Chia
  • 1,760
  • 2
  • 16
  • 27
11
votes
1 answer

"macOS_SDK_headers_for_macOS_10.14.pkg is incompatible with this version of macOS" while installing Haskell on OS X mojave

While running the following code block, $ cd /Library/Developer/CommandLineTools/Packages/ $ open macOS_SDK_headers_for_macOS_10.14.pkg The installer warned This package is incompatible with this version of macOS and may fail to install. And…
ZChen
  • 111
  • 1
  • 1
  • 5
11
votes
2 answers

Haskell stack script extra deps

In a normal stack project, I can add extra-deps in the stack.yaml file: extra-deps: - text-1.2.2.0 - unm-hip-0.3.1.6 - safe-exceptions-0.1.4.0 - quickcheck-properties-0.1 - time-interval-0.1.1 - time-units-1.0.0 - snowball-1.0.0.1 -…
McBear Holden
  • 5,741
  • 7
  • 33
  • 55
11
votes
2 answers

weird error with haskell-stack. it doesn't install anything anymore

I get an error with stack, while trying to install a package. Run from outside a project, using implicit global project config Using resolver: lts-8.0 from implicit global project's config file: /home/chuck/.stack/global-project/stack.yaml Invalid…
Chuck Aguilar
  • 1,998
  • 1
  • 27
  • 50
11
votes
1 answer

Haskell Stack and C Libraries

This is possibly a duplicate of this post. But the only answer it got does not seem to work for me, so I post my own case here hoping to find a specific solution. I am on Linux Ubuntu Trusty. I have a proprietary C library, libMyLib.so, located in…
Janthelme
  • 989
  • 10
  • 23
11
votes
1 answer

Haskell Stack Ghci test-suite

I'm trying to use stack to load my test-suite in ghci and have it load the QuickCheck and hspec dependency. How can I do this? I'm using the franklinchen template.…
mac10688
  • 2,145
  • 2
  • 24
  • 37
11
votes
2 answers

How do I pass command line arguments to stack exec

I'm building a Haskell program that uses a command line argument parser using option-applicative library. Since I'm using stack to build and test my project, I would like to execute my program passing command line arguments using stack exec,…
Rodrigo Ribeiro
  • 3,198
  • 1
  • 18
  • 26
11
votes
1 answer

Using commercialhaskell/stack with a proxy

I'm trying to use stack behind a corporate proxy. Issuing the stack new command returns: InvalidProxyEnvironmentVariable "http_proxy" "http://username:password@host:port/" I have http_proxy, https_proxy and ftp_proxy defined in my .bashrc, as well…
cms_mgr
  • 1,977
  • 2
  • 17
  • 31
10
votes
2 answers

VS Code Haskell extension - Couldn't figure out what GHC version the project is using

When I open some haskell project in VS Code I get this message: Couldn't figure out what GHC version the project is using: /home/andrej/.config/Code - OSS/User/globalStorage/haskell.haskell/haskell-language-server-wrapper-1.2.0-linux…
Andrej
  • 113
  • 3
  • 8
10
votes
1 answer

How to find what library provides the import?

I joined a project. The code base is new for me. I am interested in a module, which is used in code base and it is imported from a dependency. The module is not defined in the project. Is there an automatic / easy way to figure out what library…
Daniil Iaitskov
  • 5,525
  • 8
  • 39
  • 49
10
votes
1 answer

Why does Haskell's bracket function work in executables but fail to clean up in tests?

I'm seeing a very strange behavior where Haskell's bracket function is behaving differently depending on whether stack run or stack test is used. Consider the following code, where two nested brackets are used to create and clean up Docker…
tom
  • 958
  • 6
  • 17
10
votes
0 answers

Haskell Stack: System-wide package cache

Our school computers have Stack installed, but it's hard to use because user directories have very limited space. I'm wondering if there's a way to have a system-wide .stack folder, instead of having it in user directories. If I found a solution, I…
Carl Patenaude Poulin
  • 6,238
  • 5
  • 24
  • 46