简体   繁体   中英

include extensions in haskell-stack conf file

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:目前不支持堆栈,请参阅此github 问题中的后续内容。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM