I want to add ViewPatterns extensions to my build and currently I do it by adding the following lines to package.yaml
ghc-options:
- -Wall
- -XViewPatterns
I get a warning:
Warning: Instead of 'ghc-options: -XViewPatterns' use 'extensions:
ViewPatterns'
But, when I add an extensions
field to package.yaml, I get the following:
WARNING: Ignoring unknown field "extensions" in package description
Also, I could not find any definition of extensions
in the official stack documentation.
Do not confuse stack with hpack.
package.yaml
is actually read by hpack.
But stack build
command implicitly calls hpack to automatically convert into a cabal file, which may make you confused.
Anyway, to specify extensions in package.yaml,
use default-extensions
:
default-extensions: ViewPatterns
extensions:
is currently unsupported by stack, see follow-ups in this github issue.
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