How do Haskell compilers decide whether to allocate on the heap or the stack?

Haskell doesn't feature explicit memory management, and all objects are passed by value, so there's no obvious reference counting or garbage collection either. How does a Haskell compiler...

Compiling Haskell "Hello World" on Mac Snow Leopard - crt1.10.5.o not found

Just trying to compile some trivial Haskell, but its not finding the c runtimes, despite the fact that they're right there: $ cat hello_world.hs main = putStrLn "hello, world" $ ghc --make...

What is Weak Head Normal Form?

What does Weak Head Normal Form (WHNF) mean? What does Head Normal form (HNF) and Normal Form (NF) mean? Real World Haskell states: The familiar seq function evaluates an expression to what we...

Headless Browser and scraping - solutions

I'm trying to put list of possible solutions for browser automatic tests suits and headless browser platforms capable of scraping. BROWSER TESTING / SCRAPING: Selenium - polyglot flagship in...

How to install a package using stack?

Using cabal, I could install hakyll with the command: cabal install hakyll How can I do the same thing using stack?

How can packages be unhidden when using only stack?

I'd like to try out the Writer monad in ghci. As advised here, I tried to use only stack to manage GHC and packages, and avoid a global installation. From a fresh Ubuntu 15.04 install, after...

Stack (Haskell) throws TlsException in Windows

Stack (under Windows) sometimes throws the following exception when trying to download files (e.g., during stack setup or while downloading a build plan): TlsException (HandshakeFailed...

Haskell: IO [String] to [String]

Now this is a thread that has been through Stack Overflow a lot. This also is covered by other sites but I still can't wrap my head around it fully. I've read different stuff from this site, I'm...

How to clean up an interrupted Homebrew install?

I recently decided to brew install stack, the Haskell package manager, but changed my mind midway and interrupted with ctrl+c. It looks like a reasonable amount of storage has been taken up on my...

Haskell stack and version control

I'm new to Haskell and Stack. When creating a new project using stack new which files should be checked in to git (or any other VCS)? The whole dir?

Encountering error while adding MaybeT dependency in stack project

I am following this tutorial webScraper using HXT. I am using Stack here. While adding dependency for MaybeT, it asked to: Recommended action: try adding the following to your extra-deps in...

Adding a library a Haskell Project

I am going through some of the Haskell exercises in exercism. I have reached a point where I need to include a library in my project. But to be more clear I would like to include the library...

Installing IHaskell kernel for jupyter notebooks -lgmp cannot be found by Linker

I'm trying to install IHaskell in jupyter, directly from instructions here. I ran the following. sudo apt-get install -y python3-pip git libtinfo-dev libzmq3-dev libcairo2-dev libpango1.0-dev...

How to define multible executables / Main modules with stack/hpack

I use stack and a package.yaml file for hpack to compile my haskell project. It has three executables backed by one library. As one would expect the executables are all defining a Main module: $...

Cabal / Stack ignores ghc-options for custom Setup scripts

I'm trying to get Stack working on an Arch system. I've done the usual: pacman -S ghc stack cabal-install And then placed the following in ~/.stack/config.yaml, so that the system GHC is used...

Haskell and postgresql - build error "The program pg_config is required but it could not be found."

I am currently learning haskell and just tried using postgresql as a database. I generated my project with stack (`stack new ` -> `stack setup` -> `stack build`) and then all I changed was adding...

How to use Visual Studio Code with Haskell and Docker

A lot of people use Visual Studio Code. Very common scenario today is to use Docker. So, I have some Haskell code in the Docker with "stack" tool - all is fine, I build my project without errors....

getDirectoryContents:openDirStream: does not exist error when trying to build with stack

I need to import Graphics.UI.Gtk and GHC suggests: Perhaps you need to add ‘text’ to the build-depends in your .cabal file. but I use stack, so I add gtk to extra-deps, execute stack build...

How to use asdf with haskell

I would like to use the asdf-haskell tool. I have installed asdf-vm, and I have installed asdf-haskell. I have installed ghc-8.4.3 and ghc-8.6.5 by running asdf install haskell 8.4.3 and asdf...

-bash: ghci: command not found (Haskell interactive shell, Haskell installation )

edit : I ended up upgrading to macOS Catalina yesterday and replacing bash with zsh. One thing that should be noted is that the stackcommand worked previously, but despite all the tinkering not...

Stack install fails on MacOS Big Sur

I am trying to stack install (clean .stack directory and stack.yaml works on Linux) on MacOS Big Sur. I get the following link errors: _iconv_open not found (during the link phase) MacOS does not...

Are recursive calls in my "permutations with repetition" code accumulated to clog the RAM?

A bit of background: I am an amateur programmer, having picked up Haskell a few months ago, on my spare time, after a period of Mathematica programmning (my first language). I am currently going...

Multiple files use the same module name:

when I type stack run I get no error message but when I type stack ghci I get this error about multiple files use the same name , how I can solve it ? (base) [email protected]:~/wejden$ stack...

Clean installation of Haskell onto a Windows 10 machine?

I just started on Haskell and really love the language! Was looking for some installation help. I just finished CIS194 and most of the excellent LYAH book. I am currently doing the fp-course...

VS Code Haskell extension - Couldn't figure out what GHC version the project is using

When I open some haskell project in VS Code I get this message: Couldn't figure out what GHC version the project is using: /home/andrej/.config/Code -...

Gitlab CI/CD: generating a release with executable attached

I'm trying to generate a release with the executable through the ci/cd pipeline system that Gitlab uses. The aim is to use the executable as part of the release in another project to generate...

How to create native ARM executables on macOS using GHC/stack

GHC now (since 8.10.5) supports producing ARM code on macOS. What flags or options in GHC or Stack do I need to use in order for it to produce ARM executables? Context: I have an M1 Mac computer....

How to call a function inside the code to return the degree of a polynomial?

In haskell's Poly package polynomials like x**2 + -1 are represented by [ -1, 0, 2] so for calculate the degree of a polynomial, I need to calculate the length of the polynomial list - 1. This is...

Is it possible to get Haskell stack to use Haskell packages provided by nix?

I'm developing a Haskell program that will eventually have some non-Haskell dependencies, and I heard that the nix integration in stack is one way to accomplish this. However, I'm now wondering...

Could not find module System.Console.MinTTY.Win32 when compiling test-framework with Stack on Windows

I'm getting an error when attempting to compile Haskell tests using test-framework on Windows. Steps to reproduce Create a new library using Stack: $ stack new repro simple-library Then navigate...