Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 254
Asalle Avatar asked Nov 30 '17 08:11

Asalle


2 Answers

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
like image 127
YAMAMOTO Yuji Avatar answered Dec 31 '22 08:12

YAMAMOTO Yuji


extensions: is currently unsupported by stack, see follow-ups in this github issue.

like image 32
Asalle Avatar answered Dec 31 '22 06:12

Asalle