cabal

How to use HUnit and Cabal to do Automated Testing?

自闭症网瘾萝莉.ら 提交于 2019-12-12 07:44:55
问题 I've been fighting with Cabal for a good portion of a day trying to make its automated testing features work with HUnit. I've read the documentation here and here, and I have my Test-Suite section set up like it shows, but whenever I try and build the package using cabal build Cabal says that the only Test-Suite type supported is exitcode-stdio-1.0 . What gives? 回答1: Background So here's the deal, the documentation on the cabal site is "future documentation," that is, not all of those

cabal install does not upgrade cabal

依然范特西╮ 提交于 2019-12-12 05:52:58
问题 I have upgraded cabal install (using a capital C for Cabal ) $cabal install Cabal cabal-install [...] Configuring cabal-install-1.24.0.2... Building cabal-install-1.24.0.2... Installed cabal-install-1.24.0.2 after a lengthy output in terminal, then I check that cabal has been updated, it hasn't changed $ cabal --version cabal-install version 1.22.6.0 using version 1.22.5.0 of the Cabal library I am looking for where the new installation of cabal might be $ which cabal /usr/local/bin/cabal $

Do I need Setup.hs file when creating Haskell projects?

99封情书 提交于 2019-12-12 05:36:46
问题 I use stack new <name> , then hpack-convert and add dependencies into package.yaml in order to skip ceremony and start writing Haskell code. Why is there's always a Setup.hs file? I don't use custom setups as far as I know. Will I need to include this file at some point? 回答1: I think it's just an old haskell convention that "Setup.hs" can be used to build the package, even for simple build types. Pretty sure it can be removed without having issues. 来源: https://stackoverflow.com/questions

Requiring sudo to run ghci on OSx

我与影子孤独终老i 提交于 2019-12-12 03:44:46
问题 I've installed the Haskell platform on my OSX (Yosemite). When I try to execute the ghci, the following error occurs: 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 ... <command line>: can't load .so/.DLL for: libiconv.dylib (dlopen(libiconv.dylib, 9): image not found) If I execute using sudo (sudo ghci), it runs normally. The same behavior occurs with cabal. I

difficulties installing iHaskell

僤鯓⒐⒋嵵緔 提交于 2019-12-11 19:09:06
问题 After much difficulty with cabal install ihaskell I read If you have trouble with this installation, please make sure to try the Github version first. IHaskell is in rapid development, so Hackage may not always be the most recent. In order to install from Github, pull from the repository, and then install with ./build.sh all This morning I upgraded to ghc-7.8.4 and cabal-1.22 and I am downloading iHaskell from the github repository using a simple git clone . It is having difficulting locating

“invalid preprocessing directive” when installing memoize

我是研究僧i 提交于 2019-12-11 14:01:59
问题 I try running: cabal install memoize in the Terminal but all I get is: 11 warnings and 1 error generated. Failed to install memoize-0.6 cabal: Error: some packages failed to install: memoize-0.6 failed during the building phase. The exception was: ExitFailure 1 The 1 error is: Data/Function/Memoize/TH.hs:5:6: error: invalid preprocessing directive #-} ^ 来源: https://stackoverflow.com/questions/23595173/invalid-preprocessing-directive-when-installing-memoize

How can I have a conditional on cabal?

做~自己de王妃 提交于 2019-12-11 10:19:58
问题 I have a Haskell library which exports several modules. I compile that library with both GHC and GHCJS . I'm using stack to build the library. One of those modules depends on reflex-dom . The issue is that I am not able to compile reflex-dom on GHC due to not being able to link gtk+3 on OSX. As such, I'd like to exclude that library if the compiler is GHC . How can I achieve that? exposed-modules: MyLib.Foo MyLib.Bar MyLib.App.Backend.Reflex MyLib.App.Backend.Gloss ... build-depends: base ...

Where do I find (and run) an executable compiled with a cabal sandbox?

一个人想着一个人 提交于 2019-12-11 05:19:53
问题 I'm compiling my myProgram.lhs with the use of a cabal sandbox (set up with cabal sandbox init ). I'm using a simplest approach I've come up with: cabal exec -- ghc myProgram or (having a rule in Makefile ) cabal exec -- make myProgram After that, in my source directory, appears myProgram.o , but not the executable myProgram . How do I run the resulting program? cabal exec -- ./myProgram doesn't work. Now, I've come up with a simplest approach to test it: cabal exec -- runghc myProgram.lhs

haskell cabal sandbox how to install packages?

夙愿已清 提交于 2019-12-11 04:35:28
问题 I wish if someone tells me the steps required to install gloss-examples in a sandbox along with all its dependencies. Here is what I tried to do: I downloaded the gloss-examples package from hackage. When I ran the command, after changing into the ~/gloss/gloss-examples-1.9.4.1 ~/gloss/gloss-examples-1.9.4.1$cabal sandbox init it succeeded, so I issued the command ~/gloss/gloss-examples-1.9.4.1$cabal install --only-dependencies but then I got the following errors: Resolving dependencies...

Why do I have to remove `ekg` from build-deps for haskell stack/cabal to find my dll on Windows?

大憨熊 提交于 2019-12-11 04:12:30
问题 I'm building a Haskell 7.10 project that depends on tdsodbc.dll, using stack v1.7.1 on Windows, everything 64-bit. I have tdsodbc.dll in the lib folder of the project, and extra-lib-dirs: lib and extra-libraries: tdsodbc in the .cabal. But when I compile, I get Missing C library: tdsodbc when stack runs cabal configure . I've tried putting extra-lib-dirs: [lib] in stack.yaml , and I can see from that configure command that it has put --extra-lib-dirs=C:\Users\Kevin\src\theproject\lib on the