cabal

Install Haskell packages using cabal without internet connection

假如想象 提交于 2019-12-21 16:54:57
问题 I have a machine that doesn't have internet access at all. I installed the Haskell Platform on it using the installer which I got from another machine through a pendrive. Now I want to install the package repa on my home machine which has no internet access. How should I do that? My home machine is running Linux (Debian) and my office machine is Windows 7. 回答1: From a machine you can access the internet you can either: Run cabal get pkg-name where pkg-name is the package you want. Go to the

How can I tell Cabal which dependency to use?

三世轮回 提交于 2019-12-21 12:19:37
问题 I'm trying to get Cabal to install the haskell-src-meta package, and I'm having difficulty with the template-haskell dependency. The dependencies for haskell-src-meta include both template-haskell >=2.7 && <2.9, template-haskell >=2.4 && <2.7, It so happens that template-haskell versions 2.7 and later will not install on my system, but template-haskell 2.5.0.0 will install. When I'm asking Cabal to install haskell-src-meta , how do I tell it to use template-haskell == 2.5.0.0 ? Here is the

Using alex/happy with Cabal

£可爱£侵袭症+ 提交于 2019-12-21 07:55:14
问题 I'm writing a compiler for a class I'm taking. The class isn't specifically Haskell but I'm using Haskell to write my compiler and interpreter. I have a cabal package setup to hopefully make it easy for my prof to run/compile. I have happy and alex in the build-tools field for both executables but Cabal ignores that and then complains that it cannot find the modules that Happy and Alex should be generating. If I manually run: alex LimpScanner.x happy LimpParser.y then cabal runs perfectly. I

How to set ghci options for cabal repl?

不想你离开。 提交于 2019-12-21 07:13:49
问题 I have a haskell project which I compile with -Werror by default. This means that when I run cabal repl it runs with the option -Werror turned on. This means that for example when I evaluate 2 + 2 I get the following error message: <interactive>:2:3: Warning: Defaulting the following constraint(s) to type `Integer' (Num a0) arising from a use of `+' In the expression: 2 + 2 In an equation for `it': it = 2 + 2 So I need a way to turn on the option, -w or maybe -Wwarn on by default for cabal

How do I use cabal's MIN_VERSION_ and other macros with ghci?

半腔热情 提交于 2019-12-20 10:23:48
问题 When I use Cabal's various MIN_VERSION_ macros in a Haskell project, how can I ensure they are all correctly defined when I am not using cabal, e.g. when testing in GHCi? 回答1: Nowadays, cabal supports a cabal repl subcommand, which does all the setup for you, so at least for ghci the following is unnecessary. Nevertheless: The cabal build command generates the file dist/build/autogen/cabal_macros.h , which contains all the definitions you need. In order to include that file in a ghc

Control.Monad.State found in multiple packages haskell

安稳与你 提交于 2019-12-20 09:16:03
问题 While evaluating the line "import Control.Monad.State" in a Haskell module, GHC gives me the following error: Could not find module `Control.Monad.State': it was found in multiple packages: monads-fd-0.0.0.1 mtl-1.1.0.2 Failed, modules loaded: none. How do I resolve this conflict? 回答1: You have several options. Either: ghc-pkg hide monads-fd . This will cause GHC and GHCi to ignore the presence of the monads-fd by default until you later ghc-pkg expose monads-fd , but software installed by

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

How to install `Hat`

佐手、 提交于 2019-12-20 02:54:53
问题 I am trying to get the Hat debugger. When I try: cabal install hat OR cabal install hat -v At the end I get: configure: error: in `/tmp/terminfo-0.4.0.0-17745/terminfo-0.4.0.0': configure: error: curses headers could not be found, so this package cannot be built See `config.log' for more details Failed to install terminfo-0.4.0.0 cabal: Error: some packages failed to install: haskeline-0.7.1.3 depends on terminfo-0.4.0.0 which failed to install. hat-2.8.0.0 depends on terminfo-0.4.0.0 which

Haskell hoogle installed through cabal, but hoogle command not found

不想你离开。 提交于 2019-12-19 19:41:02
问题 The hoogle (hoogle-4.2.36) installation process looks successful, except that when typing "hoogle" at the command line, it complains "hoogle: command not found". Tried this on two machines (both running MAC OS X Yosemite), they failed exactly the same way. Any suggestions to resolve this? Thanks! 回答1: Thanks to your information, I found my "hoogle" executable in ".cabal/bin". Alas, why doesn't cabal add it to PATH? 来源: https://stackoverflow.com/questions/27328678/haskell-hoogle-installed

How to get cabal to ignore the global package DB when using a sandbox

折月煮酒 提交于 2019-12-19 12:52:33
问题 I'm trying to install two libraries, Elm and yesod-platform , using a cabal sandbox on Ubuntu. The problem is, I'm using xmonad as my window manager. Thus, a bunch of Haskell libraries have been installed by my package manager. When trying to resolve dependencies, it's using the versions of the libraries installed by apt, and thus is giving a "maximum backjumps exceeded" error. How can I instruct Cabal to ignore any packages not in the Cabal sandbox, so that it will install fresh versinos of