haskell-stack

What goes in a Stack package.yaml file?

谁都会走 提交于 2019-11-30 21:45:18
问题 I notice that Stack supports using a package.yaml file that it will use to generate a .cabal file. For example, yi-core/package.yaml. Its structure seems very similar to a Cabal file, but not quite the same. Some of the keys have been renamed (for example, Stack uses source-dirs instead of hs-source-dirs ). I haven't found any documentation on this feature. The Stack docs don't seem to mention package.yaml at all. Does a specification exist? 回答1: This is hpack, available here: https://github

Generating a Nix package from a stack project

时光毁灭记忆、已成空白 提交于 2019-11-30 20:22:25
I have a software application that can be built and installed with stack . I would like to offer a binary package as well for Linux and Mac. For this purpose I'm considering nix , since, among other things, it can be used in Linux and Mac. This will save me the trouble of having to maintain two package types. After reading about how nix packages are defined, I would expect that a stack based project could be built with a configuration that would look like: { stdenv, fetchurl, stack }: # we need to depend on stack stdenv.mkDerivation { name = "some-haskell-package-0.1"; builder = ./builder.sh;

Why does Stack not recognize the dependency it just installed?

依然范特西╮ 提交于 2019-11-30 17:51:19
问题 So I'm trying to use reactive-banana + wxHaskell for GUI programming. As a newbie to Haskell and its dev tools, I'm very perplexed by stack. So I try stack install wx , which prompts me to install wxcore , which prompts me to install wxc and wxdirect . After I stack install wxdirect , I try running stack install wxc , but lo and behold: While constructing the BuildPlan the following exceptions were encountered: -- Failure when adding dependencies: wxdirect: needed (>=0.90.1.1), not present in

Could not find module `Data.Map' — It is a member of the hidden package

只愿长相守 提交于 2019-11-30 11:44:27
First, I created a new workspace: stack new xxxx stack init stack build then cd xxx\app stack ghci import Data.Map I can import other modules like Data.Char and Data.List , but I can't import Data.Map . GHCi told me: Could not find module 'Data.Map' It is a member of the hidden package 'containers-0.5.7.1@containers-0.5.7.1'.` The reason you can import Data.Char and Data.List is that they are part of the package base , which is included with GHC and is always loaded with GHCi. By contrast, Data.Map is in the external library containers . One way to load it with stack ghci is to add a cabal

Generating a Nix package from a stack project

社会主义新天地 提交于 2019-11-29 18:54:22
问题 I have a software application that can be built and installed with stack . I would like to offer a binary package as well for Linux and Mac. For this purpose I'm considering nix , since, among other things, it can be used in Linux and Mac. This will save me the trouble of having to maintain two package types. After reading about how nix packages are defined, I would expect that a stack based project could be built with a configuration that would look like: { stdenv, fetchurl, stack }: # we

Force `stack` to rebuild an installed package

浪尽此生 提交于 2019-11-29 12:39:59
问题 I often install a package which depends on external libraries and manage to move those external libraries to other locations afterwards, so that compiled programs exit with a loader error. In those cases I just want stack to rebuild an already installed package, but I don't see how that is possible. stack install --force-dirty doesn't seem to work, as it just tries to rebuild the project in the current working directory. Recent example: I'd liked to see whether regex-pcre requires a C library

Understanding Haskell's stack program and the resolver and LTS version

荒凉一梦 提交于 2019-11-29 05:34:31
问题 I am trying to understand how to use stack and stackage.org. When I first installed it and used it, stackage.org was at LTS-3.8 (the "resolver"). Since then, stackage.org now has LTS-3.11. First, I'd like to confirm what this means. Stackage is a repository of packages in which, for a specific LTS version (say 3.8), the packages have been verified to work together. So the packages of LTS-3.8 work together, and the packages of LTS-3.11 also work together. Moving on ... When I run stack new

How to install/use a local version of package using Stack?

瘦欲@ 提交于 2019-11-29 04:59:00
问题 The situation is, I am trying to install Netwire using Stack. However, there is a problem in the latest netwire 5.0.1, as reported by dhobbs: http://hub.darcs.net/ertes/netwire/issue/13 Since I don't know when the problem will ever be fixed, I downloaded the repo and made the change myself. However, I don't understand how to install such a locally patched version. stack install does not install that into ~/.stack . Does anyone have an idea? Update Now I am developing some other libraries

Stack build fails due to missing package although stack ghci works

走远了吗. 提交于 2019-11-28 12:54:59
I am trying to build a simple program in Haskell using stack. I created a new project using stack new and did a stack setup after that. The template builds fine. I want to experiment with binary file parsing, so I imported Data.ByteString . My build-depends in the cabal file look like this: build-depends: base >= 4.7 && < 5 , bytestring >= 0.10.6 , binary >= 0.7.5 stack ghci now just works, but stack build is still not happy. Can someone tell me what I did wrong here? Here is the complete error message: test-0.1.0.0: build Preprocessing library test-0.1.0.0... In-place registering test-0.1.0.0

Could not find module `Data.Map' — It is a member of the hidden package

北慕城南 提交于 2019-11-27 17:37:57
问题 First, I created a new workspace: stack new xxxx stack init stack build then cd xxx\app stack ghci import Data.Map I can import other modules like Data.Char and Data.List , but I can't import Data.Map . GHCi told me: Could not find module 'Data.Map' It is a member of the hidden package 'containers-0.5.7.1@containers-0.5.7.1'.` 回答1: The reason you can import Data.Char and Data.List is that they are part of the package base , which is included with GHC and is always loaded with GHCi. By