cabal

Current state of integrating unit tests with Haskell's Cabal?

╄→гoц情女王★ 提交于 2019-12-02 17:12:28
When i google for how to integrate unit tests with cabal files, i either find http://www.haskell.org/haskellwiki/How_to_write_a_Haskell_program which does not seem to describe the integration of HUnit/QuickCheck with the Cabal file or i see messages like "wait for Cabal x.y which will support cabal test" but i can not find any documentation for this either How would you run all unit test using cabal (for example everytime i do a "cabal build") today? tibbe Make sure you have the latest version of Cabal and cabal-install installed. Have a test-suite section in your .cabal file. See this section

cabal install cabal-install errors out on linux

a 夏天 提交于 2019-12-02 08:23:41
问题 Am using linux (centos 6.6).When I try to run cabal install cabal-install command am getting following errors cabal: cannot configure unix-2.7.0.1. It requires base >=4.5 && <4.8 For the dependency on base >=4.5 && <4.8 there are these packages: base-4.5.0.0, base-4.5.1.0, base-4.6.0.0, base-4.6.0.1, base-4.7.0.0 and base-4.7.0.1. However none of them are available. base-4.5.0.0 was excluded because base-4.3.1.0 was selected instead base-4.5.0.0 was excluded because of the top level

Haskell environment hosed post reinstall

∥☆過路亽.° 提交于 2019-12-02 03:07:33
I've recently reinstalled my Haskell environment as I thought I had hosed it beyond recovery after updating my Mac OS X to Mavericks. Now every time I run cabal install cabal-install , I get the following error. Resolving dependencies... Configuring cabal-install-1.18.0.3... /var/folders/4l/qbdvy5xj4q53skv0zn0lhw940000gp/T/8247.c:1:12: warning: control reaches end of non-void function [-Wreturn-type] int foo() {} ^ 1 warning generated. Building cabal-install-1.18.0.3... Preprocessing executable 'cabal' for cabal-install-1.18.0.3... Main.hs:118:8: Could not find module `Distribution.Version'

How to install `Hat`

对着背影说爱祢 提交于 2019-12-02 01:41:23
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 failed to install. terminfo-0.4.0.0 failed during the configure step. The exception was: ExitFailure 1

export haskell module with different hierarchy

一世执手 提交于 2019-12-02 01:26:09
问题 In Haskell, modules name and file name containing the module have to be the same. The problem is is not only the file name but the includes the all path, so you have (AFAIK) to create a directory structure matching the module hierarchy, which is a bit annoying. For example, let's say that I'm writing a datatype D in a module M which I think should be in Database . The module name should be Database.M.T . As my main directory is already called M (the name of the package) I end up with the

Why is `stack build` altering my .cabal file?

删除回忆录丶 提交于 2019-12-01 22:28:20
I am attempting to build a project which uses Euterpea . Running stack build I get the following error, suggesting that I need to add Euterpea to the build-depends section of my .cabal file. $ sb composition-0.1.0.0: build (lib + exe) Preprocessing library composition-0.1.0.0... [2 of 2] Compiling Lib ( src/Lib.hs, .stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/build/Lib.o ) /home/matthew/backup/composition/composition/src/Lib.hs:5:1: error: Failed to load interface for ‘Euterpea’ It is a member of the hidden package ‘Euterpea-2.0.4’. Perhaps you need to add ‘Euterpea’ to the build-depends

cabal sandbox v. global package db

时光怂恿深爱的人放手 提交于 2019-12-01 22:17:53
When installing inside a cabal sandbox, cabal will still use packages from the global package db (in particular, packages which came from the Haskell Platform). This can lead to install conflicts. Is it possible to configure cabal to ignore the global package db? I see the corresponding feature has been implemented in ghc itself, via a -no-global-package-db option (see https://ghc.haskell.org/trac/ghc/ticket/5977 ), and ghc-pkg will ignore the global package db if you do not pass it the --global flag. Is there a way to configure cabal similarly? Also, there's a closed issue against cabal

cabal sandbox v. global package db

蓝咒 提交于 2019-12-01 22:00:35
问题 When installing inside a cabal sandbox, cabal will still use packages from the global package db (in particular, packages which came from the Haskell Platform). This can lead to install conflicts. Is it possible to configure cabal to ignore the global package db? I see the corresponding feature has been implemented in ghc itself, via a -no-global-package-db option (see https://ghc.haskell.org/trac/ghc/ticket/5977), and ghc-pkg will ignore the global package db if you do not pass it the -

export haskell module with different hierarchy

浪子不回头ぞ 提交于 2019-12-01 21:52:37
In Haskell, modules name and file name containing the module have to be the same. The problem is is not only the file name but the includes the all path, so you have (AFAIK) to create a directory structure matching the module hierarchy, which is a bit annoying. For example, let's say that I'm writing a datatype D in a module M which I think should be in Database . The module name should be Database.M.T . As my main directory is already called M (the name of the package) I end up with the following directory structure : M: | +-- Database: | +-- M: | + A.hs Is that possible to just do : M: | + A

How to use detailed-0.9 in cabal testing

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 18:28:41
问题 I'm having a surprising amount of difficulty getting the unit tests to run under cabal. I've copied the test code verbatim from the cabal documentation, with the exception of changing the module name {-# LANGUAGE FlexibleInstances #-} module Test.Integral ( tests ) where import Distribution.TestSuite instance TestOptions (String, Bool) where name = fst options = const [] defaultOptions _ = return (Options []) check _ _ = [] instance PureTestable (String, Bool) where run (name, result) _ |