I tried to add flag to package.yaml file
name: sandbox
version: 0.1.0.0
homepage: https://github.com/githubuser/sandbox#readme
license: BSD3
author: Author name here
maintainer: [email protected]
copyright: 2017 Author name here
category: Web
extra-source-files:
- README.md
flags :
sandbox:
defer-type-errors : true
dependencies:
- base >= 4.7 && < 5
executables:
sandbox:
source-dirs: src
main: Main.hs
dependencies : streaming
But I get following error :
....\sandbox\package.yaml: Error in $.flags.sandbox: key "manual" not present
To tun on type-error deferral, teach Stack to compile with the flag inside stack.yaml, not package.yaml:
resolver: ...
packages: ['.']
ghc-options:
sandbox: -fdefer-type-errors
extra-deps: []
flags: {}
extra-package-dbs: []
The flags paragraph in package.yaml is meant to declare flags for users of your package to turn on or off. See here for an example. This is typically used for conditional compilation of optional features, like integration tests.
To adjust the flags GHC will use at compiletime, use ghc-options in stack.yaml. (Confusingly enough, there is also a flags in stack.yaml.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With