haskell-stack

stack build error: attribute ‘ghc822’ missing, at (string):1:53

牧云@^-^@ 提交于 2019-12-04 03:22:19
I am attempting to build my haskell project on NixOS. Running $ stack build gives the following error. $ stack build error: attribute ‘ghc822’ missing, at (string):1:53 (use ‘--show-trace’ to show detailed location information) What does this error mean and how could I proceed? When I run $ stack build --show-trace as suggested, I get the following output, which I do not understand either. $ stack build --show-trace Invalid option `--show-trace' Usage: stack build [TARGET] [--dry-run] [--pedantic] [--fast] [--ghc-options OPTIONS] [--flag PACKAGE:[-]FLAG] ([--dependencies-only] | [--only

Stack's package.yaml vs stack.yaml

假装没事ソ 提交于 2019-12-04 02:58:52
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 talking about it is this documentation , where it says: package.yaml is a file format supported by hpack. It adds some niceties on top of cabal. For example, hpack has YAML syntax support and will automatically generate of exposed-modules lists. However, it's just a frontend to cabal package files. So from this, it seems like package.yaml provides a

How to use “-ddump-minimal-imports” with stack

僤鯓⒐⒋嵵緔 提交于 2019-12-03 15:01:09
I am such a big fan of stack, that I've removed any independent cabal and ghc executables completely from my machine (letting stack install whatever it needs in its own mysterious ~/.stack/ directory).... However, it looks like some flags aren't working properly under stack. For instance, I want to use -ddump-minimal-imports . In cabal this would be cabal build --ghc-option=-ddump-minimal-imports The obvious translation would be stack build --ghc-options -ddump-minimal-imports This runs, but produces nothing but the executable (as far as I can tell, at least.... Perhaps the output is somewhere

Haskell Stack Ghci test-suite

别来无恙 提交于 2019-12-03 12:03:15
问题 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. https://github.com/commercialhaskell/stack-templates/blob/master/franklinchen.hsfiles I have tried stack ghci spec stack ghci test-suite stack ghci --main-is spec I modified the test-suite spec to target the main-is: LibSpec.hs file test-suite spec default-language: Haskell2010 ghc-options: -Wall type: exitcode-stdio-1.0 hs-source

How do I add the “containers” package to my .cabal file (without getting overwritten by stack at compile time)?

拈花ヽ惹草 提交于 2019-12-03 11:55:12
I am working on the "roman-numerals" task from the exercism Haskell track and followed their instructions to installing stack . I am working on a Fedora 24 box. As long as I was working with Haskell modules from base, I didn't have a problem. Now I am trying to import the Data.Map module. It works fine using the ghci command line: $ ghci GHCi, version 7.8.4: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> import Data.Map Prelude Data.Map> However, when I

How to upgrade GHC with Stack

荒凉一梦 提交于 2019-12-03 11:36:36
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 User dysfun from the IRC answered my question so I will post it here for posterity. To update GHC that's used to compile a project, go to the project's stack.yaml file. In there is the resolver field. Update that accordingly. Some examples: resolver: ghc-8.0.2 resolver: lts-9.0 resolver: nightly-2015-09-21 For my case, I learned from this webpage that resolver lts-9.0 uses GHC 8.0.2. Here's more on Stack's resolvers.

How to use import a personal library in another project with Stack?

孤街醉人 提交于 2019-12-03 10:07:23
问题 So I have a personal stack library, let's call it Foo . In Foo , I have a FooModule module file named FooModule.hs . I have another stack project called Bar . How do I import the FooModule.hs module to project Bar ? 回答1: I do this all the time. In your stack.yaml file, add the path to the Foo package: -- stack.yaml packages: - '.' - lib/foo And then in your Bar.cabal file you say that your build depends on Foo -- project.cabal ... build-depends: base >= 4.7 && < 5 , foo 来源: https:/

Haskell Stack install package dependency from github

扶醉桌前 提交于 2019-12-03 04:14:25
问题 Is it possible to install a version of a package from github using Haskell stack? e.g. in a .cabal or a stack.yaml file, how can I point a dependency at a git repo/branch/revision? 回答1: The documentation for the stack.yaml packages section gives examples of referring to more complex package locations. packages: - location: . - location: dir1/dir2 - location: https://example.com/foo/bar/baz-0.0.2.tar.gz - location: http://github.com/yesodweb/wai/archive/2f8a8e1b771829f4a8a77c0111352ce45a14c30f

Haskell Stack Ghci test-suite

做~自己de王妃 提交于 2019-12-03 02:27:30
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. https://github.com/commercialhaskell/stack-templates/blob/master/franklinchen.hsfiles I have tried stack ghci spec stack ghci test-suite stack ghci --main-is spec I modified the test-suite spec to target the main-is: LibSpec.hs file test-suite spec default-language: Haskell2010 ghc-options: -Wall type: exitcode-stdio-1.0 hs-source-dirs: test main-is: LibSpec.hs build-depends: base , chapterexercises , hspec , QuickCheck stack ghci -

How to use import a personal library in another project with Stack?

自作多情 提交于 2019-12-03 00:40:46
So I have a personal stack library, let's call it Foo . In Foo , I have a FooModule module file named FooModule.hs . I have another stack project called Bar . How do I import the FooModule.hs module to project Bar ? I do this all the time. In your stack.yaml file, add the path to the Foo package: -- stack.yaml packages: - '.' - lib/foo And then in your Bar.cabal file you say that your build depends on Foo -- project.cabal ... build-depends: base >= 4.7 && < 5 , foo 来源: https://stackoverflow.com/questions/42395931/how-to-use-import-a-personal-library-in-another-project-with-stack