Switch between production and sandbox using the haskell stack

I am working on a haskell application that calls a web service. I would like the stack buildapplication to be designed for the URL of the real production server when building with , but when debugging using the stack replapplication, it targets the URL of the test server.

I assume that this can be achieved using conditional compilation, but how to configure the stack to pass options, for example -DDEBUG=1, to GHCi, but not to GHC?

In general, many tools (Visual Studio, Xcode ...) support several build configurations for a project. Is there a stack or equivalent bondage?

+4
source share
1 answer

- , System.Environment.getProgName ghc. , - . ghc , , ghcs ghc-8.0.1 - . , .

, .ghci, ghci . , , :set -DDEBUG=1 .ghci . chmod go-w .ghci.

+3

Source: https://habr.com/ru/post/1687353/


All Articles