How are these GHC options getting into my stack build?

I'm seeing the following, at the end of a "stack build foo": Progress: 1/2 -- While building package foo-0.1.0.0 using: [path-to-GHC] --builddir=[path-to-stack-work-area] build lib:foo --ghc-options " -ddump-hi -ddump-to-file" Process exited with code: ExitFailure 1And I can't figure out how those options: -ddump-hi and -ddump-to-file, are getting into my stack build flow. I can't find them in:stack.yaml,foo.cabal, orfoo.hsDoes anyone know where they're coming from?...Read more

ghc - Cabal install ignores a package in build-depends and then requests for it

Using cabal I'm trying to install iserv-proxy, it's build depends on libiserv and I've installed it before. when I issue install command: ghc/utils/iserv-proxy$ cabal install -flibrary -fproxyit fails with: src/Main.hs:53:1: error:Could not load module `Remote.Message'It is a member of the hidden package `libiserv-8.6.3'.Perhaps you need to add `libiserv' to the build-depends in your .cabal file.Use -v to see a list of the files searched for. |53 | import Remote.Message | ^^^^^^^^^^^^^^^^^^^^^as the error says, the Remote.Message is an ex...Read more

ghc - List concatenation using foldl', foldr

I'm learning Haskell now and I'm facing the following problem:I want to rewrite the ++ function using foldl' and foldr. I've done it with foldr:myConcat xs ys = foldr (:) ys xsI can't do it using foldl'. I've read in RealWorldHaskell that foldr is useful for doing this kind of thing. Ok, but can't I also write an equivalant to ++ using foldl? Can someone show me how I can do this (if it can be done... The book doesn't mention anything about it)...Does Haskell's type mechanism prevent me from doing this? Every time I tried I got a type error......Read more

How does stack determine which ghc to use?

My in-path ghc version is 8.4.4, as show by running $ ghc -- version.$ ghc --versionThe Glorious Glasgow Haskell Compilation System, version 8.4.4.Somehow, however, my stack is using a different version, as shown by running $ stack ghc -- --version.$ stack ghc -- --versionThe Glorious Glasgow Haskell Compilation System, version 8.0.2.I have no idea where the 8.0.2 of ghc is even installed on my system. How is this possible, and how can I update the version of ghc my stack uses?...Read more

Why is the GHC version not as expected when building with stack nightly?

What goes into determining the GHC version when using stack?I thought this would be the resolver but...I have the following stack file:resolver: nightly-2018-07-10packages:- .This is what is on Stackage:Stackage Nightly 2018-07-10 (ghc-8.4.3)Published on 2018-07-10View changesstack resolver: nightly-2018-07-10 Then I build:$ stack clean$ stack buildBuilding all executables for `PyrethrumPre' once. After a successful build of all of them, only specified executables will be rebuilt.PyrethrumPre-0.1.0.0: configure (exe)Configuring PyrethrumPr...Read more

ghc - Cabal-install error: /usr/bin/ld cannot find -lHSparsec-3.1.7-ghc7.8.3

I have an old version of cabal-install so I downloaded cabal-install 1.20 and When installing it errors out.Additional note: ghc 7.8.3OS: CentOS 6.6Error:Building network-2.4.2.3......................usr/bin/ld: cannot find -lHSparsec-3.1.7-ghc7.8.3collect2: ld returned 1 exit statuserror during cabal-install bootstrap:building the network package failed.When I try to run "cabal install network-2.5.0.0",getting following errorsroot@gains: cabal install network-2.5.0.0Resolving dependencies...Configuring network-2.5.0.0...configure: WARNING: unr...Read more

alpine - How to build a cross compiler of GHC in Alpinelinux?

I have done following steps in Alpinelinux v3.9 x86_64 and got error.Run bootstrap.sh in aport to get aarch64-alpine-linux-musl-* tools.Build and install llvm6 in x86_64.Link all aarch64-alpine-linux-musl-* to aarch64-unknown-linux-*.Configure ghc 8.6.3 only with "--target=aarch64-unknown-linux".Configure completed successfully. Building GHC version : 8.6.3 Git commit id : 31cd867e4d37072c3ce1d51efadc94e66ddc1c28 Build platform : x86_64-alpine-linux Host platform : x86_64-alpine-linux Target platform : aa...Read more

How can I test a new ghc build against stackage

I've built ghc-HEAD and I want to try building all of a stackage lts or nightly to see how much it can do.Nothing I say can convince stack to build anything using my new ghc. I try setting up like:stack setup 8.1.20160209 --ghc-variant=aarch64-HEAD --ghc-bindist=https://s3-us-west-1.amazonaws.com/stack-aarch64/ghc-8.1.20160209-aarch64-unknown-linux.tar.xzAnd then I download an lts config.cabal and copy all of the packages into my.cabal file. This is all that's necessary to build everything with a regular ghc. I saystack install --ghc-variant=aa...Read more

c - Fetch-and-add ordering

I'm working on replacing the allocation system for "stable pointers" in the ghc runtime system, and I'm running up against the limits of my understanding of concurrent programming.Suppose a variable contains 0. Thread A uses __atomic_fetch_and_add to increment the variable and notifies thread B in some fashion. In response, thread B uses __atomic_fetch_and_add to decrement the same variable, bringing it back to 0. So it seems the variable should go from 0 to 1 and back. Is it guaranteed that another thread C will not see the additions performed...Read more

What are the differences between runghc and ghc?

What are the differences between runghc and ghc?I ran a short program that seemed to compile fine with both, except that I got the following with runghc, but not plain ghc: error: Variable not in scope: main :: IO a0 Perhaps you meant `min' (imported from Prelude) It seems that compiling things in runghc, those things need Main function, while plain ghc, doesn't?Is that all?...Read more

ghc - Tell cabal-install not to build in /tmp

I am getting exit 1 errors from ld when attempting to cabal install hindent (the actual failing package is haskell-src-exts). By using sudo alternatives --config ld to select the gold linker, and then trying again, I was able to get a more meaningful error message: No space left on device. Turns out cabal install attempts to build projects in /tmp, which, on my machine, is a ramdisk that is not very large. How can I tell it to build projects elsewhere?...Read more

cabal install djinn-lib with GHC 8.4?

I'm trying to install djinn-lib with GHC 8.4.1 (from Ubuntu 16.04 apt-get). $ cabal install djinn-libBut I get an error about ambiguity in the <> operator as shown at the bottom. Does anyone know how to go about fixing it?The cabal version I used was:$ cabal --versioncabal-install version 2.2.0.0compiled using version 2.2.0.0 of the Cabal libraryThe error message is:$ cabal install djinn-libResolving dependencies...Configuring djinn-lib-0.0.1.2...Preprocessing library for djinn-lib-0.0.1.2..Building library for djinn-lib-0.0.1.2..[1 of 4]...Read more

ghc - How do I install earlier versions of Haskell Platform and switch between them?

I have installed this https://www.haskell.org/platform/#linux-generic Haskell Platform. The problem is it comes with ghc version 8.2.1.How do I install an earlier version of Haskell Platform so that I can use older, bug-free ghc if I need it?I can see prior versions available.https://www.haskell.org/platform/prior.htmlSo the question remains, how do I make them peacefully coexist on my system?activate-hs doesn't seem to work, so please tell me how do I switch defferent Haskell Platforms?Just installing the Haskell platform has updated the links...Read more

ghc - Cannot start with bnfc

I'm following a short bnfc example, to generate an haskell parser. When I launch the make command I get these errors:latex DocCalc.tex; dvips DocCalc.dvi -o DocCalc.ps/bin/sh: 1: latex: not found/bin/sh: 1: dvips: not foundmake: *** [all] Error 127I don't have latex installed, neither divps (what is the last?). So I removed the line:latex DocCalc.tex; dvips DocCalc.dvi -o DocCalc.psin the make file, because I don't know exactly the names of the needed packages to install, and because I don't need documetation files. So I relaunch the make comma...Read more