haskell-stack

I cant import System.Directory when using stack

谁都会走 提交于 2019-12-22 10:28:08
问题 I am little confused about why this doesn't work. I have a small program that import System.Directory. When I run it with runhaskell on the command line it compiles and outputs what I expect. When I use the same program with stack I get a message saying Failed to load interface for ‘System.Directory’ It is a member of the hidden package ‘directory-1.3.0.0’. Use -v to see a list of the files searched for. I dont understand why it would work with runhaskell but not when i use stack ghci 回答1:

Profiling with Stack

こ雲淡風輕ζ 提交于 2019-12-22 10:07:25
问题 I'm trying to get profiling working in Stack, so that I can get the same metrics as the one indicated on Chapter 25 of RWH. I started a new Stack project, as follows: stack new test Then, as indicated here I ran: stack install --executable-profiling --library-profiling --ghc-options="-rtsopts" However this command fails with the following error: While constructing the BuildPlan the following exceptions were encountered: -- While attempting to add dependency, Could not find package base in

Why doesn't stack add packages to the ghc package database?

喜欢而已 提交于 2019-12-22 05:34:14
问题 I've decided to try giving stack a shot. I've installed it and used it to install the latest version of ghc. I've used stack to install some packages but the packages are not visible to ghc and when I list packages with ghc-pkg I see that the packages that I've installed through stack are not there. Why is this? Am I misunderstanding the purpose of stack? 回答1: Stack never touches global packages database. It uses layered database approach global database - untouched packages in the stackage

Haskell: Missing C library on Arch Linux works on Ubuntu

扶醉桌前 提交于 2019-12-21 19:28:40
问题 I recently switched my PC at work from Ubuntu to Arch Linux . And I am now getting the following error (I am using stack to build my project): setup-Simple-Cabal-1.22.4.0-ghc-7.10.2: Missing dependency on a foreign library: * Missing C library: HSrts-ghc7.10.2 This problem can usually be solved by installing the system package that provides this library (you may need the "-dev" version). If the library is already installed but in a non-standard location then you can use the flags --extra

How do I install Haskell Stack locally?

余生长醉 提交于 2019-12-21 15:14:11
问题 I am working on my school server and I need to install Haskell's stack. In the README file and on the website I could not find how to install locally. What can I do if I am not a sudo user? 回答1: You don't need superuser privileges to install stack; you can as well install it in your own home directory. All you need for this to work is a Linux system with GMP installed (which GHC depends on at a very fundamental level). If GMP is not installed – the admins really shouldn't have any concerns

Stack (Haskell) throws TlsException in Windows

北城以北 提交于 2019-12-21 03:53:06
问题 Stack (under Windows) sometimes throws the following exception when trying to download files (e.g., during stack setup or while downloading a build plan): TlsException (HandshakeFailed (Error_Protocol ("certificate has unknown CA",True,UnknownCa))). How to get around this error if it occurs? (This was discussed and solved on https://github.com/commercialhaskell/stack/issues/234, I am reposting the question to make the solution more available.) 回答1: This is due to a certificates not being

How to upgrade GHC with Stack

时光怂恿深爱的人放手 提交于 2019-12-21 03:50:33
问题 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? 回答1: 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

How to uninstall a Haskell package installed with stack?

空扰寡人 提交于 2019-12-20 11:18:10
问题 How can I uninstall a Haskell package installed globally with stack tool? stack --help shows that uninstall command is deprecated. uninstall DEPRECATED: This command performs no actions, and is present for documentation only 回答1: As stack --help says, uninstall doesn't do anything. You can read about this on the stack github where this feature was requested, but it ended up being closed without the desire to add the behavior to stack, for various reasons. So, officially, there is no way to

What is the difference between Cabal and Stack?

拜拜、爱过 提交于 2019-12-20 08:06:27
问题 Yesterday I learnt about a new Haskell tool called Stack. At the first blush, it looks like it does much the same job as Cabal. So, what is the difference between them? Is stack a replacement for Cabal? In which cases should I use Stack instead of Cabal? What can Stack do that Cabal can't? 回答1: Is stack a replacement for Cabal? Yes and No. In which cases should I use Stack instead of Cabal? What can Stack do that Cabal can't? Since Stack uses the curated stackage packages by default , the

stack cannot build network - where's config.log?

巧了我就是萌 提交于 2019-12-20 06:17:11
问题 I have a project to build with stack and it depends on network . When I do stack build , it says [1 of 1] Compiling Main ( /tmp/stack23678/network-2.6.2.1/Setup.hs, /tmp/stack23678/network-2.6.2.1/.stack-work/dist/i386-linux/Cabal-1.22.5.0/setup/Main.o ) Linking /tmp/stack23678/network-2.6.2.1/.stack-work/dist/i386-linux/Cabal-1.22.5.0/setup/setup ... Configuring network-2.6.2.1... ... checking whether the C compiler works... no configure: error: in `/tmp/stack23678/network-2.6.2.1':