[英]include extensions in haskell-stack conf file
我想在我的構建中添加ViewPatterns擴展,目前我通過將以下行添加到package.yaml來實現
ghc-options:
- -Wall
- -XViewPatterns
我收到警告:
Warning: Instead of 'ghc-options: -XViewPatterns' use 'extensions:
ViewPatterns'
但是,當我向package.yaml添加extensions
字段時,我得到以下內容:
WARNING: Ignoring unknown field "extensions" in package description
另外,我在官方堆棧文檔中找不到任何extensions
定義。
不要將堆棧與hpack混淆。
package.yaml
實際上是由hpack讀取的。 但是stack build
命令隱式調用hpack來自動轉換為cabal文件,這可能會讓你感到困惑。
無論如何,要在package.yaml中指定擴展名,請使用default-extensions
:
default-extensions: ViewPatterns
extensions:
目前不支持堆棧,請參閱此github 問題中的后續內容。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.