cabal

Why cabal sandbox init does not change PATH like virtualenv does?

荒凉一梦 提交于 2019-12-03 12:37:40
Haskell newbie and Python guy here. I think I may be missing something here but if you look at Yesod's quickstart , the autor install some packages before cabal sandbox init . I have seen the same pattern elsewhere. Questions: Am I missing something? Is this the real way to use cabal sandbox? Why can't (or shouldn't) I install yesod-bin inside a sandbox? What if I use different versions of yesod-bin throughout some projects? If there is some libraries that install binaries inside .cabal-sandbox/bin, why cabal sandbox init don't change PATH in order to match the sandboxed version? Thank you

“cabal install cabal-install” doesn't update cabal version in OSX

荒凉一梦 提交于 2019-12-03 12:16:18
I'm a newbie to haskell and cabal, so I'm probably missing something simple. I updated cabal-install: sudo cabal install cabal-install Password: Resolving dependencies... Configuring cabal-install-1.22.0.0... Building cabal-install-1.22.0.0... Installed cabal-install-1.22.0.0 Updating documentation index However cabal --version says: cabal-install version 1.18.0.5 using version 1.18.1.4 of the Cabal library What happened to cabal-install 1.22.0.0? There are two ways of making cabal install packages globally. Note that, as a result, cabal may require sudo. This command will install <PACKAGE>

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

Where do QuickCheck instances belong in a cabal package?

时间秒杀一切 提交于 2019-12-03 10:02:35
I have a cabal package that exports a type NBT which might be useful for other developers. I've gone through the trouble of defining an Arbitrary instance for my type, and it would be a shame to not offer it to other developers for testing their code that integrates my work. However, I want to avoid situations where my instance might get in the way. Perhaps the other developer has a different idea for what the Arbitrary instance should be. Perhaps my package's dependency on a particular version of QuickCheck might interfere with or be unwanted in the dependencies of the client project. My

Haskell cabal: I just installed packages, but now the packages are not found

橙三吉。 提交于 2019-12-03 09:52:11
Over here is the only reason I can find that packages I'm installing using cabal are not being found by GHC: This happens when you install a package globally, and the previous packages were installed locally. Note that cabal-install install locally by default [...] Presumably, "local installation" means putting packages in ~/.cabal/ . First question: where are global installs? I've been running cabal using sudo , so I guess that's a global install? The reason I've been doing this is that it complains about permissions when run without sudo , so this contradicts the statement "cabal-install

How to link custom object file with Haskell library?

孤街浪徒 提交于 2019-12-03 09:33:00
I've created a Haskell package that makes FFI calls to functions defined in CUDA code. I'd like to compile .cu file to an object (.o) file during package build and force linker to link it in. So far, I tried to use a technique found this question . I've customized buildHook to: run nvcc run default buildHook create ar library file with nvcc compiled code. Setup.hs is available here . This solution has a major disadvantage in restricting this package to static linking. Although cabal produces a shared library, it won't work because it has no way of resolving symbols located in the object file.

Building with runtime flags using cabal and ghc

蹲街弑〆低调 提交于 2019-12-03 09:27:39
I have a program written in Haskell and intended to be compiled with GHC. The program scales very well on multiple cores, so enabling multithreading is very important. In my .cabal file I've added ghc-options: -O3 -threaded to link with the threaded runtime. The problem is that with this approach the user would need to run the program with foo +RTS -N , which seems a bit cryptic and not very user friendly. How can I tell cabal/ghc to enable those runtime flags invisibly to the user? I've read about --with-rtsopts , but GHC (7.0.3) just spits out unrecognized flag when I try to use it. The flag

Producing multiple executables from single project

那年仲夏 提交于 2019-12-03 08:32:27
问题 With the following project structure: src/FirstExecutable.hs src/SecondExecutable.hs my-amazing-project.cabal and the following cabal setup: name: my-amazing-project version: 0.1.0.0 build-type: Simple cabal-version: >=1.8 executable first-executable hs-source-dirs: src main-is: FirstExecutable.hs ghc-options: -O2 -threaded -with-rtsopts=-N build-depends: base == 4.5.* executable second-executable hs-source-dirs: src main-is: SecondExecutable.hs ghc-options: -O2 -threaded -with-rtsopts=-N

How to configure cabal in Windows 7?

…衆ロ難τιáo~ 提交于 2019-12-03 06:23:25
I have installed Haskell Platform 2012 in Windows 7. I write in the console cabal update and I take a message that there is a new version of cabal. I write cabal install cabal-install . After installation finishes it tells me that the cabal has been installed in C:\username\AppData\Roaming\cabal. So when I do cabal update again I am taking the same message that I have to install the new version of cabal. I have tried to change the cabal directory from the config file but cabal ignores the config file. Is Haskell working only on Unix? Thanks Mikhail Glushenkov The problem is that the cabal