Haskell : Syntax error

I am use Haskell stack. module Len () where my_nthele :: String -> Integer -> Char my_nthele [] n = '' my_nthele (x:xs) n | n == 0 = x | otherwise = my_nthele xs (n-1) Haskell interpreter shows "src/Len.hs:5...
more »

2017-06-22 01:06 (1) Answers

Resolving Stack Linker Error

What's the meaning of this stack output error? $stack build -v ... 2017-06-16 07:59:19.792336: [info] Linking .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/my-project/my-project ... @(Stack/Build/Execute.hs:1070:67) 2017-06-16 07:59:22.457898: [w...
more »

2017-06-16 14:06 (1) Answers

Using custom ghcjs fork with stack

I'm testing some of my own patches to ghcjs, and I was wondering how I can package it up to use with stack's fields, which seem to expect something like: setup-info: ghcjs: source: ghcjs-0.2.1.9007019_ghc-8.0.1: url: http://gh...
more »

2017-05-20 00:05 (1) Answers

Updating global GHC/i snapshot in Stack

I'm quite new to whole Haskell ecosystem and TBH most of the time learning Haskell I've spent using Haskell For Mac. Right now I'm trying to tackle projects manually using The Haskell Tool Stack as everyone encourages this way of using Haskell. Ev...
more »

2017-05-11 17:05 (1) Answers

Pass +RTS options to program run with stack exec

How do I pass +RTS options to a program run with stack exec? I've added -rtsopts to ghc-options in my cabal file, and built a program with stack build. If I run the program manually both normal and +RTS command line arguments work: >.stack-work\...
more »

2017-04-25 10:04 (1) Answers

Build binaries for Linux & Mac via CI

I wrote a Haskell program; I'd rather people not need to have Haskell installed to run it so I want to ship a binary for common platforms (OSX, Linux). I know that on my computer I can stack build or cabal build on CircleCI to generate a binary; bu...
more »

2017-04-23 22:04 (1) Answers

How to use Haskell Stack with Docker Compose?

I am trying to use docker compose to tie together some haskell services for local development. Most of the time I'm messing around in stack ghci, running unit tests, etc, but I also need to be able to run code that hits a dependency. Docker compose i...
more »

2017-04-20 22:04 (1) Answers

How to run a stack build in a Docker container?

I'd like to set up a containerized build of a Haskell stack project for work. I know that stack --docker build exists, but I'd like to do this just with docker, so my colleagues are not required to first install stack. I currently have a Dockerfile ...
more »

2017-04-16 09:04 (1) Answers

How to report failing test cases

I am using Haskell Test Framework through Stack to evaluate QuickCheck properties. When I run stack test, failing properties are reported in the form of Gave up! Passed only 95 tests. The many examples of property testing I've found report failures...
more »

2017-04-11 15:04 (2) Answers

Incorporate websockets into Yesod

How do you incorporate websockets into Yesod? I've created a project using yesod-postgres template. stack new rl yesod-postgres Handler/Home.hs file looks like this (no modification yet): module Handler.Home where import Import import qualified...
more »

2017-04-06 14:04 (1) Answers

Haskell Stack ghci flags

Basically, I am trying to achieve the following: stack ghci --flag proj:dev but it seems that flag is not valid for ghci, only for build. How can I achieve this? If possible *Notes: proj is a cloned yesod-postgres template, I do not want to use...
more »

2017-03-21 09:03 (0) Answers

Haskell stack script extra deps

In a normal stack project, I can add extra-deps in the stack.yaml file: extra-deps: - text-1.2.2.0 - unm-hip-0.3.1.6 - safe-exceptions-0.1.4.0 - quickcheck-properties-0.1 - time-interval-0.1.1 - time-units-1.0.0 - snowball-1.0.0.1 - dictionaries-0.1...
more »

2017-03-13 23:03 (0) Answers

How to use different ghc builds with stack?

I would like to have different, non-ABI-compatible, builds of the same version of GHC, and use them in different projects. (In my case, the difference between the builds is integer-simple vs gmp.) The comments in this issue show how to add a custom...
more »

2017-03-09 10:03 (1) Answers