cabal

Cabal: build dir with source

社会主义新天地 提交于 2019-12-08 14:39:40
问题 I have a src directory. In this directory I have Main.hs file and Test directory. In the Test directory I have Test.hs module. I need to compile it with cabal. In my cabal file I have: Executable main -- .hs or .lhs file containing the Main module. Main-is: src/Main.hs and -- Modules not exported by this package. Other-modules: Test.Test When I do cabal configure it's OK, but when I try to cabal build I get the following error: cabal build Preprocessing executables for main-0.0.1... cabal:

GHC cannot find libraries on fresh install of Haskell-Platform

我的未来我决定 提交于 2019-12-08 07:24:50
问题 I'm trying to learn how to use Haskell, but I've run into a little roadblock. I'm using MacOSX 10.12.6 and installed Haskell Platform using: $ brew cask install haskell-platform with no modifications. When I try to compile a program with parsec imported, Haskell-Platform can't find it: $ ghc -v test.hs ... package parsec-3.1.11-DPgnR92AWEaFOaixmwipet is unusable due to shadowed dependencies: mtl-2.2.1-19EL8AGBsN3DnnOhrC9xY3 text-1.2.2.2-EGUst8sqNAZCw1xLPcmcMH ... test.hs:2:1: error: Could not

Installing SDL on Windows for Haskell (GHC)

百般思念 提交于 2019-12-08 06:15:17
问题 Background: I've been using the gloss library for some simple diagram work. But when it came time for something more interactive, I found I wanted a more powerful library. After doing some research, I decided that I liked the features of the SDL library and wanted to try to install the Haskell bindings for it. I have to this point been unsuccessful. Part 1: How do I install and configure the SDL binaries so that they can be used by the Haskell bindings? Part 2: Which one of the numerous and

Installing SDL on Windows for Haskell (GHC)

百般思念 提交于 2019-12-08 03:08:30
Background: I've been using the gloss library for some simple diagram work. But when it came time for something more interactive, I found I wanted a more powerful library. After doing some research, I decided that I liked the features of the SDL library and wanted to try to install the Haskell bindings for it. I have to this point been unsuccessful. Part 1: How do I install and configure the SDL binaries so that they can be used by the Haskell bindings? Part 2: Which one of the numerous and ill documented SDL packages on Hackage it the current preferred binding in the community? How do I get

Why does stack not pass my ghc-options to the compiler?

空扰寡人 提交于 2019-12-07 17:54:05
问题 In the cabal file I specify the GHC options -Wall and -O2 : name: Test version: 0.1.0.0 build-type: Simple cabal-version: >=1.8 executable Test hs-source-dirs: src main-is: Test.hs build-depends: base >=4.8 && <4.10 ghc-options: -Wall -O2 When I compile the program Test.hs: data Color = Red | Green | Blue foo :: Color -> Int foo Red = 0 foo Green = 1 -- foo Blue is intentionally missing!! I get the error: Preprocessing executable 'Test' for Test-0.1.0.0... [1 of 1] Compiling Main ( src/Test

How do I get Cabal to bypass my Windows proxy settings?

流过昼夜 提交于 2019-12-07 11:26:03
问题 When retrieving packages with Cabal, I frequently get errors with this message: user error (Codec.Compression.Zlib: premature end of compressed stream) It looks like Cabal is using my Windows Networking proxy settings (for Privoxy). From digging around Google, Cabal or its libraries appear to have (had) a problem in this area. Possible solutions I can see are: Turn off proxying while using Cabal (not very keen on this one); or Get a patch and start hacking. I'm hesitant to go down this path,

Installed parsec in sandbox, but can't find libraries when trying to load file in ghci

℡╲_俬逩灬. 提交于 2019-12-07 08:20:50
问题 tl;dr: installed library with cabal sandbox, ghci still complains that the library is missing I have a directory where I am developing some Haskell stuff. This used to work fine on another computer, with ghc 7.6, but now that I'm working on another computer with ghc 7.8.2 (I don't know if the version would matter) I get errors like this: Prelude> :l Interpreter.hs Parser.hs:9:8: Could not find module ‘Text.ParserCombinators.Parsec’ Perhaps you meant Text.ParserCombinators.ReadPrec (from base)

cabal can't use http proxy

橙三吉。 提交于 2019-12-07 06:18:21
问题 My Linux(redhat6) server has to use http proxy to connect to outside world. While it works for other things like wget, it doesn't work for cabal. cabal update -v3 shows errors like this: 407 - proxy authentication required cabal: Failed to download http://hackage.haskell.org/packages/archive/00-index.tar.gz : ErrorMisc "Unsucessful HTTP code: 407" I tried to change http_proxy environment variable to format like http:// user: passwd at proxy:port, but it doesn't work either. The same problem

How to install cairo on Windows

被刻印的时光 ゝ 提交于 2019-12-06 21:45:48
问题 For the life of me I can't figure out how to install cairo on Windows! I need it for Haskell Charts, but when I follow setup instructions and get to running: cabal install gtk I get this error: Linking dist/setup-wrapper\setup.exe ... Configuring glib-0.12.2... setup.exe: The program pkg-config version >=0.9.0 is required but it could not be found. cabal.exe: Error: some packages failed to install: cairo-0.12.2 failed during the configure step. The exception was: ExitFailure 1 gio-0.12.2

Configuring cabal on Max OS X 10.9

[亡魂溺海] 提交于 2019-12-06 17:25:17
When I run cabal install Cabal cabal-install I have this warning: Warning: The directory /Users/arthurfayzrakhmanov/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.18.0.2/bin is not in the system search path. Looks like something misconfigured, because I saw similar message when I've installed happy , but it pointed to /Users/arthurfayzrakhmanov/Library/Haskell/ghc-7.6.3/lib/happy... . How should I configure cabal on OS X 10.9.1, I mean PATH and etc. Open your ~/.bash_profile with any editor you're comfortable with Append this to the file: export PATH="$HOME/Library/Haskell/ghc-7.6.3/lib/cabal