FAQ Database Discussion Community


Can't find defaultTimeLocale in Data.Time.Format

haskell,cabal
According to the doc on Hackage, Data.Time.Format exposed defaultTimeLocal. However, when I try to use it, it doesn't exits. When I look at the code, it doesn't seems to be exposed either (if I generate the doc from the source, I don't see this defaultTimeLocale). Is it because it needs...

Cabal fetch dependencies for current package

haskell,cabal
I wrote a package that I am trying to build. For reasons, I do not want to install it on my laptop. I want to download all of its dependencies and install it on another computer. How can I do that? If I run $ cd my-package $ cabal fetch...

Issue using Hoe from cabal sandbox - System.Random not found

haskell,cabal
I'm trying to use the Hoe utility from a cabal sandbox and am presented with the following error: [email protected] ~/Haskell-Sandboxes/hoe-1.0.1 ./.cabal-sandbox/bin/hoe head compile error: <no location info>: Could not find module ‘System.Random’ Use -v to see a list of the files searched for. I believe that this is due to...

Cabal fails to install dependencies, but can install them if asked directly

haskell,cabal,cabal-install
I've seen a very strange recurring problem with Cabal that's interfering with my ability to get repeatable Haskell builds. I have a cabal project with a sandbox. If I do cabal install, I get errors of the form Y failed during the building phase. The exception was: ExitFailure 1 X...

Invoke the functions in the library built from cabal in Haskell

haskell,cabal
From the book Beginning Haskell, I learned that I can build a package from cabal setup file (chapter2.cabal). The source is downloadable from http://www.apress.com/downloadable/download/sample/sample_id/1516/ For example, this is an example of the Cabal file from Section 2 example. name: chapter2 version: 0.1 cabal-version: >=1.2 build-type: Simple author: Alejandro Serrano library...

why is the cabal sandbox inited after installing yesod-bin?

cabal,yesod
On the Yesod homepage (http://www.yesodweb.com/page/quickstart) the following installation sequence is suggested: wget http://www.stackage.org/lts/cabal.config cabal update # download package list cabal install alex happy yesod-bin # install build tools yesod init --bare # answer questions as prompted cabal sandbox init # set up a sandbox cabal install --run-tests # install libraries...

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

haskell,sandbox,cabal,package-managers
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...

issues with installing newer cabal version for haskell vim now

ubuntu,haskell,vim,ubuntu-14.04,cabal
I would like to install this vim plugin: https://github.com/begriffs/haskell-vim-now When trying to run the suggested installation script: curl -o - https://raw.githubusercontent.com/begriffs/haskell-vim-now/master/install.sh | bash I get: --- Cabal version 1.18 or later is required. Aborting. I then try to install a newer version of cabal: [email protected]:~/Downloads/cabal-install-1.22.6.0$ ./bootstrap.sh The response I get:...

Progress messages not appearing with cabal install for some users

haskell,configuration,ghc,cabal,cabal-install
I'm working on a team project using Haskell and whenever I compile our project using 'cabal install' I start seeing the following: $ cabal clean && cabal install cleaning... Resolving dependencies... Configuring hackathon-0.1... Building hackathon-0.1... Preprocessing executable 'hackathon' for hackathon-0.1... [ 1 of 65] Compiling Data.MaybeUtil ( src/Data/MaybeUtil.hs, dist/dist-sandbox-52369b17/build/hackathon/hackathon-tmp/Data/MaybeUtil.o )...

bytestring-lexing-0.4.3.2 failed during the configure step

haskell,cabal
cabal install hedis This failed due to its dependency - bytestring-lexing not getting installed. The error message is, bytestring-lexing-0.4.3.2 failed during the configure step. The exception was: ExitFailure 1 hedis-0.6.5 depends on bytestring-lexing-0.4.3.2 which failed to install. To reason why this package failed, I grep-ed for local installations of bytestring-lexing...

wxc-0.91.0.0 failed to install

haskell,wxwidgets,cabal,reactive-banana
I'm trying to install reactive-banana, wx, wxcore in cabal sandbox. When cabal install --only-dependencies is run following error message is given: src\cpp\eljlistctrl.cpp: In function 'int ListCmp(long int, long int, long int)': src\cpp\eljlistctrl.cpp:16:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] src\cpp\eljlistctrl.cpp:16:53: warning: cast to pointer from integer of...

Can't update cabal from 1.16 to 1.18

haskell,cabal,cabal-install
I have cabal 1.16 installed and trying to update: [email protected]:~# cabal --version cabal-install version 1.16.0.2 using version 1.16.0 of the Cabal library Trying to update: [email protected]:~# sudo cabal install --global cabal-install cabal: There is no package named 'cabal-install'. You may need to run 'cabal update' to get the latest list...

Distribute a closed source haskell module [closed]

haskell,ghc,cabal,proprietary
Is it possible to distribute a Haskell binary module with Cabal without giving the source code ? If it is possible : What would be the files to include in the package ? What would be the precautions to take about the compiler options, compatible versions, ... ? Will the...

Access test resources within Haskell tests

haskell,integration-testing,cabal
This is probably a basic question but I've been Googling for a while on it... I have a Cabal-ized Haskell project and I'm in the process of writing integration tests for it. I want to be able to include test resources for my project in the same repo and access...

Cabal sandbox is using a global dependency. Could not resolve

haskell,cabal
I'm trying to add timerep onto an existing application. I can't get it to resolve my dependencies. It looks like it is using the globally installed version of time == 1.4.2, when >= 1.5 would be ideal for my application. How can I get cabal to use time 1.5? I've...

ghci won't interpret file but cabal build succeeds?

haskell,compilation,cabal,ghci
When I load a certain file in ghci / cabal repl, I get the following error message: No instance for (Control.Monad.Trans.Class.MonadTrans (EitherT Error)) arising from a use of ‘lift’ However, EitherT a is definitely an instance of MonadTrans; it's part of the package. cabal build succeeds; too. It seems ghci...

Force GHC using local files

haskell,build,ghc,cabal
I'm making some "experiments" on a haskell module and I have a problem with a source file I wish to modify. I have many reasons to think that GHC seek the installed (with cabal) library on my system and not the local sources files. I deleted the *.o files locally...

How to work with Cabal API

haskell,cabal
I would like to "interact" with Cabal during the test phase (like exitcode-stdio-1.0) using the relative API (https://www.haskell.org/cabal/release/cabal-latest/doc/API/Cabal/Distribution-Simple-Test-ExeV10.html) to customise for example the final output. How can I do that? I cannot find the right documentation.

Cabal build failure on ReadArgs when deploying to OpenShift

haskell,openshift,cabal,yesod
I am trying to deploy a web application to OpenShift. My app is written with Yesod web framework. I would like to use the Yesod cartridge from Haskell wiki. I can create the application and deploy the example supplied with the cartridge. However, when I add more dependencies to the...

unreadable quickcheck log file after a test routine

haskell,character-encoding,cabal,quickcheck
I made a test routine for a Haskell program with quickcheck. I declared it in my cabal file with : Test-Suite routine_de_test Type: exitcode-stdio-1.0 Hs-Source-Dirs: test Main-is: Tests.hs and launched it with : cabal configure --enable-tests cabal buil cabal test The tests are processed correctly and I was expecting to...

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

haskell,testing,compilation,executable,cabal
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,...

cabal sandbox with stackage

haskell,cabal,stackage
I want to point my global cabal config to use stackage LTS only. Does cabal sandbox provide any value in that case? As I understand there should be no cabal hell anymore as all projects will use a predetermined set of package that are guaranteed to build together. Is there...

Haskell/Alex: Warning: Tab character

haskell,cabal,alex
I'm writing a toy language in haskell. I'm using Alex to generate a scanner. Every time I build my project with cabal, I get the following warnings: dist/build/optimiser/optimiser-tmp/Lexer.hs:465:1: Warning: Tab character dist/build/optimiser/optimiser-tmp/Lexer.hs:466:1: Warning: Tab character dist/build/optimiser/optimiser-tmp/Lexer.hs:467:1: Warning: Tab character dist/build/optimiser/optimiser-tmp/Lexer.hs:471:1: Warning: Tab character dist/build/optimiser/optimiser-tmp/Lexer.hs:472:1: Warning: Tab character (plus about 10...

My installed transformers version is not considered by cabal-install

haskell,cabal,cabal-install,stackage
I am totally new to Haskell an cabal and I'm trying to make yesod work. My cabal version is cabal-install version 1.20.0.3 using version 1.20.0.2 of the Cabal library This is what happends when I tru to install alex: $ cabal install alex Resolving dependencies... cabal: Could not resolve dependencies:...

Cabal and HPC and Errors when Running Tests with Code Coverage

haskell,cabal
I use Cabal to run my tests. Here is how it is configured in the .cabal file: test-suite test type: exitcode-stdio-1.0 main-is: Test.hs build-depends: base >= 4.7 && < 4.8, containers >=0.5 && <0.6, ghc, test-framework >=0.8 && <0.9, QuickCheck >=2.7 && <2.8, HUnit >=1.2 && <1.3, test-framework-hunit, test-framework-quickcheck2 default-language:...

“Could not find module ‘Test.HUnit’” Error when executing Haskell's unittest (HUnit) in CodeRunner

haskell,cabal,hunit,coderunner
I have simple unit test code for Haskell's HUnit. I use Mac OS X 10.10, and I installed HUnit with cabal install hunit. module TestSafePrelude where import SafePrelude( safeHead ) import Test.HUnit testSafeHeadForEmptyList :: Test testSafeHeadForEmptyList = TestCase $ assertEqual "Should return Nothing for empty list" Nothing (safeHead ([]::[Int])) testSafeHeadForNonEmptyList...

Do I have to repeat all dependencies in the test configuration?

haskell,cabal
This bugs me time and again, basically if I create a test-suite in the cabal configuration I add the projects src folder to the test suites hs-source-dirs section and repeat all dependencies in build-depends. A typical project might look like: -- in file "foo.cabal" library build-depends: a, b, c exposed-modules:...

For cabal, what does only-dependencies flag mean?

haskell,cabal
I'm fairly new to Haskell, and upon seeing this flag, e.g. in this dockerfile, I can't ever seem to find an explanation for what it does. "Install only the dependencies necessary to build the given packages," in the cabal help install doesn't say much to me. If I'm not building...

What is haskellng? What is the difference between 'haskellPackages' and 'haskellngPackages'?

haskell,cabal,cabal-install,nix,haskell-ng
I have been reading this StackOverflow post in which we are advised to use the haskellng package set. I have also read this but I did not understand what haskellng is. I have read this too, but I still don't know what haskellng is. Could someone please explain what haskellng...

Add local files to haskell libraries search path

haskell,cabal
I am running Examples/Producer.hs from the hafka project. It throws error as, Could not find module ‘Network.Kafka.Producer’ Library file Network.Kafka.Producer is sitting in my local repository and not inside default library paths (/home/user/.cabal). How can i add this local file system path to the Cabal/Haskell library? In python terms, this...

Fail to install Hackage string-conversions

haskell,install,cabal,cabal-install,hackage
Problem I was installing the Hackage string-conversions. However, it fails with the error below. Error Log Configuring string-conversions-0.3.0.3... Building string-conversions-0.3.0.3... Preprocessing library string-conversions-0.3.0.3... [1 of 1] Compiling Data.String.Conversions ( Data/String/Conversions.hs, dist/build/Data/String/Conversions.o ) In-place registering string-conversions-0.3.0.3... Creating package registration file: /tmp/pkgConf-string-conversions-0.3.011675.3 cabal: Error: some packages failed to install:...

cabal install d3js error

haskell,cabal
I got an error when installing d3js. I'm using ghc-7.8.3, cabal-1.22, debian Wheezy. # cabal install d3js Resolving dependencies... cabal: Could not resolve dependencies: trying: d3js-0.1.0.0 (user goal) next goal: base (dependency of d3js-0.1.0.0) rejecting: base-4.7.0.1/installed-1a5... (conflict: d3js => > base>=4.6 && <4.7) rejecting: base-4.8.0.0, 4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1, 4.6.0.0,...